ENH: Reduce CTest verbosity to show output only for failing tests#5971
Open
hjmjohnson wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
Open
ENH: Reduce CTest verbosity to show output only for failing tests#5971hjmjohnson wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson wants to merge 2 commits intoInsightSoftwareConsortium:mainfrom
Conversation
Replace -VV (extra verbose) with -V (verbose) in all CI pipeline invocations of `ctest -S`. This change applies to all 8 Azure DevOps pipeline YAML files and the GitHub Actions arm.yml workflow. Background: The -VV flag causes CTest to print the full stdout/stderr of every test, regardless of whether it passed or failed. With ITK's 3000+ tests, this generates hundreds of megabytes of CI log output, making it difficult to find the actual failure in a failing build. Every pipeline already sets the environment variable CTEST_OUTPUT_ON_FAILURE=1, which instructs CTest to print test output only when a test fails. However, this variable has been effectively dead code because -VV unconditionally prints all output, overriding the output-on-failure behavior. With this change: - -V (verbose) prints CTest progress: test names, pass/fail status, and timing — sufficient for monitoring build progress - CTEST_OUTPUT_ON_FAILURE=1 now takes effect, printing full test output only for tests that fail - CI logs are dramatically smaller and failures are easier to find Note: The CTEST_OUTPUT_ON_FAILURE environment variable works in both direct ctest invocations and ctest -S scripted/dashboard mode. The ctest_test() CMake command used internally by itk_common.cmake does not have an OUTPUT_ON_FAILURE keyword argument, but the environment variable is read by the CTest process regardless of invocation mode. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Greptile SummaryThis PR replaces The change is mechanical and complete: all eight YAML files that call Notable considerations:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["CI pipeline triggers\n(push / PR)"] --> B["ctest -S dashboard.cmake -V -j N"]
B --> C{Test result?}
C -- Pass --> D["Print: test name + status + timing\n(no stdout/stderr captured)"]
C -- Fail --> E["CTEST_OUTPUT_ON_FAILURE=1\nPrint: test name + status + full stdout/stderr"]
D --> F["CTest summary"]
E --> F
F --> G["ci_addons: format JUnit XML\n(Azure Pipelines only)"]
G --> H["PublishTestResults\n(Azure Pipelines only)"]
style E fill:#f96,color:#000
style D fill:#9c9,color:#000
Last reviewed commit: "ENH: Reduce CTest ve..." |
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
Mar 20, 2026
DO NOT MERGE — this commit intentionally introduces: 1. An unused variable in itkObject.cxx to generate a compiler warning (-Wunused-variable) that should appear in CDash warning counts. 2. A deliberate EXIT_FAILURE in itkPointGeometryTest to verify that CTEST_OUTPUT_ON_FAILURE=1 produces visible test output in CI logs when using -V instead of -VV. This is a test artifact for PR InsightSoftwareConsortium#5971 (reduce CTest verbosity). If the CI logs show the "DELIBERATE FAILURE" message in the test output section, the new verbosity scheme is working correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ctest_build() captures compiler diagnostics in Build.xml for CDash submission but does not print them to the CI log. With -V (instead of -VV), build output scrolls past quickly and warnings are easy to miss entirely. Add report_build_diagnostics.py which parses the <Warning> and <Error> elements from Build.xml and prints them in a clearly delimited section. Add a "Report build warnings and errors" step to every Azure DevOps and GitHub Actions pipeline, running after the build/test step with succeededOrFailed()/always() so diagnostics are reported even when the build fails. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
Mar 20, 2026
DO NOT MERGE — this commit intentionally introduces: 1. An unused variable in itkObject.cxx to generate a compiler warning (-Wunused-variable) that should appear in CDash warning counts. 2. A deliberate EXIT_FAILURE in itkPointGeometryTest to verify that CTEST_OUTPUT_ON_FAILURE=1 produces visible test output in CI logs when using -V instead of -VV. This is a test artifact for PR InsightSoftwareConsortium#5971 (reduce CTest verbosity). If the CI logs show the "DELIBERATE FAILURE" message in the test output section, the new verbosity scheme is working correctly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
hjmjohnson
added a commit
to hjmjohnson/ITK
that referenced
this pull request
Mar 20, 2026
Point all CI pipelines at hjmjohnson/ITK dash-board-github-ci-instrument-groupings branch instead of upstream dashboard to test collapsible CI log sections and build diagnostics reporting from PR InsightSoftwareConsortium#5973. This commit must NOT be merged — revert the dashboard clone URL before merging PR InsightSoftwareConsortium#5971. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace
-VV(extra verbose) with-V(verbose) in all CI pipelinectest -Sinvocations across 8 YAML files.Background
Every ITK CI pipeline currently runs CTest in extra-verbose mode (
-VV), which prints the full stdout/stderr of every test — regardless of whether it passed or failed. With ITK's 3000+ test suite, this generates enormous CI log output, making it difficult to locate actual failures when a build goes red.Every pipeline also sets the environment variable
CTEST_OUTPUT_ON_FAILURE=1, which is designed to print test output only for failing tests. However, this variable has been effectively dead code — the-VVflag unconditionally prints all output, overriding the output-on-failure behavior.How CTest verbosity works
-V-VVCTEST_OUTPUT_ON_FAILURE=1-Vor no flag, overridden by-VV)The
CTEST_OUTPUT_ON_FAILUREenvironment variable works in both directctestinvocations andctest -Sscripted/dashboard mode. Thectest_test()CMake command used internally byitk_common.cmakedoes not have anOUTPUT_ON_FAILUREkeyword argument, but the environment variable is read by the CTest process regardless of invocation mode.What this changes
-VVprints all 3000+ tests' output → large logs, failures buried in noise-V+CTEST_OUTPUT_ON_FAILURE=1prints progress for all tests, full output only for failures → smaller logs, failures immediately visibleFiles changed
.github/workflows/arm.ymlAzurePipelinesLinux.ymlAzurePipelinesLinuxPython.ymlAzurePipelinesMacOS.ymlAzurePipelinesMacOSPython.ymlAzurePipelinesWindows.ymlAzurePipelinesWindowsPython.ymlAzurePipelinesBatch.ymlTest plan
CTEST_OUTPUT_ON_FAILURE: 1in their env blocks🤖 Generated with Claude Code