22name : nitro-go-tests
33on :
44 workflow_call :
5+ inputs :
6+ run-name :
7+ required : true
8+ type : string
9+ description : " The name of the test run. It will be used for labeling artifacts."
10+ run-defaults-a :
11+ required : false
12+ type : boolean
13+ run-defaults-b :
14+ required : false
15+ type : boolean
16+ run-flaky :
17+ required : false
18+ type : boolean
19+ run-pathdb :
20+ required : false
21+ type : boolean
22+ run-stylus :
23+ required : false
24+ type : boolean
25+ run-challenge :
26+ required : false
27+ type : boolean
28+ run-l3challenge :
29+ required : false
30+ type : boolean
31+ run-legacy-challenge :
32+ required : false
33+ type : boolean
34+ run-race :
35+ required : false
36+ type : boolean
37+ run-long :
38+ required : false
39+ type : boolean
40+ run-execution-spec-tests :
41+ required : false
42+ type : boolean
43+ run-pebble :
44+ required : false
45+ type : boolean
546
647jobs :
748 go-tests :
8- name : Full Go tests (matrix)
49+ name : Go tests
950 runs-on : arbitrator-ci
10- strategy :
11- fail-fast : false
12- matrix :
13- test-mode : [defaults-A, defaults-B, flaky, pathdb, challenge, stylus, l3challenge]
1451 services :
1552 redis :
1653 image : redis
1956
2057 steps :
2158 - name : Checkout
22- uses : actions/checkout@v5
59+ uses : actions/checkout@v6
2360 with :
2461 submodules : recursive
2562
@@ -37,21 +74,21 @@ jobs:
3774 - name : Build
3875 run : make -j8 build test-go-deps
3976
40- - name : Build all lint dependencies
77+ - name : Build node dependencies
4178 run : make -j8 build-node-deps
4279
4380 # --------------------- PATHDB MODE ---------------------
4481
4582 - name : run tests without race detection and path state scheme
46- if : matrix.test-mode == ' pathdb'
83+ if : inputs.run- pathdb
4784 run : >-
4885 ${{ github.workspace }}/.github/workflows/gotestsum.sh
4986 --tags cionly --timeout 90m --cover --test_state_scheme path
5087
5188 # --------------------- DEFAULTS MODE ---------------------
5289
5390 - name : run tests without race detection and hash state scheme (A-batch)
54- if : matrix.test-mode == ' defaults-A'
91+ if : inputs.run- defaults-a
5592 id : run-tests-defaults-a
5693 continue-on-error : true
5794 run : >-
6097 --junitfile test-results/junit-a.xml --run '^Test[A-L]'
6198
6299 - name : run tests without race detection and hash state scheme (B-batch)
63- if : matrix.test-mode == ' defaults-B'
100+ if : inputs.run- defaults-b
64101 id : run-tests-defaults-b
65102 continue-on-error : true
66103 run : >-
@@ -69,18 +106,18 @@ jobs:
69106 --junitfile test-results/junit-b.xml --skip '^Test[A-L]'
70107
71108 - name : Process JUnit XML logs
72- if : startsWith(matrix.test-mode, ' defaults' ) && always()
109+ if : (inputs.run-defaults-a || inputs.run- defaults-b ) && always()
73110 run : python3 ${{ github.workspace }}/.github/workflows/process_junit.py test-results/
74111
75112 - name : Upload Go test Artifacts
76- if : startsWith(matrix.test-mode, ' defaults' ) && always()
113+ if : (inputs.run-defaults-a || inputs.run- defaults-b ) && always()
77114 uses : actions/upload-artifact@v5
78115 with :
79- name : junit-reports-go-${{ matrix.test-mode }}
116+ name : junit-reports-go-${{ inputs.run-defaults-a && 'defaults-a' || 'defaults-b' }}
80117 path : test-results/junit*.xml
81118
82119 - name : Fail if tests failed
83- if : (matrix.test-mode == ' defaults-A' && steps.run-tests-defaults-a.outcome == 'failure') || (matrix.test-mode == ' defaults-B' && steps.run-tests-defaults-b.outcome == 'failure')
120+ if : (inputs.run- defaults-a && steps.run-tests-defaults-a.outcome == 'failure') || (inputs.run- defaults-b && steps.run-tests-defaults-b.outcome == 'failure')
84121 run : |
85122 echo "One or more tests failed."
86123 exit 1
@@ -92,13 +129,13 @@ jobs:
92129 --tags cionly --timeout 60m --test_state_scheme hash --consensus_execution_in_same_process_use_rpc
93130
94131 - name : run redis tests
95- if : matrix.test-mode == ' defaults-A'
132+ if : inputs.run- defaults-a
96133 run : >-
97134 gotestsum --format short-verbose -- -p 1 -run TestRedis ./arbnode/... ./system_tests/...
98135 -coverprofile=coverage-redis.txt -covermode=atomic -coverpkg=./... -- --test_redis=redis://localhost:6379/0
99136
100137 - name : Upload coverage to Codecov
101- if : startsWith(matrix.test-mode, ' defaults')
138+ if : inputs.run-defaults-a || inputs.run- defaults-b
102139 uses : codecov/codecov-action@v5
103140 with :
104141 fail_ci_if_error : false
@@ -107,21 +144,21 @@ jobs:
107144 token : ${{ secrets.CODECOV_TOKEN }}
108145
109146 - name : create block input json file
110- if : matrix.test-mode == ' defaults-A'
147+ if : inputs.run- defaults-a
111148 run : >-
112149 gotestsum --format short-verbose -- -run TestProgramStorage$ ./system_tests/... --count 1 --
113150 --recordBlockInputs.enable=true --recordBlockInputs.WithBaseDir="${{ github.workspace }}/target"
114151 --recordBlockInputs.WithTimestampDirEnabled=false --recordBlockInputs.WithBlockIdInFileNameEnabled=false
115152
116153 - name : run arbitrator prover on block input json
117- if : matrix.test-mode == ' defaults-A'
154+ if : inputs.run- defaults-a
118155 run : |
119156 make build-prover-bin
120157 target/bin/prover target/machines/latest/machine.wavm.br -b \
121158 --json-inputs="${{ github.workspace }}/target/TestProgramStorage/block_inputs.json"
122159
123160 - name : run jit prover on block input json
124- if : matrix.test-mode == ' defaults-A'
161+ if : inputs.run- defaults-a
125162 run : |
126163 make build-jit
127164 if [ -n "$(target/bin/jit \
@@ -135,7 +172,7 @@ jobs:
135172 # --------------------- FLAKY MODE --------------------------
136173
137174 - name : run flaky tests
138- if : matrix.test-mode == ' flaky'
175+ if : inputs.run- flaky
139176 continue-on-error : true
140177 run : >-
141178 ${{ github.workspace }}/.github/workflows/gotestsum.sh
@@ -144,27 +181,64 @@ jobs:
144181 # --------------------- CHALLENGE MODES ---------------------
145182
146183 - name : build challenge tests
147- if : matrix.test-mode == 'challenge'
148- run : go test -tags challengetest ./... -run=^$ -v
184+ if : inputs.run-challenge
185+ run : >-
186+ ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags challengetest
187+ --run TestChallenge --timeout 120m --cover
149188
150189 - name : run L3 challenge tests
151- if : matrix.test-mode == ' l3challenge'
190+ if : inputs.run- l3challenge
152191 run : >-
153192 ${{ github.workspace }}/.github/workflows/gotestsum.sh
154193 --tags challengetest --run TestL3Challenge --timeout 120m --cover
155194
156- # --------------------- CHALLENGE MODES ---------------------
195+ - name : run legacy challenge tests
196+ if : inputs.run-legacy-challenge
197+ run : >-
198+ ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags legacychallengetest
199+ --run TestChallenge --timeout 60m --cover
200+
201+ # --------------------- STYLUS MODE ---------------------
157202
158203 - name : run stylus tests
159- if : matrix.test-mode == ' stylus'
204+ if : inputs.run- stylus
160205 run : >-
161206 ${{ github.workspace }}/.github/workflows/gotestsum.sh
162207 --tags stylustest --run TestProgramArbitrator --timeout 60m --cover
163208
209+ # --------------------- RACE MODE ---------------------
210+
211+ - name : run race tests
212+ if : inputs.run-race
213+ run : >-
214+ ${{ github.workspace }}/.github/workflows/gotestsum.sh
215+ --race --timeout 90m --test_state_scheme hash
216+
217+
218+ # --------------------- LONG MODE ---------------------
219+
220+ - name : run long tests
221+ if : inputs.run-long
222+ run : >-
223+ ${{ github.workspace }}/.github/workflows/gotestsum.sh --tags stylustest
224+ --run TestProgramLong --timeout 60m --cover
225+
226+ # --------------------- EXECUTION SPEC MODE ---------------------
227+
228+ - name : run execution spec tests
229+ if : inputs.run-execution-spec-tests
230+ run : ${{ github.workspace }}/.github/workflows/runExecutionSpecTests.sh
231+
232+ # --------------------- PEBBLE MODE ---------------------
233+
234+ - name : run pebble tests
235+ if : inputs.run-pebble
236+ run : ${{ github.workspace }}/.github/workflows/gotestsum.sh --timeout 90m --test_database_engine pebble
237+
164238 # --------------------- ARCHIVE LOGS FOR ALL MODES ---------------------
165239
166240 - name : Archive detailed run log
167241 uses : actions/upload-artifact@v5
168242 with :
169- name : ${{ matrix.test-mode }}-full.log
243+ name : ${{ inputs.run-name }}-full.log
170244 path : full.log
0 commit comments