[e2e tests] Fix e2e test results path and report name (#48320)
* Fix the report name sent to woocommerce-test-reports workflow * Add test type * Test change * Remove test type * Merge artifacts to keep allure-results * Overwrite artifacts if one already exists with the same name * Test changes to trigger tests * Fix allure-results and .state paths * Filter tests for faster feedback * Debug artifacts content * Use name instead of pattern * Use name instead of pattern * Don't use an intermediate path * Use artifact name and path instead of only pattern * Use artifact name and path instead of only pattern * Use artifact name and path instead of only pattern * Remove testMatch filter to run all tests * Revert test change * Add changelog
This commit is contained in:
parent
cd0884a294
commit
1533afdca3
|
@ -255,7 +255,7 @@ jobs:
|
|||
pnpm utils slack-test-report -c "${{ needs.project-test-jobs.result }}" -r "$CHECKS_TYPE Tests" -m "$COMMIT_MESSAGE"
|
||||
|
||||
test-reports:
|
||||
name: 'Publish reports - ${{ matrix.report }}'
|
||||
name: 'Test reports - ${{ matrix.report }}'
|
||||
needs:
|
||||
[
|
||||
'project-jobs',
|
||||
|
@ -275,38 +275,49 @@ jobs:
|
|||
env:
|
||||
DESTINATION_PATH: ../
|
||||
run: ./.github/workflows/scripts/install-allure.sh
|
||||
|
||||
- name: 'Merge artifacts'
|
||||
uses: actions/upload-artifact/merge@v4
|
||||
continue-on-error: true
|
||||
with:
|
||||
name: ${{ matrix.report }}
|
||||
pattern: ${{ matrix.report }}-*
|
||||
delete-merged: true
|
||||
|
||||
- name: 'Download blob reports from artifacts'
|
||||
- name: 'Download merged artifacts'
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.report }}
|
||||
path: ./out
|
||||
pattern: ${{ matrix.report }}-*
|
||||
run-id: project-test-jobs
|
||||
merge-multiple: true
|
||||
|
||||
- name: 'Generate Allure report'
|
||||
id: generate_allure_report
|
||||
run: allure generate --clean ./out/allure-results --output ./out/allure-report
|
||||
run: |
|
||||
ls -lh ./out
|
||||
allure generate --clean ./out/allure-results --output ./out/allure-report
|
||||
ls -lh ./out
|
||||
|
||||
- name: 'Archive reports'
|
||||
- name: 'Re-upload artifacts with generated report'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.report }}
|
||||
path: ./out
|
||||
if-no-files-found: ignore
|
||||
retention-days: 5
|
||||
retention-days: 10
|
||||
overwrite: true
|
||||
|
||||
- name: 'Publish report to dashboard'
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.REPORTS_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
RUN_ID: ${{ github.run_id }}
|
||||
REPORT_NAME: ${{ matrix.report }}
|
||||
if: ${{ contains(matrix.report, 'e2e') }} # temporary until we adapt the woocommerce-test-reports side to not care about the test type
|
||||
run: |
|
||||
if [ "$GITHUB_EVENT_NAME" == pull_request ]; then
|
||||
gh workflow run publish-test-reports-pr.yml \
|
||||
-f run_id=$RUN_ID \
|
||||
-f e2e_artifact=e2e-test-report \
|
||||
-f e2e_artifact=$REPORT_NAME \
|
||||
-f pr_number=$PR_NUMBER \
|
||||
-f commit_sha=$GITHUB_SHA \
|
||||
-f s3_root=public \
|
||||
|
@ -314,7 +325,7 @@ jobs:
|
|||
elif [ "$GITHUB_EVENT_NAME" == push ]; then
|
||||
gh workflow run publish-test-reports-trunk-merge.yml \
|
||||
-f run_id=$RUN_ID \
|
||||
-f artifact=e2e-test-report \
|
||||
-f artifact=$REPORT_NAME \
|
||||
-f pr_number=$PR_NUMBER \
|
||||
-f commit_sha=$GITHUB_SHA \
|
||||
-f test_type="e2e" \
|
||||
|
@ -324,6 +335,6 @@ jobs:
|
|||
fi
|
||||
|
||||
- name: 'Add annotation to workflow run linking to PR'
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
if: ${{ github.event_name == 'pull_request' && contains(matrix.report, 'e2e') }}
|
||||
run: |
|
||||
echo "::notice::🔗🔗 The e2e report for this run is available at https://woocommerce.github.io/woocommerce-test-reports/pr/${{ github.event.pull_request.number }}/e2e"
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
Significance: patch
|
||||
Type: dev
|
||||
|
||||
[e2e tests] Fix e2e test reports paths
|
|
@ -18,7 +18,7 @@ const reporter = [
|
|||
{
|
||||
outputFolder:
|
||||
ALLURE_RESULTS_DIR ??
|
||||
`${ testsRootPath }/tests/e2e-pw/test-results/allure-results`,
|
||||
`${ testsRootPath }/test-results/allure-results`,
|
||||
detail: true,
|
||||
suiteTitle: true,
|
||||
},
|
||||
|
@ -65,7 +65,7 @@ const config = {
|
|||
use: {
|
||||
baseURL: BASE_URL ?? 'http://localhost:8086',
|
||||
screenshot: { mode: 'only-on-failure', fullPage: true },
|
||||
stateDir: `${ testsRootPath }/tests/e2e-pw/.state/`,
|
||||
stateDir: `${ testsRootPath }/.state/`,
|
||||
trace: 'retain-on-failure',
|
||||
video: 'retain-on-failure',
|
||||
viewport: { width: 1280, height: 720 },
|
||||
|
|
Loading…
Reference in New Issue