Skip to content

DO NOT MERGE: Verify CI output-on-failure with reduced verbosity#5972

Draft
hjmjohnson wants to merge 3 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:wip-test-ci-verbosity
Draft

DO NOT MERGE: Verify CI output-on-failure with reduced verbosity#5972
hjmjohnson wants to merge 3 commits intoInsightSoftwareConsortium:mainfrom
hjmjohnson:wip-test-ci-verbosity

Conversation

@hjmjohnson
Copy link
Member

DO NOT MERGE

This PR intentionally introduces a compiler warning and a test failure to verify that the reduced CTest verbosity scheme proposed in #5971 correctly surfaces failures in CI logs.

What this PR introduces

1. Compiler warning (-Wunused-variable)

An unused static int variable in Modules/Core/Common/src/itkObject.cxx:

static int deliberately_unused_variable_for_ci_test = 42;

This should appear in CDash's warning count for every build.

2. Deliberate test failure (itkPointGeometryTest)

The test now returns EXIT_FAILURE and prints a diagnostic message to stderr:

DELIBERATE FAILURE: This output should appear in CI logs
because CTEST_OUTPUT_ON_FAILURE=1 is set and -V (not -VV)
is used. If you can read this in the CI log, the new
verbosity scheme is working correctly.

What to look for in CI logs

This PR includes the -VV-V change from #5971. With the new scheme:

  • Test progress (names, pass/fail, timing) should still be visible in the CI log — this comes from -V
  • The "DELIBERATE FAILURE" message should appear in the CI log — this comes from CTEST_OUTPUT_ON_FAILURE=1
  • Passing tests should NOT have their stdout/stderr printed — this is the log reduction from dropping -VV
  • The compiler warning about deliberately_unused_variable_for_ci_test should appear in the build output

If all four conditions are met, #5971 is working as intended and can be merged.

Cleanup

This PR will be closed without merging once CI results have been inspected.

🤖 Generated with Claude Code

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>
@github-actions github-actions bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:Core Issues affecting the Core module labels Mar 20, 2026
hjmjohnson and others added 2 commits March 19, 2026 20:18
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>
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 hjmjohnson force-pushed the wip-test-ci-verbosity branch from b0f4064 to 34cf43b Compare March 20, 2026 01:20
@github-actions github-actions bot added the area:Python wrapping Python bindings for a class label Mar 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:Core Issues affecting the Core module area:Python wrapping Python bindings for a class type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant