New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: refactoring #4812
CI: refactoring #4812
Conversation
Our CI test system invokes ctest with the name of the given tests it wishes to invoke. ctest (with the `-R` flag) treats this name as a regular expression. Provide anchors in the regular expression to avoid matching additional tests in this search.
This reverts commit a2d73f5. Using clar to propagate the XML settings was a mistake.
Add the clar flags to produce JUnit-style XML output before invocation.
Introduce SKIP_*_TEST variables for Windows builds to match POSIX builds.
154dfac
to
44383dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, except for the one hardcoded path 馃憤
@@ -41,7 +41,7 @@ die() { | |||
# test configuration in a single place (tests/CMakeLists.txt) instead of running clar | |||
# here as well. But it allows us to wrap our test harness with a leak checker like valgrind. | |||
run_test() { | |||
TEST_CMD=$(ctest -N -V -R $1 | sed -n 's/^[0-9]*: Test command: //p') | |||
TEST_CMD=$(ctest -N -V -R "^${1}$" | sed -n 's/^[0-9]*: Test command: //p') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh, I love this. It has bothered me too many times
ci/test.ps1
Outdated
$TestName = $args[0] | ||
|
||
$TestCommand = (ctest -N -V -R "^$TestName$") -join "`n" -replace "(?ms).*\n^[0-9]*: Test command: ","" -replace "\n.*","" | ||
$TestCommand = "C:\LibGit2\libgit2-2\build\Debug\libgit2_clar.exe -sa" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look intended? You first set TestCommand
to some magic voodoo and then overwrite it with a hard-coded path. I guess the second line was for debugging purposes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I guess you accidentally squashed the fix into the wrong commit. Feel free to fix it up if you want to, I'm happy to have this merged either way.
Similar to the way we parse the ctest output on POSIX systems, do the same on Windows. This allows us to append the `-r` flag to clar after we've identified the command to run.
Don't stop on test failures; run all the tests, even when a test fails.
44383dc
to
429c7f1
Compare
Thanks, I did fixup the wrong commit. I've updated this. |
When I introduced #4723, @pks-t asked why we were stopping on the first failure instead of continuing to run all the tests and simply report the errors. Now that our CI run is faster, I've changed our CI to continue and simply report an error at the end.
In addition, I've reverted the CMake changes to enable XML output. It was a gross hack, and we can instead append
-r
during the CI test runs. This is still a bit of a hack, but a less gross one. 馃槈