Skip to content

fix(engine): correct Surefire discovery regex filters - #3821

Merged
hauptmedia merged 1 commit into
mainfrom
fix/engine-test-discovery
Oct 12, 2026
Merged

hauptmedia merged 1 commit into
mainfrom
fix/engine-test-discovery

Conversation

@hauptmedia

@hauptmedia hauptmedia commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Surefire 3.6.0 reapplies regex filters to JUnit class names without the .class suffix. The engine's suffix-bearing expressions therefore silently omit intended tests during ordinary Maven builds.

Fix

Remove the trailing .class from both regex expressions in engine/pom.xml and add a two-line compatibility comment. Category profiles, custom includes/excludes, TestCase/Nashorn exclusions and ArchUnit dependency scanning remain intact.

One commit, one file, +4/-2 against main. No engine runtime or test source changes.

Verification

Head: e0edf5a5748cb905ce77f3e6d1cbdce986e62d71. Base: ce6e96e4139a006bb3ba6a3fce70f80eb3641f5c.

Local checks

JDK 21.0.12.1, Maven 3.10.0, Surefire 3.6.0 and H2; build cache disabled.

  • Clean engine/dependency build: all 23 modules passed, including test compilation; execution was skipped in this build.
  • Separate actual Surefire checks using normal POM filters passed with 33 / 24 / 9 / 31 / 7 / 0 exact canary identities for default, BPMN, BPMN complement, dotted includes, combined includes/excludes and no-match. Parameterized/nested invocations and intentional exclusions were checked. Temporary compiled-class isolation left the committed POM unchanged; no -Dtest was used for discovery verification. ArchUnit stayed enabled and passed in default/complement runs.
  • Java regex checks covered all eight category/complement profiles and custom selectors. All four category/complement pairs partitioned default.
  • XML parsing and git diff --check passed. Root-scoped cleanup exited zero without tracked changes, but emitted recipe-validation/frontend parsing errors; a clean cleanup pass is not claimed.

CI result and discovery coverage

PR Build #555 completed with failure on this head. CI used JDK 17.0.20.1 and the normal build profile with H2 and the default engine filters.

Engine outcome reported by CI Count
Cases, including skips 16,213
Passed 16,081
Assertion failures 14
Errors 31
Skipped 87

The engine completed its test phase and reported ordinary test failures; there was no engine fork-abort/OOM reported. Its tests executed in this run rather than being restored as cached results.

An independent JUnit discovery plan from the final sources, using the effective POM and Surefire's actual scanner/provider filters, contains 1,521 scan candidates and 1,098 class containers. The corrected provider's full descriptor set equals the scanner-only oracle. The CI log contains exactly those 1,098 class containers, once each, with no missing or unexpected classes. All 936 classes omitted by the unmodified-main provider filters are represented.

CI also confirms ClassNameUtilTest (7 cases), MailActivityBehaviorTest (24), both engine-retention nested tests (1 each), and ArchUnit (1), all successful. Seven nested class containers are represented: 10 passing cases and one skip. Three enclosing containers have no direct cases. The 87 skipped cases occur across 48 class summaries. Scanner TestCase/Nashorn exclusions remain intentional; selected nested classes can legitimately bring their enclosing container into the JUnit plan.

Limit: this establishes class-level discovery coverage, not a complete identity-by-identity proof for every parameterized/dynamic invocation. The uploaded Surefire report archive exists, and report publication/upload succeeded, but local retrieval of its bytes is blocked by the execution environment's download proxy (HTTP 403). Therefore all individual testcase identities and skip reasons could not be audited from CI XML. No unconditional “every testcase verified” claim is made.

Only this default engine CI selection ran; there are no matrix repetitions added to the count. Frontend and PR configuration passed. Static analysis, Spring Boot Starter integration, Quarkus and integration-test jobs were skipped; their coverage is not established.

Existing main failures

All 45 failing CI invocations were independently reproduced on a tracked tree verified identical to unmodified main. The targeted baseline selected the 41 failing methods, expanding to 52 invocations: 14 failures, 31 errors and 7 passes. The 45 failing identities, including parameter indices, result kinds and exception types match CI exactly. This reproduction used -Dtest only to bypass main's broken discovery, not as coverage evidence.

For example, the normal test.includes=api.externaltask.SetExternalTasksRetries filter runs zero cases on main. With this fix it executes 24 cases, including two existing null-ID assertion failures; explicit baseline selection reproduces the same 24 identities/outcomes.

These failures are existing main behavior exposed by restored discovery. No engine fixes are included, and the full PR pipeline is not green.

@github-actions github-actions Bot added documentation Improvements or additions to documentation scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI scope:ci Changes to the CI, e.g. GitHub workflows labels Oct 9, 2026
@hauptmedia

Copy link
Copy Markdown
Collaborator Author

fyi, currently under maintainer discussion: should we downgrade to Sunfire 3.5.6 and upgrade to 3.6.1 once it is released or apply mitigation to the regression

@github-actions github-actions Bot removed documentation Improvements or additions to documentation scope:ci Changes to the CI, e.g. GitHub workflows labels Oct 11, 2026
@hauptmedia
hauptmedia marked this pull request as ready for review October 11, 2026 15:28
@hauptmedia
hauptmedia marked this pull request as draft October 11, 2026 15:31
@hauptmedia hauptmedia changed the title fix(engine): restore complete Surefire test discovery fix(engine): correct Surefire discovery regex filters Oct 11, 2026
@hauptmedia
hauptmedia changed the base branch from fix/engine-null-regressions to main October 11, 2026 15:31
@hauptmedia
hauptmedia force-pushed the fix/engine-test-discovery branch from e0fde14 to e0edf5a Compare October 11, 2026 15:31
@hauptmedia
hauptmedia marked this pull request as ready for review October 11, 2026 15:37
@hauptmedia
hauptmedia marked this pull request as draft October 11, 2026 15:50
@hauptmedia
hauptmedia requested a review from kthoms October 11, 2026 15:53
@hauptmedia
hauptmedia marked this pull request as ready for review October 11, 2026 15:54

@kthoms kthoms left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks legit to me

@kthoms kthoms added scope:ci Changes to the CI, e.g. GitHub workflows and removed scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI labels Oct 12, 2026
@kthoms kthoms added this to the 2.2.0 milestone Oct 12, 2026
@kthoms

kthoms commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

The test failures need to be fixed first. Good that this fix uncovers them!

@kthoms
kthoms force-pushed the fix/engine-test-discovery branch from e0edf5a to 7f47e56 Compare October 12, 2026 14:08
@github-actions github-actions Bot added scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI and removed scope:ci Changes to the CI, e.g. GitHub workflows labels Oct 12, 2026
@kthoms

kthoms commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

The fix is valid. We can stay with 3.6.0 with it. Also no need to change anything when 3.6.1 is released.

@sonarqubecloud

Copy link
Copy Markdown

@hauptmedia
hauptmedia merged commit 37359e0 into main Oct 12, 2026
12 checks passed
@kthoms
kthoms deleted the fix/engine-test-discovery branch October 13, 2026 08:23
@kthoms kthoms added scope:ci Changes to the CI, e.g. GitHub workflows and removed scope:core-api Changes to the core API: engine, dmn-engine, feel-engine, REST API, OpenAPI labels Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope:ci Changes to the CI, e.g. GitHub workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants