Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ jobs:
SAAS_PAT: ${{ secrets.INTEGRATION_TEAM_SAAS_STAGING_PAT }}
PYTEST_ADDOPTS: -o log_cli=true -o log_cli_level=INFO
run: |
poetry run nox -s check-secrets
export PROJECT_SHORT_TAG=$(poetry run nox -s get-project-short-tag)
poetry run nox -s coverage -- --

Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
name: Checks
needs: [ check-tag-version-job ]
uses: ./.github/workflows/checks.yml
secrets: inherit

cd-job:
name: Continues Delivery
Expand Down
17 changes: 17 additions & 0 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import nox
import sys

from pathlib import Path
from nox import Session
Expand Down Expand Up @@ -60,3 +61,19 @@ def get_project_short_tag(session: Session):
raise RuntimeError(
f"Could not read project short tag from file {config_file}"
)


@nox.session(name="check-secrets", python=False)
def check_secrets(session: Session):
Comment thread
ckunki marked this conversation as resolved.
Outdated
empty = [
var
for var in ["SAAS_HOST", "SAAS_PAT", "SAAS_ACCOUNT_ID"]
if not os.environ.get(var)
]
if not empty:
return
print(
f"The following environment variables are empty: {', '.join(empty)}.",
file=sys.stderr
)
sys.exit(1)
7 changes: 4 additions & 3 deletions test/integration/api_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,18 @@ def database(
yield db
wait_for_delete_clearance(start)
finally:
db_repr = f"{db.name} with ID {db.id}"
if db and not keep:
LOG.info(f"Deleting database {db.name}")
LOG.info(f"Deleting database {db_repr}")
response = self.delete_database(db.id, ignore_delete_failure)
if response.status_code == 200:
LOG.info(f"Successfully deleted database {db.name}.")
LOG.info(f"Successfully deleted database {db_repr}.")
else:
LOG.warning(f"Ignoring status code {response.status_code}.")
elif not db:
LOG.warning("Cannot delete db None")
else:
LOG.info(f"Keeping database {db.name} as keep = {keep}")
LOG.info(f"Keeping database {db_repr} as keep = {keep}")

def get_database(self, database_id: str) -> openapi.models.database.Database:
return get_database.sync(
Expand Down