Skip to content

Commit

Permalink
Rework PR check actions to check for "debug logging", and if set, to …
Browse files Browse the repository at this point in the history
…disable the junit reporter (it silences test "crashes")
  • Loading branch information
djbe committed Apr 8, 2024
1 parent 5fec2c7 commit 90ff182
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 11 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/laravel-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,13 @@ jobs:
php artisan config:cache
php artisan migrate --seed
- name: Run tests
run: vendor/bin/pest --log-junit="test-reports/junit.xml"
run: |
if [ "$RUNNER_DEBUG" != '1' ]; then
TEST_REPORTER=(--log-junit="test-reports-junit.xml")
fi
vendor/bin/pest "${TEST_REPORTER[@]"
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: test-reports/junit.xml
report_paths: test-reports-junit.xml
11 changes: 7 additions & 4 deletions .github/workflows/node-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ jobs:
name: app-build
- name: Run tests
run: |
if test -f '.env.test'; then cp -f '.env.test' '.env'; fi
node --test -r dotenv/config \
--test-reporter=junit \
--test-reporter-destination="test-report-junit.xml"
if test -f '.env.test'; then
cp -f '.env.test' '.env'
fi
if [ "$RUNNER_DEBUG" != '1' ]; then
TEST_REPORTER=(--test-reporter=junit --test-reporter-destination="test-report-junit.xml")

Check warning on line 176 in .github/workflows/node-build-and-test.yml

View workflow job for this annotation

GitHub Actions / Lint YAML & Dockerfile / Lint YAML

176:101 [line-length] line too long (101 > 100 characters)
fi
node --test -r dotenv/config "${TEST_REPORTER[@]}"
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/nuxt-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,13 @@ jobs:
name: app-build
- name: Run tests
run: |
if test -f '.env.test'; then cp -f '.env.test' '.env'; fi
pnpm vitest --run --reporter=junit --outputFile="test-reports/junit.xml"
if test -f '.env.test'; then
cp -f '.env.test' '.env'
fi
if [ "$RUNNER_DEBUG" != '1' ]; then
TEST_REPORTER=(--reporter=junit --outputFile="test-report-junit.xml")
fi
pnpm vitest --run "${TEST_REPORTER[@]"
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/web-build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,15 @@ jobs:
run: pnpm install --frozen-lockfile
- name: Run tests
run: |
if test -f '.env.test'; then cp -f '.env.test' '.env'; fi
pnpm vitest --run --reporter=junit --outputFile="test-reports/junit.xml"
if test -f '.env.test'; then
cp -f '.env.test' '.env'
fi
if [ "$RUNNER_DEBUG" != '1' ]; then
TEST_REPORTER=(--reporter=junit --outputFile="test-report-junit.xml")
fi
pnpm vitest --run "${TEST_REPORTER[@]"
- name: Publish test report
uses: mikepenz/action-junit-report@v4
if: always() # always run even if the previous step fails
with:
report_paths: test-reports/junit.xml
report_paths: test-reports-junit.xml

0 comments on commit 90ff182

Please sign in to comment.