Skip to content

Commit

Permalink
feature(package): Tests Work Locally.
Browse files Browse the repository at this point in the history
  • Loading branch information
acederberg committed Aug 18, 2024
1 parent 88c16b9 commit c81b545
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
27 changes: 15 additions & 12 deletions .github/workflows/commit_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,21 +115,21 @@ jobs:
# More about interpolation: https://docs.docker.com/compose/environment-variables/variable-interpolation/
- name: Setup.
run: |
mkdir docker/.venv
mkdir --parent docker/.venv
docker_config_path='/home/captura/app/tests/assets/act.yaml'
echo "CAPTURA_CONFIG_CLIENT_TEST=$docker_config_path" > .env
echo "CAPTURA_CONFIG_CLIENT=$docker_config_path" >> .env
echo "CAPTURA_CONFIG_APP_TEST=$docker_config_path" >> .env
echo "CAPTURA_CONFIG_APP=$docker_config_path" >> .env
echo "CAPTURA_CONFIG_APP=$docker_config_path" >> .env
echo "CAPTURA_FLAKEY=FLAKEY=/home/captura/flakey.yaml" >> .env
echo "CAPTURA_FLAKEY=/home/captura/flakey.yaml" >> .env
- name: Start Docker Compose Project.
run: |
docker compose \
--file docker/compose.yaml \
--env-file .env \
up --detach --quite-pull
up --detach --quiet-pull
docker compose \
--file docker/compose.yaml \
Expand All @@ -154,21 +154,24 @@ jobs:
exec server \
bash -c ' \
source ~/.venv/bin/activate \
&& pip install poetry \
&& poetry run simulatus apply'
echo -e "# Dummy Data Report\n\n~~~" >> $GITHUB_STEP_SUMMARY
docker compose \
--file docker/compose.yaml \
exec server \
bash -c ' \
source ~/.venv/bin/activate \
&& poetry run simulatus --loud reports aggregate' \
>> $GITHUB_STEP_SUMMARY
echo -e "~~~\n" >> $GITHUB_STEP_SUMMARY
- name: Run Tests.
run: |
docker compose \
--file docker/compose.yaml \
exec server \
bash -c ' \
source ~/.bashrc \
source ~/.venv/bin/activate \
&& pip install poetry \
&& poetry run pytest --count 1'
1 change: 1 addition & 0 deletions docker/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ services:
CAPTURA_CONFIG_APP: "${CAPTURA_CONFIG_APP-/home/captura/app/config/app.yaml}"
CAPTURA_CONFIG_APP_TEST: "${CAPTURA_CONFIG_APP_TEST-/home/captura/app/config/app.test.yaml}"
CAPTURA_FLAKEY: "${CAPTURA_FLAKEY-/home/captura/app/config/flakey.yaml}"
CAPTURA_PLUGINS_USE: "${CAPTURA_PLUGINS_USE-0}"
image: acederberg/captura-development:0.1.5
container_name: captura-server
ports:
Expand Down
3 changes: 2 additions & 1 deletion tests/assets/act.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ app:
host_schema: http://
auth0:
api:
audience: captura-dev
audience:
- captura-dev
app:
client_id: fake
client_secret: fake
Expand Down
1 change: 1 addition & 0 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class PytestConfig(ConfigSimulatus):
env_nested_delimiter="__",
extra="allow",
)

tests: PytestSubConfig


Expand Down

0 comments on commit c81b545

Please sign in to comment.