Skip to content

Commit

Permalink
fix handling of main-only tests on linux and darwin (digital-asset#18280
Browse files Browse the repository at this point in the history
)
  • Loading branch information
paulbrauner-da authored Jan 25, 2024
1 parent 274120a commit 3dd4fae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
5 changes: 2 additions & 3 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,18 @@ if ($env:SKIP_TESTS -ceq "False") {
./ci/remap-scala-test-short-names.ps1 `
| Out-File -Encoding UTF8 -NoNewline scala-test-suite-name-map.json

$ALL_TESTS_FILTER = "-pr-only"
$FEWER_TESTS_FILTER = "-main-only"

$tag_filter = "-dev-canton-test,-canton-ee"
switch ($env:TEST_MODE) {
'main' {
$tag_filter = "$tag_filter,$ALL_TESTS_FILTER"
Write-Output "Running all tests because TEST_MODE is 'main'"
}
'pr' {
if (Has-Run-All-Tests-Trailer) {
Write-Output "ignoring 'pr' test mode because the commit message features 'run-all-tests: true'"
$tag_filter = "$tag_filter,$ALL_TESTS_FILTER"
} else {
Write-Output "Running fewer tests because TEST_MODE is 'pr'"
$tag_filter = "$tag_filter,$FEWER_TESTS_FILTER"
}
}
Expand Down
11 changes: 4 additions & 7 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,19 @@ has_run_all_tests_trailer() {
[[ $run_all_tests == "true" ]]
}

ALL_TESTS_FILTER="-pr-only"
FEWER_TESTS_FILTER="-main-only"

tag_filter=""
case $test_mode in
# When running against main, exclude "pr-only" tests
main)
tag_filter=$FEWER_TESTS_FILTER
echo "running all tests because test mode is 'main'"
;;
# When running against a PR, exclude "main-only" tests, unless the commit message features a
# 'run-all-tests: true' trailer
pr)
if has_run_all_tests_trailer; then
echo "ignoring 'pr' test mode because the commit message features 'run-all-tests: true'"
tag_filter=$ALL_TESTS_FILTER
else
tag_filter=$FEWER_TESTS_FILTER
echo "running fewer tests because test mode is 'pr'"
tag_filter="-main-only"
fi
;;
*)
Expand Down

0 comments on commit 3dd4fae

Please sign in to comment.