Skip to content

Commit f204a6a

Browse files
committed
ci: fix the test workflow setup
1 parent 2e9d10d commit f204a6a

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

.github/workflows/reusable-test.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
VERY_EXPENSIVE_TESTS_RUN: ${{ inputs.run_very_expensive_tests }}
3131
run: |
3232
echo "test_group_execution_contexts<<EOF" >> $GITHUB_OUTPUT
33-
go run ./cmd/ci/main.go --json --very-expensive-tests-run=$VERY_EXPENSIVE_TESTS_RUN list-test-group-execution-contexts | jq -r '.msg' | tee -a $GITHUB_OUTPUT
33+
go run ./cmd/ci/main.go --json list-test-group-execution-contexts --very-expensive-tests-run=$VERY_EXPENSIVE_TESTS_RUN | jq -r '.msg' | tee -a $GITHUB_OUTPUT
3434
echo "EOF" >> $GITHUB_OUTPUT
3535
cache:
3636
name: Cache Dependencies
@@ -173,6 +173,7 @@ jobs:
173173
run: mktemp -d | xargs -0 -I{} echo "path={}" | tee -a $GITHUB_OUTPUT
174174
# TODO: Track coverage (used to be tracked for conformance)
175175
- name: Run tests
176+
id: tests
176177
env:
177178
NAME: ${{ matrix.name }}
178179
LOTUS_SRC_DIR: ${{ github.workspace }}
@@ -183,19 +184,20 @@ jobs:
183184
LOTUS_RUN_VERY_EXPENSIVE_TESTS: ${{ inputs.run_very_expensive_tests && '1' || '0' }}
184185
FORMAT: ${{ fromJson(steps.group.outputs.metadata).format || 'standard-verbose' }}
185186
PACKAGES: ${{ join(fromJson(steps.group.outputs.metadata).packages, ' ') }}
187+
TIMEOUT: ${{ inputs.run_very_expensive_tests && '60m' || '10m' }}
186188
run: |
187189
gotestsum \
188190
--format "$FORMAT" \
189191
--junitfile "$REPORTS_PATH/$NAME.xml" \
190192
--jsonfile "$REPORTS_PATH/$NAME.json" \
191193
--packages="$PACKAGES" \
192-
-- ${{ fromJson(steps.group.outputs.metadata).go_test_flags || '' }}
194+
-- -timeout "$TIMEOUT" ${{ fromJson(steps.group.outputs.metadata).go_test_flags || '' }}
193195
- name: Modify junit.xml for BuildPulse
194196
env:
195197
NAME: ${{ matrix.name }}
196198
REPORTS_PATH: ${{ steps.reports.outputs.path }}
197199
PACKAGES: ${{ join(fromJson(steps.group.outputs.metadata).packages, ' ') }}
198-
if: always()
200+
if: (!cancelled())
199201
run: |
200202
# Modify test suite name and classname attributes in JUnit XML for better grouping
201203
# in BuildPulse. itests are run with go test ./itests/file_test.go and therefore Go
@@ -209,7 +211,7 @@ jobs:
209211
sed -i 's# name="github.com/filecoin-project/lotus/\(.*\)"# name="'${{ matrix.name }}':\1"#g' "$REPORTS_PATH/$NAME.xml"
210212
fi
211213
cat "$REPORTS_PATH/$NAME.xml"
212-
- if: success() || failure()
214+
- if: (!cancelled())
213215
uses: actions/upload-artifact@v4
214216
with:
215217
name: ${{ matrix.name }}-${{ runner.os }}-${{ runner.arch }}

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ permissions:
1717

1818
jobs:
1919
test:
20+
name: Test
2021
uses: ./.github/workflows/reusable-test.yml

.github/workflows/very-expensive-test.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@ permissions:
1414

1515
jobs:
1616
test:
17+
name: Test
1718
if: github.event.label.name == 'need/very-expensive-tests'
1819
uses: ./.github/workflows/reusable-test.yml
1920
with:
2021
run_very_expensive_tests: true
2122
label:
22-
if: always() && github.event.label.name == 'need/very-expensive-tests'
23+
name: Label
24+
if: github.event.label.name == 'need/very-expensive-tests'
2325
needs: test
2426
runs-on: ubuntu-latest
2527
steps:
@@ -35,7 +37,8 @@ jobs:
3537
name: context.event.label.name
3638
})
3739
issue:
38-
if: always() && github.event_name == 'schedule' && needs.test.result != 'success'
40+
name: Issue
41+
if: failure() && github.event_name == 'schedule'
3942
needs: test
4043
runs-on: ubuntu-latest
4144
steps:

cmd/ci/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func getRunners(testGroupName string) []Runner {
244244

245245
func getHasVeryExpensiveTests(testGroupName string) bool {
246246
testGroupNames := []string{
247-
"niporep-manual",
247+
"itest-niporep_manual",
248248
}
249249
return contains(testGroupNames, testGroupName)
250250
}

0 commit comments

Comments
 (0)