Skip to content

Commit

Permalink
test: use nx-gradle and nx-maven in smoke tests
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Aug 22, 2023
1 parent b4a3598 commit 4d7b414
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 61 deletions.
2 changes: 1 addition & 1 deletion testing-projects/smoke/nx-boot-gradle-smoke/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"tags": [],
"implicitDependencies": ["nx-boot-gradle"]
"implicitDependencies": ["nx-gradle"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-boot-gradle smoke', () => {
describe('@jnxplus/nx-gradle spring-boot smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -53,37 +53,40 @@ describe('@jnxplus/nx-boot-gradle smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-boot-gradle', execSyncOptions());
execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());

execSync('npx nx generate @jnxplus/nx-boot-gradle:init', execSyncOptions());
execSync(
'npx nx generate @jnxplus/nx-gradle:init --preset spring-boot',
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:application ${testApp}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib} --framework spring-boot --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:application ${testApp2}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp2} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:application ${testApp3}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp3} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:application ${testApp4}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp4} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-gradle:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib2} --framework spring-boot --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down
2 changes: 1 addition & 1 deletion testing-projects/smoke/nx-boot-maven-smoke/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"tags": [],
"implicitDependencies": ["nx-boot-maven"]
"implicitDependencies": ["nx-maven"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-boot-maven smoke', () => {
describe('@jnxplus/nx-maven spring-boot smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -53,37 +53,40 @@ describe('@jnxplus/nx-boot-maven smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-boot-maven', execSyncOptions());
execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());

execSync('npx nx generate @jnxplus/nx-boot-maven:init', execSyncOptions());
execSync(
'npx nx generate @jnxplus/nx-maven:init --dependencyManagement spring-boot-parent-pom',
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:application ${testApp}`,
`npx nx g @jnxplus/nx-maven:application ${testApp} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib} --framework spring-boot --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:application ${testApp2}`,
`npx nx g @jnxplus/nx-maven:application ${testApp2} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:application ${testApp3}`,
`npx nx g @jnxplus/nx-maven:application ${testApp3} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:application ${testApp4}`,
`npx nx g @jnxplus/nx-maven:application ${testApp4} --framework spring-boot`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-boot-maven:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib2} --framework spring-boot --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-micronaut-gradle smoke', () => {
describe('@jnxplus/nx-gradle micronaut smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -52,43 +52,40 @@ describe('@jnxplus/nx-micronaut-gradle smoke', () => {

execSync('git init', execSyncOptions());

execSync(
'npm i --save-dev @jnxplus/nx-micronaut-gradle',
execSyncOptions()
);
execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());

execSync(
'npx nx generate @jnxplus/nx-micronaut-gradle:init',
'npx nx generate @jnxplus/nx-gradle:init --preset micronaut',
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:application ${testApp}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib} --framework micronaut --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:application ${testApp2}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp2} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:application ${testApp3}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp3} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:application ${testApp4}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp4} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-gradle:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib2} --framework micronaut --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-micronaut-maven smoke', () => {
describe('@jnxplus/nx-maven micronaut smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -52,40 +52,40 @@ describe('@jnxplus/nx-micronaut-maven smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-micronaut-maven', execSyncOptions());
execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());

execSync(
'npx nx generate @jnxplus/nx-micronaut-maven:init',
'npx nx generate @jnxplus/nx-maven:init --dependencyManagement micronaut-parent-pom',
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:application ${testApp}`,
`npx nx g @jnxplus/nx-maven:application ${testApp} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib} --framework micronaut --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:application ${testApp2}`,
`npx nx g @jnxplus/nx-maven:application ${testApp2} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:application ${testApp3}`,
`npx nx g @jnxplus/nx-maven:application ${testApp3} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:application ${testApp4}`,
`npx nx g @jnxplus/nx-maven:application ${testApp4} --framework micronaut`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-micronaut-maven:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib2} --framework micronaut --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"tags": [],
"implicitDependencies": ["nx-quarkus-gradle"]
"implicitDependencies": ["nx-gradle"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-quarkus-gradle smoke', () => {
describe('@jnxplus/nx-gradle quarkus smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -52,40 +52,40 @@ describe('@jnxplus/nx-quarkus-gradle smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-quarkus-gradle', execSyncOptions());
execSync('npm i --save-dev @jnxplus/nx-gradle', execSyncOptions());

execSync(
'npx nx generate @jnxplus/nx-quarkus-gradle:init',
'npx nx generate @jnxplus/nx-gradle:init --preset quarkus',
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:application ${testApp}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp} --framework quarkus`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib} --framework quarkus --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:application ${testApp2}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp2} --framework quarkus`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:application ${testApp3}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp3} --framework quarkus`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:application ${testApp4}`,
`npx nx g @jnxplus/nx-gradle:application ${testApp4} --framework quarkus`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-gradle:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-gradle:lib ${testLib2} --framework quarkus --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down
2 changes: 1 addition & 1 deletion testing-projects/smoke/nx-quarkus-maven-smoke/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
}
},
"tags": [],
"implicitDependencies": ["nx-quarkus-maven"]
"implicitDependencies": ["nx-maven"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ const execSyncOptions: () => ExecSyncOptions = () => ({
stdio: 'inherit',
});

const libsParentProject = uniq('libs-parent-project-');
const appsParentProject = uniq('apps-parent-project-');

const testApp = uniq('test-app');
const testLib = uniq('test-lib');

Expand All @@ -29,7 +32,7 @@ const testLib2 = uniq('test-lib2');
const testApp3 = uniq('test-app3');
const testApp4 = uniq('test-app4');

describe('@jnxplus/nx-quarkus-maven smoke', () => {
describe('@jnxplus/nx-maven quarkus smoke', () => {
beforeEach(async () => {
({ name: smokeDirectory, removeCallback: cleanup } = dirSync({
unsafeCleanup: true,
Expand All @@ -52,40 +55,47 @@ describe('@jnxplus/nx-quarkus-maven smoke', () => {

execSync('git init', execSyncOptions());

execSync('npm i --save-dev @jnxplus/nx-quarkus-maven', execSyncOptions());
execSync('npm i --save-dev @jnxplus/nx-maven', execSyncOptions());

execSync('npx nx generate @jnxplus/nx-maven:init', execSyncOptions());

execSync(
`npx nx generate @jnxplus/nx-maven:parent-project ${libsParentProject} --projectType library --framework quarkus`,
execSyncOptions()
);

execSync(
'npx nx generate @jnxplus/nx-quarkus-maven:init',
`npx nx generate @jnxplus/nx-maven:parent-project ${appsParentProject} --parentProject ${libsParentProject} --framework none`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:application ${testApp}`,
`npx nx g @jnxplus/nx-maven:application ${testApp} --framework quarkus --parentProject ${appsParentProject}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:lib ${testLib} --projects ${testApp}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib} --framework quarkus --parentProject ${libsParentProject} --projects ${testApp}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:application ${testApp2}`,
`npx nx g @jnxplus/nx-maven:application ${testApp2} --framework quarkus --parentProject ${appsParentProject}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:application ${testApp3}`,
`npx nx g @jnxplus/nx-maven:application ${testApp3} --framework quarkus --parentProject ${appsParentProject}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:application ${testApp4}`,
`npx nx g @jnxplus/nx-maven:application ${testApp4} --framework quarkus --parentProject ${appsParentProject}`,
execSyncOptions()
);

execSync(
`npx nx g @jnxplus/nx-quarkus-maven:lib ${testLib2} --projects ${testApp2},${testApp3},${testApp4}`,
`npx nx g @jnxplus/nx-maven:lib ${testLib2} --framework quarkus --parentProject ${libsParentProject} --projects ${testApp2},${testApp3},${testApp4}`,
execSyncOptions()
);

Expand Down

0 comments on commit 4d7b414

Please sign in to comment.