Skip to content

fix(gradle): allow test target name to be configured from nx.json#32416

Merged
lourw merged 6 commits intomasterfrom
feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task
Aug 22, 2025
Merged

fix(gradle): allow test target name to be configured from nx.json#32416
lourw merged 6 commits intomasterfrom
feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task

Conversation

@lourw
Copy link
Copy Markdown
Contributor

@lourw lourw commented Aug 19, 2025

Current Behavior

We had hardcoded test target names which meant that users who specify custom test suites would not get their atomized tests correctly picked up.

Expected Behavior

Allow users to configure the testTargetName field in their nx.json and correctly identify which tasks to atomize.

Related Issue(s)

Fixes #

@vercel
Copy link
Copy Markdown

vercel Bot commented Aug 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nx-dev Ready Ready Preview Aug 22, 2025 3:57pm

@lourw lourw self-assigned this Aug 19, 2025
@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Aug 19, 2025

View your CI Pipeline Execution ↗ for commit 403b6ab

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 20m 51s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 2m 2s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 5s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 5s View ↗
nx documentation ✅ Succeeded 45s View ↗

☁️ Nx Cloud last updated this comment at 2025-08-22 16:09:30 UTC

Comment thread packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt Outdated
@lourw lourw force-pushed the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch from 605233c to 29079f0 Compare August 21, 2025 21:02
@lourw lourw force-pushed the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch from 29079f0 to 3501983 Compare August 22, 2025 14:53
Comment thread packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/TaskUtils.kt Outdated
Comment thread packages/gradle/project-graph/src/main/kotlin/dev/nx/gradle/utils/ProjectUtils.kt Outdated
@lourw lourw force-pushed the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch from 3501983 to 253c650 Compare August 22, 2025 15:30
@lourw lourw force-pushed the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch from 253c650 to 0178208 Compare August 22, 2025 15:32
@lourw lourw force-pushed the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch from 0178208 to 403b6ab Compare August 22, 2025 15:42
@lourw lourw merged commit 82652db into master Aug 22, 2025
6 checks passed
@lourw lourw deleted the feature/nxc-2962-kotlin-plugin-for-gradle-does-not-allow-configuring-task branch August 22, 2025 16:12
@lourw lourw changed the title fix(gradle): allow test target name to be configuration from nx.json fix(gradle): allow test target name to be configured from nx.json Aug 22, 2025
FrozenPandaz pushed a commit that referenced this pull request Aug 22, 2025
…32416)

<!-- 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
<!-- This is the behavior we have today -->

We had hardcoded test target names which meant that users who specify
custom test suites would not get their atomized tests correctly picked
up.

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

Allow users to configure the `testTargetName` field in their `nx.json`
and correctly identify which tasks to atomize.

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

Fixes #

(cherry picked from commit 82652db)
@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 Aug 28, 2025
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