Skip to content

ENH: Address Greptile findings on GDCM series direction tests - #6940

Merged
hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:test-gdcm-series-direction-followups
Oct 13, 2026
Merged

hjmjohnson merged 3 commits into
InsightSoftwareConsortium:mainfrom
hjmjohnson:test-gdcm-series-direction-followups

Conversation

@hjmjohnson

Copy link
Copy Markdown
Member

Follow-up to #5357: addresses three Greptile findings raised against its backport (#6930) so the improvements land in main first.

  • Discovered GoogleTest tests now carry the module label, so ctest -L ITKIOGDCM includes the 17 GDCMSeriesDirection tests.
  • ITKData is a real build prerequisite of ITKGDCMImageIOGTestDriver.
  • Oblique and randomized direction tests use a three-rotation frame, so the slice normal has three nonzero components.
Local validation
  • Built ITKGDCMImageIOGTestDriver; 33/33 of GDCMSeriesDirection, ITKGDCMImageIO, GDCMSeriesFileNames passed.
  • ctest -N -L ITKIOGDCM lists all 17 GDCMSeriesDirection tests (0 before).
  • pre-commit run --all-files exits 0.
  • The label change is in the shared CreateGoogleTestDriver, so every module's discovered GoogleTests gain their module label. The cross-compile gtest_add_tests path is unchanged.
  • The _STRING/TOSTRING macros are deliberately not renamed: the idiom is local to .cxx tests and already used in 17 files.
AI assistance

Claude Code (claude-sonnet-5-5) drafted the changes; built and tested locally and reviewed before pushing.

CreateGoogleTestDriver labeled only the driver executable, so tests found
by gtest_discover_tests were skipped by ctest -L <Module>. Pass the module
label through to the discovered tests.
Setting the target DEPENDS property does not order the build. Use
add_dependencies so ReadSlicesReverseOrder finds its DICOM input when
only the driver is built.
@github-actions github-actions Bot added type:Infrastructure Infrastructure/ecosystem related changes, such as CMake or buildbots type:Enhancement Improvement of existing methods or implementation type:Testing Ensure that the purpose of a class is met/the results on a wide set of test cases are correct area:IO Issues affecting the IO module labels Oct 9, 2026
@hjmjohnson
hjmjohnson marked this pull request as ready for review October 9, 2026 14:04
@greptile-apps

This comment was marked as resolved.

@hjmjohnson
hjmjohnson force-pushed the test-gdcm-series-direction-followups branch from 517fb45 to e9324aa Compare October 9, 2026 14:59
@hjmjohnson
hjmjohnson requested a review from blowekamp October 9, 2026 18:30

@blowekamp blowekamp left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes a OK.

I am not a fan of randomized tests they are hard reproduce, I am not sure if the seed will produce consistent seed across platforms or not. The code does not seem to make good use of ITK infrastructure for ITK transforms. AI stuff.

The oblique and randomized cases built frames from two angles, which always
gave a slice normal of (0, -sin b, cos b). Compose three rotations so the
normal has three nonzero components.
@hjmjohnson
hjmjohnson force-pushed the test-gdcm-series-direction-followups branch from e9324aa to 6285a50 Compare October 13, 2026 11:49
@hjmjohnson
hjmjohnson merged commit 3f46b66 into InsightSoftwareConsortium:main Oct 13, 2026
19 checks passed
@hjmjohnson
hjmjohnson deleted the test-gdcm-series-direction-followups branch October 29, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:IO Issues affecting the IO module type:Enhancement Improvement of existing methods or implementation 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.

3 participants