feat(gradle): change test glob to include Tests and Test (#26913)
<!-- 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 --> ## Expected Behavior <!-- This is the behavior we should expect with the changes in this PR --> ## Related Issue(s) <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
This commit is contained in:
parent
fa83b36131
commit
ccb0d7d244
@ -202,7 +202,8 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should create nodes with atomized tests targets based on gradle for nested project root', async () => {
|
describe('with atomized tests targets', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
gradleReport = {
|
gradleReport = {
|
||||||
gradleFileToGradleProjectMap: new Map<string, string>([
|
gradleFileToGradleProjectMap: new Map<string, string>([
|
||||||
['nested/nested/proj/build.gradle', 'proj'],
|
['nested/nested/proj/build.gradle', 'proj'],
|
||||||
@ -223,18 +224,24 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
'proj/src/test/java/test/rootTest.java': ``,
|
'proj/src/test/java/test/rootTest.java': ``,
|
||||||
});
|
});
|
||||||
await tempFs.createFiles({
|
await tempFs.createFiles({
|
||||||
'nested/nested/proj/src/test/java/test/test.java': ``,
|
'nested/nested/proj/src/test/java/test/aTest.java': ``,
|
||||||
});
|
});
|
||||||
await tempFs.createFiles({
|
await tempFs.createFiles({
|
||||||
'nested/nested/proj/src/test/java/test/test1.java': ``,
|
'nested/nested/proj/src/test/java/test/bTest.java': ``,
|
||||||
|
});
|
||||||
|
await tempFs.createFiles({
|
||||||
|
'nested/nested/proj/src/test/java/test/cTests.java': ``,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should create nodes with atomized tests targets based on gradle for nested project root', async () => {
|
||||||
const results = await createNodesFunction(
|
const results = await createNodesFunction(
|
||||||
[
|
[
|
||||||
'nested/nested/proj/build.gradle',
|
'nested/nested/proj/build.gradle',
|
||||||
'proj/src/test/java/test/rootTest.java',
|
'proj/src/test/java/test/rootTest.java',
|
||||||
'nested/nested/proj/src/test/java/test/test.java',
|
'nested/nested/proj/src/test/java/test/aTest.java',
|
||||||
'nested/nested/proj/src/test/java/test/test1.java',
|
'nested/nested/proj/src/test/java/test/bTest.java',
|
||||||
|
'nested/nested/proj/src/test/java/test/cTests.java',
|
||||||
],
|
],
|
||||||
{
|
{
|
||||||
buildTargetName: 'build',
|
buildTargetName: 'build',
|
||||||
@ -253,8 +260,9 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
"metadata": {
|
"metadata": {
|
||||||
"targetGroups": {
|
"targetGroups": {
|
||||||
"Test": [
|
"Test": [
|
||||||
"test-ci--test",
|
"test-ci--aTest",
|
||||||
"test-ci--test1",
|
"test-ci--bTest",
|
||||||
|
"test-ci--cTests",
|
||||||
"test-ci",
|
"test-ci",
|
||||||
"test",
|
"test",
|
||||||
],
|
],
|
||||||
@ -297,12 +305,17 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
{
|
{
|
||||||
"params": "forward",
|
"params": "forward",
|
||||||
"projects": "self",
|
"projects": "self",
|
||||||
"target": "test-ci--test",
|
"target": "test-ci--aTest",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"params": "forward",
|
"params": "forward",
|
||||||
"projects": "self",
|
"projects": "self",
|
||||||
"target": "test-ci--test1",
|
"target": "test-ci--bTest",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"params": "forward",
|
||||||
|
"projects": "self",
|
||||||
|
"target": "test-ci--cTests",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
"executor": "nx:noop",
|
"executor": "nx:noop",
|
||||||
@ -328,9 +341,9 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"test-ci--test": {
|
"test-ci--aTest": {
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"command": "./gradlew proj:test --tests test",
|
"command": "./gradlew proj:test --tests aTest",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"classes",
|
"classes",
|
||||||
],
|
],
|
||||||
@ -339,7 +352,7 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
"^production",
|
"^production",
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "Runs Gradle test nested/nested/proj/src/test/java/test/test.java in CI",
|
"description": "Runs Gradle test nested/nested/proj/src/test/java/test/aTest.java in CI",
|
||||||
"help": {
|
"help": {
|
||||||
"command": "./gradlew help --task proj:test",
|
"command": "./gradlew help --task proj:test",
|
||||||
"example": {
|
"example": {
|
||||||
@ -355,9 +368,9 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
"test-ci--test1": {
|
"test-ci--bTest": {
|
||||||
"cache": true,
|
"cache": true,
|
||||||
"command": "./gradlew proj:test --tests test1",
|
"command": "./gradlew proj:test --tests bTest",
|
||||||
"dependsOn": [
|
"dependsOn": [
|
||||||
"classes",
|
"classes",
|
||||||
],
|
],
|
||||||
@ -366,7 +379,34 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
"^production",
|
"^production",
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"description": "Runs Gradle test nested/nested/proj/src/test/java/test/test1.java in CI",
|
"description": "Runs Gradle test nested/nested/proj/src/test/java/test/bTest.java in CI",
|
||||||
|
"help": {
|
||||||
|
"command": "./gradlew help --task proj:test",
|
||||||
|
"example": {
|
||||||
|
"options": {
|
||||||
|
"args": [
|
||||||
|
"--rerun",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"technologies": [
|
||||||
|
"gradle",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"test-ci--cTests": {
|
||||||
|
"cache": true,
|
||||||
|
"command": "./gradlew proj:test --tests cTests",
|
||||||
|
"dependsOn": [
|
||||||
|
"classes",
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
"default",
|
||||||
|
"^production",
|
||||||
|
],
|
||||||
|
"metadata": {
|
||||||
|
"description": "Runs Gradle test nested/nested/proj/src/test/java/test/cTests.java in CI",
|
||||||
"help": {
|
"help": {
|
||||||
"command": "./gradlew help --task proj:test",
|
"command": "./gradlew help --task proj:test",
|
||||||
"example": {
|
"example": {
|
||||||
@ -390,4 +430,5 @@ describe('@nx/gradle/plugin', () => {
|
|||||||
]
|
]
|
||||||
`);
|
`);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@ -33,8 +33,10 @@ let gradleCurrentConfigHash: string;
|
|||||||
|
|
||||||
export const GRADLE_BUILD_FILES = new Set(['build.gradle', 'build.gradle.kts']);
|
export const GRADLE_BUILD_FILES = new Set(['build.gradle', 'build.gradle.kts']);
|
||||||
export const GRADLE_TEST_FILES = [
|
export const GRADLE_TEST_FILES = [
|
||||||
'**/src/test/java/**/*.java',
|
'**/src/test/java/**/*Test.java',
|
||||||
'**/src/test/kotlin/**/*.kt',
|
'**/src/test/kotlin/**/*Test.kt',
|
||||||
|
'**/src/test/java/**/*Tests.java',
|
||||||
|
'**/src/test/kotlin/**/*Tests.kt',
|
||||||
];
|
];
|
||||||
|
|
||||||
export const gradleConfigGlob = combineGlobPatterns(
|
export const gradleConfigGlob = combineGlobPatterns(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user