Repository navigation
Run Issue792 and DateTimeFormatTest.bothPathsRejectSpaceSeparator tests - #1371
Conversation
Issue792 did not match the Surefire test class name patterns and bothPathsRejectSpaceSeparator had no @test annotation, so neither ran.
|
Reviewed this and ran both affected classes on the PR branch.
I also scanned |
Validate two violating properties: one error with fail-fast, two without. Fold the direct Ethlo check from bothPathsRejectSpaceSeparator into rejectsNonTSeparators, which already covers that value.
TestDiscoveryTest scans src/test/java for test classes whose names the Surefire includes (or *IT) don't match, and for no-argument void methods that have no annotation and are not called from their file.
|
Re-reviewed the updated branch ( I tried the new guard against some sample bad inputs. It flags a plain unannotated method with a unique name, but it misses these:
Item 1 is the one worth fixing before merge; the rest are heuristic limits you may prefer to accept and document. |
Only InternalPackageIT is exempt by name. Comments and literals are blanked before matching. A method counts as annotated only with a JUnit annotation, and as a helper only if it is called. Qualified annotations are matched. The source root comes from the test classes location, and each file is read once. Methods of nested and anonymous classes are not test candidates.
|
Done in c997990, all six: only |
|
Reviewed the latest commit (
None of these block the PR. Items 1 and 2 are the most likely to cause trouble, and a future false positive in item 1 would push authors to work around the guard. |
…ts (2.x) (#1372) Backport of #1371 to 2.x. Issue792 (the fail-fast pattern test from #795) never ran because its name does not match Surefire's default test class patterns, and DateTimeFormatTest.bothPathsRejectSpaceSeparator had no @test. - Rename Issue792 to Issue792Test, and give it two failing properties so it tells fail-fast (1 error) from no fail-fast (2 errors). - Fold the Ethlo assertion of bothPathsRejectSpaceSeparator into rejectsNonTSeparators and drop the duplicate method. - Add TestDiscoveryTest, which fails when a test class does not match the Surefire includes (except InternalPackageIT, which the pom runs by name) or when a test-shaped method has no JUnit annotation. Ported to Java 8, which is the test source level on 2.x. Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
Issue792 (the fail-fast pattern test from #795) has never run because its name doesn't match Surefire's default test class patterns, and DateTimeFormatTest.bothPathsRejectSpaceSeparator from #1331 has no @test. This renames the class to Issue792Test and adds the annotation; both pass.