coin: Ignore exit code of LastTest.log copy if COIN_CTEST_IGNORE_EXIT_CODE

If COIN_CTEST_IGNORE_EXIT_CODE is in effect and ctest aborts for some
reason (for example due to the workitem being cancelled) the ctest exit
code will be ignored, as expected, but we will not have a LastTest.log
to copy, which will fail the workitem unexpectedly.

We now match the ignoreExitCode of the LastTest.log copy with the ctest
run.

Change-Id: I9df0f863a42dd4cf25cee1694e85cb32058a4e5b
Reviewed-by: Toni Saario <toni.saario@qt.io>
(cherry picked from commit 0e2067334d58787464a3554730042dba37413c6d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2025-01-07 19:00:06 +01:00 committed by Qt Cherry-pick Bot
parent 58221c1955
commit 197a46313d

View File

@ -141,6 +141,16 @@ instructions:
maxTimeBetweenOutput: 14400
userMessageOnFailure: >
Failed to run tests.
- type: ExecuteCommand
command: >
cmake -E copy
Testing{{.Env.CI_PATH_SEP}}Temporary{{.Env.CI_PATH_SEP}}LastTest.log
{{.Env.COIN_CTEST_RESULTSDIR}}{{.Env.CI_PATH_SEP}}CTest.log
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
ignoreExitCode: false
userMessageOnFailure: >
Failed to copy LastTest.log to testresults directory.
executeOn: always
- type: Group
enable_if:
condition: runtime
@ -155,16 +165,13 @@ instructions:
maxTimeBetweenOutput: 14400
userMessageOnFailure: >
Failed to run tests.
- type: Group
instructions:
- type: ExecuteCommand
command: >
cmake -E copy
Testing{{.Env.CI_PATH_SEP}}Temporary{{.Env.CI_PATH_SEP}}LastTest.log
{{.Env.COIN_CTEST_RESULTSDIR}}{{.Env.CI_PATH_SEP}}CTest.log
executeCommandArgumentSplitingBehavior: SplitAfterVariableSubstitution
ignoreExitCode: false
ignoreExitCode: true
userMessageOnFailure: >
Failed to copy LastTest.log to testresults directory.
executeOn: always