Skip to content

Commit f3e73a9

Browse files
committed
add html ui tests report
1 parent 9f8dd25 commit f3e73a9

File tree

4 files changed

+38
-17
lines changed

4 files changed

+38
-17
lines changed

.github/actions/install-all-build-libs/action.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ runs:
99
uses: actions/setup-node@v4
1010
with:
1111
node-version: '20.18.0'
12+
# disable cache for windows
13+
# https://github.com/actions/setup-node/issues/975
14+
cache: 'yarn'
15+
cache-dependency-path: '**/yarn.lock'
1216

1317
- name: Install dependencies for root package.js
1418
shell: bash

.github/workflows/tests-e2e-linux.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup Node
2929
uses: actions/setup-node@v4
3030
with:
31-
node-version: '20.15'
31+
node-version: '20.18.0'
3232

3333
- name: Download linux artifact
3434
uses: actions/download-artifact@v4

.github/workflows/tests-frontend.yml

Lines changed: 32 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,15 @@ on:
33
workflow_call:
44

55
env:
6+
SLACK_AUDIT_REPORT_CHANNEL: ${{ secrets.SLACK_AUDIT_REPORT_CHANNEL }}
67
SLACK_AUDIT_REPORT_KEY: ${{ secrets.SLACK_AUDIT_REPORT_KEY }}
8+
AWS_BUCKET_NAME_TEST: ${{ vars.AWS_BUCKET_NAME_TEST }}
9+
AWS_DEFAULT_REGION: ${{ vars.AWS_DEFAULT_REGION }}
10+
AWS_DISTRIBUTION_ID: ${{ secrets.AWS_DISTRIBUTION_ID }}
11+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
12+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
13+
REPORT_NAME: "report-vscode-fe"
14+
S3_PATH: "report-vscode-fe"
715

816
jobs:
917
unit-tests:
@@ -18,21 +26,30 @@ jobs:
1826
- name: Unit tests UI
1927
run: yarn test:cov
2028

21-
- name: Publish Test Results
22-
uses: EnricoMi/publish-unit-test-result-action@v2
29+
- name: Get current date
30+
id: date
2331
if: always()
24-
with:
25-
check_name: 'FE Unit tests summary'
26-
comment_mode: 'failures'
27-
files: reports/junit.xml
32+
uses: RedisInsight/RedisInsight/.github/actions/get-current-date@873a0ebf55c85d3127bb4efb4d0636d9ab838226
2833

29-
- name: Generate test results
30-
uses: dorny/test-reporter@v1
34+
35+
- name: Deploy 🚀
36+
if: always()
37+
run: |
38+
39+
GZIP_FILE=html.meta.json.gz
40+
S3_SUB_PATH="test-reports/${{ steps.date.outputs.date }}/${{ github.run_id }}/${{ env.REPORT_NAME }}"
41+
42+
aws s3 cp report/ s3://${AWS_BUCKET_NAME_TEST}/public/${S3_SUB_PATH} --recursive --exclude "*.gz"
43+
44+
# s3 modified "gzip" content-type
45+
# https://github.com/aws/aws-cli/issues/1131
46+
aws s3 cp report/${GZIP_FILE} s3://${AWS_BUCKET_NAME_TEST}/public/${S3_SUB_PATH}/${GZIP_FILE} --content-type "application/x-gzip" --metadata-directive REPLACE
47+
48+
echo "S3_SUB_PATH=${S3_SUB_PATH}" >> $GITHUB_ENV
49+
50+
51+
- name: Add link to report in the workflow summary
3152
if: always()
32-
with:
33-
name: 'Test results: FE unit tests'
34-
path: reports/junit.xml
35-
reporter: jest-junit
36-
list-tests: 'failed'
37-
list-suites: 'failed'
38-
fail-on-error: 'false'
53+
run: |
54+
link="${{ vars.DEFAULT_TEST_REPORTS_URL }}/${S3_SUB_PATH}/index.html"
55+
echo "[${link}](${link})" >> $GITHUB_STEP_SUMMARY

vite.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export default defineConfig({
105105
},
106106
reporters: ['default', 'junit', 'html'],
107107
outputFile: {
108-
junit: './reports/junit.xml',
108+
junit: './report/junit.xml',
109109
html: './report/index.html',
110110
},
111111
},

0 commit comments

Comments
 (0)