Skip to content

Commit fc9ac13

Browse files
authored
CCM-10980: standardise test reports (#592)
1 parent db02f40 commit fc9ac13

File tree

6 files changed

+38
-35
lines changed

6 files changed

+38
-35
lines changed

.github/actions/acceptance-tests/action.yaml

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,30 +44,9 @@ runs:
4444
run: |
4545
make test-${{ inputs.testType }}
4646
47-
- name: Archive ui-e2e test results
48-
if: ${{ inputs.testType == 'ui-e2e' }}
47+
- name: Archive test results
4948
uses: actions/upload-artifact@v4
49+
if: always()
5050
with:
51-
name: UI E2E test report
52-
path: "tests/test-team/playwright-report"
53-
54-
- name: Archive ui-component test results
55-
if: ${{ inputs.testType == 'ui-component' }}
56-
uses: actions/upload-artifact@v4
57-
with:
58-
name: UI-component test report
59-
path: "tests/test-team/playwright-report"
60-
61-
- name: Archive api test results
62-
if: ${{ inputs.testType == 'api' }}
63-
uses: actions/upload-artifact@v4
64-
with:
65-
name: API test report
66-
path: "tests/test-team/playwright-report"
67-
68-
- name: Archive accessibility results
69-
if: ${{ inputs.testType == 'accessibility' }}
70-
uses: actions/upload-artifact@v4
71-
with:
72-
name: accessibility
73-
path: "tests/accessibility/.reports/accessibility"
51+
name: ${{ inputs.testType }} - test report
52+
path: "tests/acceptance-test-report"

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ on:
66
push:
77
branches:
88
- "**"
9-
pull_request:
10-
types: [opened, reopened]
119

1210
jobs:
1311
metadata:

scripts/tests/accessibility.sh

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,22 @@ set -euo pipefail
44

55
# feature flag
66
export NEXT_PUBLIC_ENABLE_PROOFING=true
7-
87
export INCLUDE_AUTH_PAGES=true
98

109
npm run accessibility-test-setup -w tests/accessibility
11-
1210
npm run build
13-
1411
mkdir -p ./frontend/public/testing
1512
cp ./utils/utils/src/email-templates/* ./frontend/public/testing/
1613

1714
npm run app:start --prefix frontend
18-
1915
npm run app:wait --prefix frontend
2016

21-
npm run test:accessibility -w tests/accessibility
17+
TEST_EXIT_CODE=0
18+
npm run test:accessibility -w tests/accessibility || TEST_EXIT_CODE=$?
19+
echo "TEST_EXIT_CODE=$TEST_EXIT_CODE"
2220

21+
mkdir -p ./tests/acceptance-test-report
22+
cp -r ./tests/accessibility/.reports/accessibility ./tests/acceptance-test-report
2323
npm run accessibility-test-teardown -w tests/accessibility
24+
25+
exit $TEST_EXIT_CODE

scripts/tests/api.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ set -euo pipefail
44
cd "$(git rev-parse --show-toplevel)"
55
npx playwright install --with-deps > /dev/null
66
cd tests/test-team
7-
npm run test:api
7+
TEST_EXIT_CODE=0
8+
npm run test:api || TEST_EXIT_CODE=$?
9+
echo "TEST_EXIT_CODE=$TEST_EXIT_CODE"
10+
11+
mkdir -p ../acceptance-test-report
12+
cp -r ./playwright-report ../acceptance-test-report
13+
[[ -e test-results ]] && cp -r ./test-results ../acceptance-test-report
14+
15+
exit $TEST_EXIT_CODE

scripts/tests/ui-component.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ set -euo pipefail
44
cd "$(git rev-parse --show-toplevel)"
55
npx playwright install --with-deps > /dev/null
66
cd tests/test-team
7-
npm run test:local-ui
7+
TEST_EXIT_CODE=0
8+
npm run test:local-ui || TEST_EXIT_CODE=$?
9+
echo "TEST_EXIT_CODE=$TEST_EXIT_CODE"
10+
11+
mkdir -p ../acceptance-test-report
12+
cp -r ./playwright-report ../acceptance-test-report
13+
[[ -e test-results ]] && cp -r ./test-results ../acceptance-test-report
14+
15+
exit $TEST_EXIT_CODE

scripts/tests/ui-e2e.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,12 @@ set -euo pipefail
44
cd "$(git rev-parse --show-toplevel)"
55
npx playwright install --with-deps > /dev/null
66
cd tests/test-team
7-
npm run test:e2e
7+
TEST_EXIT_CODE=0
8+
npm run test:e2e || TEST_EXIT_CODE=$?
9+
echo "TEST_EXIT_CODE=$TEST_EXIT_CODE"
10+
11+
mkdir -p ../acceptance-test-report
12+
cp -r ./playwright-report ../acceptance-test-report
13+
[[ -e test-results ]] && cp -r ./test-results ../acceptance-test-report
14+
15+
exit $TEST_EXIT_CODE

0 commit comments

Comments
 (0)