Skip to content

Commit e6d79a6

Browse files
ci: split e2e tests (#285)
Signed-off-by: Jeromy Cannon <[email protected]>
1 parent dde74b0 commit e6d79a6

19 files changed

+633
-244
lines changed

.github/workflows/flow-build-application.yaml

Lines changed: 68 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,48 +43,104 @@ defaults:
4343
shell: bash
4444

4545
jobs:
46-
code:
47-
name: Code
48-
uses: ./.github/workflows/zxc-compile-code.yaml
46+
env-vars:
47+
name: Set Environment Variables
48+
uses: ./.github/workflows/zxc-env-vars.yaml
49+
with:
50+
custom-job-label: Set Environment Variables
4951

5052
code-style:
5153
name: Code Style
52-
uses: ./.github/workflows/zxc-compile-code.yaml
53-
needs:
54-
- code
54+
uses: ./.github/workflows/zxc-code-style.yaml
5555
with:
56-
custom-job-label: Check
57-
enable-code-style-check: true
56+
custom-job-label: Standard
5857

5958
unit-tests:
6059
name: Unit Tests
61-
uses: ./.github/workflows/zxc-compile-code.yaml
60+
uses: ./.github/workflows/zxc-unit-test.yaml
6261
if: ${{ github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' }}
62+
needs:
63+
- code-style
6364
with:
6465
custom-job-label: Standard
65-
enable-unit-tests: true
6666

6767
e2e-tests:
6868
name: E2E Tests
69-
uses: ./.github/workflows/zxc-compile-code.yaml
7069
if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
70+
uses: ./.github/workflows/zxc-e2e-test.yaml
71+
needs:
72+
- env-vars
73+
- code-style
7174
with:
7275
custom-job-label: Standard
73-
enable-e2e-tests: true
76+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-test-subdir }}
77+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-test-subdir }}
78+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-coverage-report }}
79+
80+
e2e-mirror-node-tests:
81+
name: E2E Tests
82+
if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
83+
uses: ./.github/workflows/zxc-e2e-test.yaml
84+
needs:
85+
- env-vars
86+
- code-style
87+
with:
88+
custom-job-label: Mirror Node
89+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
90+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
91+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
92+
93+
e2e-node-tests:
94+
name: E2E Tests
95+
if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
96+
uses: ./.github/workflows/zxc-e2e-test.yaml
97+
needs:
98+
- env-vars
99+
- code-style
100+
with:
101+
custom-job-label: Node
102+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-test-subdir }}
103+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
104+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
105+
106+
e2e-relay-tests:
107+
name: E2E Tests
108+
if: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
109+
uses: ./.github/workflows/zxc-e2e-test.yaml
110+
needs:
111+
- env-vars
112+
- code-style
113+
with:
114+
custom-job-label: Relay
115+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
116+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
117+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
74118

75119
analyze:
76120
name: Analyze
77121
uses: ./.github/workflows/zxc-code-analysis.yaml
78122
needs:
123+
- env-vars
79124
- unit-tests
80125
- e2e-tests
126+
- e2e-mirror-node-tests
127+
- e2e-node-tests
128+
- e2e-relay-tests
81129
if: ${{ (github.event_name == 'push' || github.event.inputs.enable-unit-tests == 'true' || github.event.inputs.enable-e2e-tests == 'true') && !failure() && !cancelled() }}
82130
with:
83131
custom-job-label: Source Code
84132
#enable-snyk-scan: ${{ github.event_name == 'push' || github.event.inputs.enable-snyk-scan == 'true' }}
85133
enable-codecov-analysis: true
86134
enable-codacy-coverage: true
87135
enable-e2e-coverage-report: ${{ github.event_name == 'push' || github.event.inputs.enable-e2e-tests == 'true' }}
136+
e2e-test-subdir: ${{ needs.env-vars.outputs.e2e-test-subdir }}
137+
e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
138+
e2e-node-test-subdir: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
139+
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
140+
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-coverage-report }}
141+
e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
142+
e2e-node-coverage-report: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
143+
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
88144
secrets:
89145
snyk-token: ${{ secrets.SNYK_TOKEN }}
90146
codecov-token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/flow-pull-request-checks.yaml

Lines changed: 85 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,74 +32,147 @@ concurrency:
3232
cancel-in-progress: true
3333

3434
jobs:
35-
build:
36-
name: Code
37-
uses: ./.github/workflows/zxc-compile-code.yaml
35+
env-vars:
36+
name: Set Environment Variables
37+
uses: ./.github/workflows/zxc-env-vars.yaml
38+
with:
39+
custom-job-label: Set Environment Variables
3840

3941
code-style:
4042
name: Code Style
41-
uses: ./.github/workflows/zxc-compile-code.yaml
42-
needs:
43-
- build
43+
uses: ./.github/workflows/zxc-code-style.yaml
4444
with:
45-
custom-job-label: Check
46-
enable-code-style-check: true
45+
custom-job-label: Standard
4746

4847
unit-tests:
4948
name: Unit Tests
50-
uses: ./.github/workflows/zxc-compile-code.yaml
49+
uses: ./.github/workflows/zxc-unit-test.yaml
5150
needs:
5251
- code-style
5352
with:
5453
custom-job-label: Standard
55-
enable-unit-tests: true
5654

5755
e2e-tests:
5856
name: E2E Tests
59-
uses: ./.github/workflows/zxc-compile-code.yaml
57+
uses: ./.github/workflows/zxc-e2e-test.yaml
6058
needs:
59+
- env-vars
6160
- code-style
6261
with:
6362
custom-job-label: Standard
64-
enable-e2e-tests: true
63+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-test-subdir }}
64+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-test-subdir }}
65+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-coverage-report }}
66+
67+
e2e-mirror-node-tests:
68+
name: E2E Tests
69+
uses: ./.github/workflows/zxc-e2e-test.yaml
70+
needs:
71+
- env-vars
72+
- code-style
73+
with:
74+
custom-job-label: Mirror Node
75+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
76+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
77+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
78+
79+
e2e-node-tests:
80+
name: E2E Tests
81+
uses: ./.github/workflows/zxc-e2e-test.yaml
82+
needs:
83+
- env-vars
84+
- code-style
85+
with:
86+
custom-job-label: Node
87+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-node-test-subdir }}
88+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
89+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
90+
91+
e2e-relay-tests:
92+
name: E2E Tests
93+
uses: ./.github/workflows/zxc-e2e-test.yaml
94+
needs:
95+
- env-vars
96+
- code-style
97+
with:
98+
custom-job-label: Relay
99+
npm-test-script: test-${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
100+
coverage-subdirectory: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
101+
coverage-report-name: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
65102

66103
codecov:
67104
name: CodeCov
68105
uses: ./.github/workflows/zxc-code-analysis.yaml
69106
needs:
107+
- env-vars
70108
- unit-tests
71109
- e2e-tests
110+
- e2e-mirror-node-tests
111+
- e2e-node-tests
112+
- e2e-relay-tests
72113
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
73114
with:
74115
custom-job-label: Standard
75116
enable-codecov-analysis: true
76117
enable-e2e-coverage-report: true
118+
e2e-test-subdir: ${{ needs.env-vars.outputs.e2e-test-subdir }}
119+
e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
120+
e2e-node-test-subdir: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
121+
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
122+
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-coverage-report }}
123+
e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
124+
e2e-node-coverage-report: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
125+
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
77126
secrets:
78127
codecov-token: ${{ secrets.CODECOV_TOKEN }}
79128

80129
codacy-coverage:
81130
name: Codacy
82131
uses: ./.github/workflows/zxc-code-analysis.yaml
83132
needs:
133+
- env-vars
84134
- unit-tests
85135
- e2e-tests
136+
- e2e-mirror-node-tests
137+
- e2e-node-tests
138+
- e2e-relay-tests
86139
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
87140
with:
88141
custom-job-label: Coverage
89142
enable-codacy-coverage: true
90143
enable-e2e-coverage-report: true
144+
e2e-test-subdir: ${{ needs.env-vars.outputs.e2e-test-subdir }}
145+
e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
146+
e2e-node-test-subdir: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
147+
e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
148+
e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-coverage-report }}
149+
e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
150+
e2e-node-coverage-report: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
151+
e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
91152
secrets:
92153
codacy-project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
93154

94155
# snyk:
95156
# name: Snyk Scan
96157
# uses: ./.github/workflows/zxc-code-analysis.yaml
97158
# needs:
159+
# - env-vars
98160
# - unit-tests
99161
# - e2e-tests
162+
# - e2e-mirror-node-tests
163+
# - e2e-node-tests
164+
# - e2e-relay-tests
100165
# if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && github.actor != 'dependabot[bot]' }}
101166
# with:
102167
# custom-job-label: Standard
103168
# enable-snyk-scan: true
169+
# e2e-test-subdir: ${{ needs.env-vars.outputs.e2e-test-subdir }}
170+
# e2e-mirror-node-test-subdir: ${{ needs.env-vars.outputs.e2e-mirror-node-test-subdir }}
171+
# e2e-node-test-subdir: ${{ needs.env-vars.outputs.e2e-node-test-subdir }}
172+
# e2e-relay-test-subdir: ${{ needs.env-vars.outputs.e2e-relay-test-subdir }}
173+
# e2e-coverage-report: ${{ needs.env-vars.outputs.e2e-coverage-report }}
174+
# e2e-mirror-node-coverage-report: ${{ needs.env-vars.outputs.e2e-mirror-node-coverage-report }}
175+
# e2e-node-coverage-report: ${{ needs.env-vars.outputs.e2e-node-coverage-report }}
176+
# e2e-relay-coverage-report: ${{ needs.env-vars.outputs.e2e-relay-coverage-report }}
104177
# secrets:
105178
# snyk-token: ${{ secrets.SNYK_TOKEN }}

.github/workflows/flow-update-readme.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ jobs:
5050
attempt_limit: 3
5151
attempt_delay: 5000
5252

53+
- name: Install wget
54+
run: |
55+
sudo apt-get update
56+
sudo apt-get install -y wget
57+
5358
- name: Setup Kind
5459
uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0
5560
with:

.github/workflows/zxc-code-analysis.yaml

Lines changed: 63 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,46 @@ on:
5555
type: string
5656
required: false
5757
default: "Analyze"
58+
e2e-test-subdir:
59+
description: "E2E Test Subdirectory:"
60+
type: string
61+
required: false
62+
default: "e2e"
63+
e2e-mirror-node-test-subdir:
64+
description: "E2E Mirror Node Test Subdirectory:"
65+
type: string
66+
required: false
67+
default: "e2e-mirror-node"
68+
e2e-node-test-subdir:
69+
description: "E2E Node Test Subdirectory:"
70+
type: string
71+
required: false
72+
default: "e2e-node"
73+
e2e-relay-test-subdir:
74+
description: "E2E Relay Test Subdirectory:"
75+
type: string
76+
required: false
77+
default: "e2e-relay"
78+
e2e-coverage-report:
79+
description: "E2E Coverage Report:"
80+
type: string
81+
required: false
82+
default: "E2E Tests Coverage Report"
83+
e2e-mirror-node-coverage-report:
84+
description: "E2E Mirror Node Coverage Report:"
85+
type: string
86+
required: false
87+
default: "E2E Mirror Node Tests Coverage Report"
88+
e2e-node-coverage-report:
89+
description: "E2E Node Coverage Report:"
90+
type: string
91+
required: false
92+
default: "E2E Node Tests Coverage Report"
93+
e2e-relay-coverage-report:
94+
description: "E2E Relay Coverage Report:"
95+
type: string
96+
required: false
97+
default: "E2E Relay Tests Coverage Report"
5898
secrets:
5999
snyk-token:
60100
description: "The Snyk access token is used by Snyk to analyze the code for vulnerabilities "
@@ -109,8 +149,29 @@ jobs:
109149
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
110150
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
111151
with:
112-
name: E2E Coverage Report
113-
path: 'coverage/e2e'
152+
name: ${{ inputs.e2e-coverage-report }}
153+
path: 'coverage/${{ inputs.e2e-test-subdir }}'
154+
155+
- name: Download E2E Mirror Node Coverage Report
156+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
157+
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
158+
with:
159+
name: ${{ inputs.e2e-mirror-node-coverage-report }}
160+
path: 'coverage/${{ inputs.e2e-mirror-node-test-subdir }}'
161+
162+
- name: Download E2E Node Coverage Report
163+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
164+
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
165+
with:
166+
name: ${{ inputs.e2e-node-coverage-report }}
167+
path: 'coverage/${{ inputs.e2e-node-test-subdir }}'
168+
169+
- name: Download E2E Relay Coverage Report
170+
uses: actions/download-artifact@9c19ed7fe5d278cd354c7dfd5d3b88589c7e2395 # v4.1.6
171+
if: ${{ (inputs.enable-codecov-analysis || inputs.enable-codacy-coverage) && inputs.enable-e2e-coverage-report && !cancelled() && !failure() }}
172+
with:
173+
name: ${{ inputs.e2e-relay-coverage-report }}
174+
path: 'coverage/${{ inputs.e2e-relay-test-subdir }}'
114175

115176
- name: Publish To Codecov
116177
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1

0 commit comments

Comments
 (0)