Skip to content

Commit b0ea84e

Browse files
DavidLambauerclaude
andcommitted
feat(nx-integration-tests): stream test output, summarize results and upload reports
- Stream each module's PHPUnit output while it runs. Nx printed it only after the module finished, so a cancelled or timed-out job showed nothing. - Write a TeamCity log per module and summarize it with phpunit-report. - Upload the JUnit and TeamCity logs as an artifact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 3be3602 commit b0ea84e

2 files changed

Lines changed: 21 additions & 2 deletions

File tree

‎.github/workflows/nx-integration-tests.yml‎

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,23 @@ jobs:
153153
working-directory: ./main
154154
run: |
155155
export WARDEN="$(dirname $(pwd))/warden/bin/warden"
156-
nx affected --target=test:integration --head=HEAD --base=remotes/origin/${{ inputs.pr_base }} --parallel=1
156+
# Stream each module's PHPUnit output while it runs. Nx otherwise prints it only
157+
# after the module finished, so a cancelled or timed-out job shows nothing.
158+
nx affected --target=test:integration --head=HEAD --base=remotes/origin/${{ inputs.pr_base }} --parallel=1 --output-style=stream-without-prefixes
159+
160+
- name: Summarize Integration Test Results
161+
if: always()
162+
uses: mage-os/github-actions/phpunit-report@main
163+
with:
164+
path: main/phpunit-output/teamcity
165+
title: Integration tests
166+
167+
- name: Upload Integration Test Reports
168+
if: always()
169+
uses: actions/upload-artifact@v4
170+
with:
171+
# Artifact names must be unique per run and cannot contain the ":" of the service versions
172+
name: integration-test-reports-${{ strategy.job-index }}
173+
path: main/phpunit-output/
174+
if-no-files-found: ignore
175+
retention-days: 14

‎nx-integration-tests-setup/action.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ runs:
9292
run: |
9393
npm run generate-workspace -- --commands=test:unit,test:integration \
9494
--test:unit='if [ -d {{ MODULE_PATH }}Test/Unit ]; then ${WARDEN} env exec -T php-fpm ./vendor/bin/phpunit -c dev/tests/unit/phpunit.xml {{ MODULE_PATH }}Test/Unit; else echo "{{ MODULE_NAME }} has no unit test; fi' \
95-
--test:integration='${WARDEN} env exec -T --workdir /var/www/html/dev/tests/integration php-fpm ../../../vendor/bin/phpunit --configuration phpunit.xml.dist --testsuite '"'"'Magento Integration Tests Real Suite'"'"' --filter='"'"'/Magento/{{ MODULE_DIRECTORY }}/|Magento\\{{ MODULE_DIRECTORY }}'"'"' --log-junit=../../../phpunit-output/junit/{{ MODULE_DIRECTORY }}.xml'
95+
--test:integration='${WARDEN} env exec -T --workdir /var/www/html/dev/tests/integration php-fpm ../../../vendor/bin/phpunit --configuration phpunit.xml.dist --testsuite '"'"'Magento Integration Tests Real Suite'"'"' --filter='"'"'/Magento/{{ MODULE_DIRECTORY }}/|Magento\\{{ MODULE_DIRECTORY }}'"'"' --log-junit=../../../phpunit-output/junit/{{ MODULE_DIRECTORY }}.xml --log-teamcity=../../../phpunit-output/teamcity/{{ MODULE_DIRECTORY }}.log'
9696
9797
- name: Print Affected
9898
working-directory: ./main

0 commit comments

Comments
 (0)