Skip to content

fix(gradle): ignore test enums when atomizing#34974

Merged
lourw merged 1 commit intomasterfrom
feature/nxc-4133-ensure-that-regex-parsing-ignores-enums
Mar 24, 2026
Merged

fix(gradle): ignore test enums when atomizing#34974
lourw merged 1 commit intomasterfrom
feature/nxc-4133-ensure-that-regex-parsing-ignores-enums

Conversation

@lourw
Copy link
Copy Markdown
Contributor

@lourw lourw commented Mar 23, 2026

Current Behavior

When the Gradle plugin's regex-based test parser (used as a fallback when AST parsing fails) encounters a Kotlin file
containing enum classes, those enum classes are incorrectly included as test atomization targets. This causes spurious
test entries to appear for enum types like TestStatus or Priority that are not actual test classes.

Expected Behavior

Enum classes are excluded from the list of discovered test classes during atomization, consistent with how abstract
classes and annotation classes are already filtered out. Only real test classes should be identified as atomization targets.

Related Issue(s)

Fixes #

@lourw lourw self-assigned this Mar 23, 2026
@lourw lourw requested a review from a team as a code owner March 23, 2026 23:01
@lourw lourw requested a review from AgentEnder March 23, 2026 23:01
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 23, 2026

👷 Deploy Preview for nx-docs processing.

Name Link
🔨 Latest commit e9af569
🔍 Latest deploy log https://app.netlify.com/projects/nx-docs/deploys/69c1c62f48c455000849c20f

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 23, 2026

👷 Deploy Preview for nx-dev processing.

Name Link
🔨 Latest commit e9af569
🔍 Latest deploy log https://app.netlify.com/projects/nx-dev/deploys/69c1c631d000b40008a49da1

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud bot commented Mar 23, 2026

View your CI Pipeline Execution ↗ for commit e9af569

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 10m 44s View ↗
nx run-many -t check-imports check-lock-files c... ✅ Succeeded 7s View ↗
nx-cloud record -- pnpm nx conformance:check ✅ Succeeded 7s View ↗
nx build workspace-plugin ✅ Succeeded 36s View ↗
nx-cloud record -- nx format:check ✅ Succeeded <1s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded <1s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-23 23:24:36 UTC

@lourw lourw merged commit 4a073cd into master Mar 24, 2026
16 of 24 checks passed
@lourw lourw deleted the feature/nxc-4133-ensure-that-regex-parsing-ignores-enums branch March 24, 2026 17:39
FrozenPandaz pushed a commit that referenced this pull request Mar 26, 2026
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
When the Gradle plugin's regex-based test parser (used as a fallback
when AST parsing fails) encounters a Kotlin file
containing enum classes, those enum classes are incorrectly included as
test atomization targets. This causes spurious
test entries to appear for enum types like TestStatus or Priority that
are not actual test classes.
## Expected Behavior

Enum classes are excluded from the list of discovered test classes
during atomization, consistent with how abstract
classes and annotation classes are already filtered out. Only real test
classes should be identified as atomization targets.

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

(cherry picked from commit 4a073cd)
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants