βββ gradlew
βββ gradlew.bat
βββ pytest.ini
βββ requirements.txt
βββ src
βΒ Β βββ README.md
βΒ Β βββ all-commands.sh
βΒ Β βββ bucket-api
βΒ Β βΒ Β βββ Dockerfile
βΒ Β βΒ Β βββ README.md
βΒ Β βΒ Β βββ bucket-api-template.yaml
βΒ Β βΒ Β βββ deploy.sh
βΒ Β βΒ Β βββ main.py
βΒ Β βΒ Β βββ requirements.txt
βΒ Β βΒ Β βββ tests
βΒ Β βΒ Β βΒ Β βββ test_bucket_api.py
βΒ Β βΒ Β βββ upload-test.txt
β βββ pubsub-api
β β βββ Dockerfile
β β βββ deploy.sh
β β βββ pubsub-api-template.yaml
β β βββ pubsub_api_main.py
β β βββ requirements.txt
β β βββ test_pubsub_api.py
PROJECT_ID="<your-project-id>"
pytest
# or ./gradlew test
gladle clean
GOOGLE_APPLICATION_CREDENTIALS
, GCS_BUCKET_NAME
, and GOOGLE_CLOUD_PROJECT
environment variables are used with default('D:') option in setup.cfg.
So if you want to test in src/bucket-api or src/pubsub-api path, .sa
file should be created in each foler.
[flake8]
max-line-length = 200
ignore = F123, E456
exclude = .terraform
[tool:pytest]
log_cli=True
log_cli_level=DEBUG
; --html=report.html = pip install pytest-html
addopts=--failed-first --cov=src/bucket-api --cov=src/pubsub-api --junit-xml=build/test-result.xml --html=build/test-report.html --cov-report=xml:build/test-coverage.xml
junit_family=legacy
; --cov-branch
; norecursedirs=.pyenv-python
env =
D:GOOGLE_APPLICATION_CREDENTIALS=.sa
D:GCS_BUCKET_NAME={PROJECT_ID}-bucket-api
D:GOOGLE_CLOUD_PROJECT={PROJECT_ID}