Skip to content

Commit

Permalink
chore: pre-create a directory for reports to make it exists even when…
Browse files Browse the repository at this point in the history
… integration tests weren't run

When `docker compose up` has failed because a container couldn't startup, the integration tests step
is skipped and directory hurl-reports wasn't created. In this case, "Save application logs" step
also has been failing with error:
  tee: ../hurl-reports/application-logs.txt: No such file or directory

Part of #13
  • Loading branch information
php-coder committed Mar 27, 2024
1 parent 465d6fd commit cf3087b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ jobs:
- name: Show docker compose version
run: docker compose version

- name: Create directory for reports
run: mkdir tests-reports

- name: Start containers
working-directory: docker
run: >-
Expand All @@ -83,7 +86,7 @@ jobs:
run: >-
hurl \
--error-format long \
--report-html hurl-reports \
--report-html tests-reports \
--variable SERVER_URL=http://127.0.0.1:${{ matrix.application-port }} \
--test \
tests/crud.hurl
Expand All @@ -95,7 +98,7 @@ jobs:
docker compose logs \
--no-log-prefix \
--timestamps \
${{ matrix.docker-service-name }} | tee ../hurl-reports/application-logs.txt
${{ matrix.docker-service-name }} | tee ../tests-reports/application-logs.txt
- name: Stop containers
if: always()
Expand All @@ -111,4 +114,4 @@ jobs:
uses: actions/[email protected] # https://github.com/actions/upload-artifact
with:
name: ${{ matrix.docker-service-name }}-report-and-logs
path: hurl-reports/
path: tests-reports/

0 comments on commit cf3087b

Please sign in to comment.