From 0e2067334d58787464a3554730042dba37413c6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 7 Jan 2025 19:00:06 +0100 Subject: [PATCH] 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. Pick-to: 6.9 Change-Id: I9df0f863a42dd4cf25cee1694e85cb32058a4e5b Reviewed-by: Toni Saario --- coin/instructions/cmake_run_ctest.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/coin/instructions/cmake_run_ctest.yaml b/coin/instructions/cmake_run_ctest.yaml index d0240dcb25f..c853b0efd60 100644 --- a/coin/instructions/cmake_run_ctest.yaml +++ b/coin/instructions/cmake_run_ctest.yaml @@ -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