Skip to content

Commit

Permalink
Fix vault and add logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ademariag committed Sep 15, 2023
1 parent f9ee348 commit b4805cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test-build-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
runs-on: ubuntu-latest
if: success() || failure() # Continue running if other jobs fail
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]

Expand Down
4 changes: 4 additions & 0 deletions tests/vault_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def __init__(self):
self.docker_client = docker.from_env()
self.container = self.setup_container()
self.port = self.container.attrs["NetworkSettings"]["Ports"]["8200/tcp"][0]["HostPort"]
logger.info(f"Vault server running on port {self.port}")
self.vault_client = None
self.setup_vault()

Expand All @@ -48,9 +49,11 @@ def setup_container(self):
)
# make sure the container is up & running before testing
while vault_container.status != "running":
logger.info("Waiting for vault container to start...")
sleep(2)
vault_container.reload()

logger.info(f"Vault container started {vault_container.id}")
return vault_container

def setup_vault(self):
Expand Down Expand Up @@ -105,6 +108,7 @@ def set_vault_attributes(self):
def close_container(self):
self.vault_client.adapter.close()

logger.info(f"Stopping vault container {self.container.id}")
self.container.stop()
self.docker_client.close()

Expand Down

0 comments on commit b4805cb

Please sign in to comment.