Repository navigation
Add JUnit @Category-based smoke test suite as proof of concept - #1146
vgosain-psg wants to merge 3 commits into
Conversation
csutherl
left a comment
There was a problem hiding this comment.
Overall the change is pretty straightforward, but I have some concerns about duplicated items (the smoke test list is in multiple places and duplicated macro config in the build.xml). Also we should drop the POC references from the doc and changelog entries. Specific comments are in line.
dsoumis
left a comment
There was a problem hiding this comment.
This is a good initial effort, but a few things need to be revisited.
First, you need to run ant -Dexecute.validate=true validate to fix any checkstyle errors on every contribution.
A change of design is needed:
- SmokeSuite and the test-smoke-category target should be removed.
- The annotation alone should decide what runs.
- Make sure each test class still gets its own JVM, because the proposed approach runs all in one JVM.
You can create a helper class in the test/ directory, which can be used by a new "-test-categories" target that scans the compiled classes for the requested category by the @Category annotation. It writes the matching file list into test.name, and behaves like the smoke profile.
cb5717f to
c305b66
Compare
|
|
2d9aad6 to
44580c5
Compare
bc2fa0c to
631510c
Compare
|
@vgosain-psg lgtm now. Can you add the rest of the categories so we can remove the default profiles file as well as the section in build.xml? (In a separate commit, don't force push :) ) |
|
Thank you both for the thorough review. All feedback has been addressed — summary below. From @csutherl:
From @dsoumis (round 2):
From @dsoumis (round 3):
|
TestHostConfigAutomaticDeploymentA/B/C were refactored into per-scenario test classes in a prior commit. Update the smoke profile to reference the replacement classes: Dir, War, and Xml. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Replace the smoke profile file list in test-profiles.properties.default with @category(SmokeTest.class) annotations on each smoke test class. CategoryScanner discovers annotated tests at build time by scanning compiled classes and feeds the result into the existing batchtest fileset, preserving per-test JVM isolation. Changes: - Add SmokeTest category marker interface - Add CategoryScanner utility to scan compiled classes for a given @category annotation and output matching .java paths - Annotate all 57 smoke test classes with @category(SmokeTest.class) - Remove the smoke file list from test-profiles.properties.default; the annotation is now the single source of truth - Reorder test-nio dependencies so test-compile runs before -test-name-default, ensuring compiled classes are available when the scanner runs during profile initialisation - Update BUILDING.txt with instructions for the annotation-based approach - Update changelog.xml Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…s file Annotate all test classes in the catalina, coyote, performance, tribes, buildutil, and integration profiles with their corresponding @category marker. CategoryScanner discovers annotated classes at build time so no file list needs to be maintained anywhere. Remove test-profiles.properties.default: all profiles are now annotation-driven and the properties file has no remaining entries. Remove the property file load statements from build.xml and update the set-profile-pattern macro to map each profile name to its category class. The special build-time flags (test.includeBuildutil, test.includeTribes, test.includeIntegration, test.excludePerformance) are still set by -test-profile-init so the existing batchtest exclusions continue to work. Update BUILDING.txt with per-profile annotation instructions. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
0503f9d to
0d5e8f3
Compare
|
The rest of the categories should be handled in build.xml rather than annotating each file. We should keep the annotation only for hand-picked sets (smoke now). |
Summary
SmokeTestcategory marker interface andSmokeSuiteas a compile-checked alternative to the property file-based smoke profile@Category(SmokeTest.class)so the tag lives next to the code rather than in a separate properties fileant test-smoke-categorytarget to run the suite via JUnit's Categories runnertest-profiles.properties.defaultto replace the deletedTestHostConfigAutomaticDeploymentA/B/Cwith their refactored successors (Dir, War, Xml)BUILDING.txtwith profile usage instructions and an explanation of the category-based approachThe existing property-based smoke profile is left intact — this is a proof of concept running alongside it, not a replacement. The intent is to gather feedback before deciding whether to extend categories to other profiles and retire the properties file mechanism.
Addresses: JWS-4412
Test plan
ant test-compilepasses cleanly (verified locally — 0 errors)ant test -Dtest.profile=smokestill works as before (existing mechanism unchanged)ant test-smoke-categoryruns the new category-based suite and produces equivalent resultsSmokeSuite.java(the key safety property)🤖 Generated with Claude Code