8000 fix(gradle): exclude private class for atomized test by xiongemi · Pull Request #31325 · nrwl/nx · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(gradle): exclude private class for atomized test #31325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

xiongemi
Copy link
Collaborator

Current Behavior

when there are multiple classes in a test file, it currently get the first class name in a file through regex and ignore the rest

Expected Behavior

should ignore all private class name in a file

Related Issue(s)

Fixes #

Copy link
vercel bot commented May 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jun 5, 2025 11:04pm

Copy link
nx-cloud bot commented May 24, 2025

View your CI Pipeline Execution ↗ for commit e457df8.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 14s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 10s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 4s View ↗
nx documentation ✅ Succeeded 44s View ↗

☁️ Nx Cloud last updated this comment at 2025-06-05 22:55:17 UTC

@FrozenPandaz FrozenPandaz requested a review from Copilot June 5, 2025 14:45
Copilot

This comment was marked as outdated.

@xiongemi xiongemi requested a review from Copilot June 5, 2025 19:20
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adjusts the logic for determining the test class name by excluding private classes and ensures only files with essential test annotations are processed. It also bumps the project version in the Gradle build file.

  • Excludes private classes from being considered for test naming by updating the regex.
  • Adds a check for essential test annotations to reduce false positives.
  • Updates the version from 0.1.0 to 0.1.1 in build.gradle.kts.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/CiTargetsUtils.kt Updates class name extraction to skip private classes and only process files with key test annotations
packages/gradle/project-graph/build.gradle.kts Bumps the project version

@xiongemi xiongemi force-pushed the fix-gradle-test-multiple-classes branch from 8a27e38 to d9c9a13 Compare June 5, 2025 22:19
@xiongemi xiongemi requested a review from vsavkin as a code owner June 5, 2025 22:19
@xiongemi xiongemi force-pushed the fix-gradle-test-multiple-classes branch from d9c9a13 to e457df8 Compare June 5, 2025 22:48
previousLine = trimmed
continue
}
val isNested = classStack.isNotEmpty()
Copy link
Contributor

Choose a reason for hiding this comment

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

The variable isNested is declared but not used in this function. Consider removing this unused variable to improve code clarity, or incorporate it into the logic if it was intended to be part of the decision-making process.

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0