Skip to content

Commit

Permalink
ci: simplif timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Jul 23, 2024
1 parent 919535f commit 158bcce
Showing 1 changed file with 6 additions and 22 deletions.
28 changes: 6 additions & 22 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ jobs:
- id: test
env:
LOTUS_RUN_VERY_EXPENSIVE_TESTS: ${{ steps.envs.outputs.run_very_expensive_tests }}
# Unit test groups other than unit-rest
utests: |
[
Expand All @@ -77,11 +76,6 @@ jobs:
"skip_conformance": "0"
}
]
# Tests that are very expensive to run and need a higher timeout when activated
very_expensive_tests: |
[
"itest-niporep_manual"
]
# Mapping from test group names to custom runner labels
# The jobs default to running on the default hosted runners (4 CPU, 16 RAM).
# We use self-hosted xlarge (4 CPU, 8 RAM; and large - 2 CPU, 4 RAM) runners
Expand Down Expand Up @@ -196,21 +190,6 @@ jobs:
# Apply the needs_parameters flag to the groups
groups="$(jq -n --argjson g "$groups" --argjson p "$parameters" '$g | map(. + {"needs_parameters": ([.name] | inside($p)) })')"
# Update the timeout for very expensive tests
if [ "${LOTUS_RUN_VERY_EXPENSIVE_TESTS}" == "1" ]; then
groups="$(jq -n --argjson g "$groups" --argjson e "$very_expensive_tests" '$g | map(
if ([.name] | inside($e)) then
if .go_test_flags then
.go_test_flags += " -timeout=60m"
else
. + {"go_test_flags": "-timeout=60m"}
end
else
.
end
)')"
fi
# Output the groups
echo "groups=$groups"
echo "groups=$(jq -nc --argjson g "$groups" '$g')" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -325,13 +304,18 @@ jobs:
TEST_RUSTPROOFS_LOGS: ${{ matrix.test_rustproofs_logs || '0' }}
FORMAT: ${{ matrix.format || 'standard-verbose' }}
PACKAGES: ${{ join(matrix.packages, ' ') }}
GO_TEST_FLAGS: ${{ matrix.go_test_flags || '' }}
run: |
if [ "$LOTUS_RUN_VERY_EXPENSIVE_TESTS" == "1" ] && [[ ! "$GO_TEST_FLAGS" =~ "-timeout" ]]; then
GO_TEST_FLAGS="$GO_TEST_FLAGS -timeout 30m"
fi
gotestsum \
--format "$FORMAT" \
--junitfile "$REPORTS_PATH/$NAME.xml" \
--jsonfile "$REPORTS_PATH/$NAME.json" \
--packages="$PACKAGES" \
-- ${{ matrix.go_test_flags || '' }}
-- ${GO_TEST_FLAGS}
- if: success() || failure()
uses: actions/upload-artifact@v4
with:
Expand Down

0 comments on commit 158bcce

Please sign in to comment.