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 8dffb97 commit a60fa64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .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 Expand Up @@ -72,7 +73,7 @@ jobs:
pip3 install coverage black
- name: Run tests
run: |-
make test && make test_coverage
make test_coverage
build:
name: build ${{ matrix.platform }} image
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 a60fa64

Please sign in to comment.