-
Notifications
You must be signed in to change notification settings - Fork 10
107 lines (93 loc) · 2.93 KB
/
Copy pathtests-e2e-linux.yml
File metadata and controls
107 lines (93 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Tests E2E Linux
on:
workflow_call:
inputs:
report:
description: Send report to Slack
required: false
default: false
type: boolean
env:
SLACK_TEST_REPORT_KEY: ${{ secrets.SLACK_TEST_REPORT_KEY }}
TEST_BIG_DB_DUMP: ${{ secrets.TEST_BIG_DB_DUMP }}
jobs:
e2e-linux-tests:
runs-on: ubuntu-latest
name: E2E tests
strategy:
fail-fast: false
matrix:
# Number of threads to run tests
parallel: [0, 1, 2, 3]
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20.18.0'
- name: Download linux artifact
uses: actions/download-artifact@v4
with:
name: linux-build
path: ./release
- name: Cache E2E Yarn dependencies
uses: actions/cache@v4
with:
path: |
tests/e2e/node_modules
key: ${{ runner.os }}-yarn-e2e-${{ hashFiles('tests/e2e/yarn.lock', 'tests/e2e/package.json') }}
restore-keys: |
${{ runner.os }}-yarn-e2e-
- name: Setup e2e tests
working-directory: ./tests/e2e
run: |
npm install -g @vscode/vsce
yarn install
yarn compile
ls -R dist/tests/
- name: Generate short list of the test files
working-directory: ./tests/e2e
run: |
testFiles=$(find dist -type f -name '*.e2e.js' | sort | awk "NR % 4 == ${{ matrix.parallel }}")
echo $testFiles
# Multi-Line value
echo "TEST_FILES<<EOF" >> $GITHUB_ENV
echo "$testFiles" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Run tests
run: |
.github/e2e/test.app.sh
- name: Upload Test Mocha Report
uses: actions/upload-artifact@v4
if: always()
with:
name: mocha-report-linux-node-${{ matrix.parallel }}
path: tests/e2e/mochawesome-report
- name: Send report to Slack
if: inputs.report && always()
run: |
APP_BUILD_TYPE="VSCode (Linux)" node ./.github/e2e/e2e-results.js
# curl -H "Content-type: application/json" --data @e2e.report.json -H "Authorization: Bearer $SLACK_TEST_REPORT_KEY" -X POST https://slack.com/api/chat.postMessage
- name: Generate test results for ${{ matrix.parallel }}th node
uses: dorny/test-reporter@v1
if: always()
with:
name: 'Test results: E2E (linux) ${{ matrix.parallel }}th node'
path: tests/e2e/mochawesome-report/junit-report.xml
reporter: java-junit
list-tests: 'failed'
list-suites: 'failed'
fail-on-error: 'false'
merge-artifacts:
runs-on: ubuntu-latest
needs: e2e-linux-tests
steps:
- name: Merge report artifacts
id: merge-artifacts
uses: actions/upload-artifact/merge@v4
with:
name: mocha-report-linux
pattern: mocha-report-linux-node-*
separate-directories: true
delete-merged: true
retention-days: 5