Skip to content

Commit

Permalink
Support Gradle version catalog, configuration cache and lazy tasks (#882
Browse files Browse the repository at this point in the history
)
  • Loading branch information
yahavi authored Oct 4, 2023
1 parent 950b7a7 commit 9fadac1
Show file tree
Hide file tree
Showing 29 changed files with 291 additions and 604 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<skipITs>true</skipITs>

<buildinfo.version>2.41.4</buildinfo.version>
<buildinfo.gradle.version>4.33.4</buildinfo.gradle.version>
<buildinfo.gradle.version>5.1.5</buildinfo.gradle.version>
</properties>

<repositories>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@
import java.util.stream.Collectors;

import static org.hamcrest.Matchers.isOneOf;
import static org.jfrog.build.extractor.buildScanTable.LicenseViolationsTable.LICENSE_VIOLATIONS_TABLE_HEADLINE;
import static org.jfrog.build.extractor.buildScanTable.SecurityViolationsTable.SECURITY_VIOLATIONS_TABLE_HEADLINE;
import static org.jfrog.hudson.TestUtils.getAndAssertChild;
import static org.jfrog.hudson.pipeline.common.executors.GenericDownloadExecutor.FAIL_NO_OP_ERROR_MESSAGE;
import static org.jfrog.hudson.pipeline.integration.ITestUtils.*;
Expand Down Expand Up @@ -383,36 +381,14 @@ void gradleTest(String buildName) throws Exception {

void gradleCiServerTest(String buildName) throws Exception {
Set<String> expectedArtifacts = new HashSet<>();
Collections.addAll(expectedArtifacts, pipelineType.toString() + "-gradle-example-ci-server-1.0.jar", "ivy-1.0.xml", pipelineType.toString() + "-gradle-example-ci-server-1.0.pom");
Collections.addAll(expectedArtifacts, pipelineType.toString() + "-gradle-example-ci-server-1.0.jar", pipelineType.toString() + "-gradle-example-ci-server-1.0.pom");
WorkflowRun pipelineResults = null;
try {
pipelineResults = runPipeline("gradleCiServer", false);
BuildInfo buildInfo = artifactoryManager.getBuildInfo(buildName, BUILD_NUMBER, null);
assertEquals(5, buildInfo.getModules().size());

Module module = getAndAssertModule(buildInfo, "org.jfrog.example.gradle:" + pipelineType.toString() + "-gradle-example-ci-server:1.0");
assertModuleArtifacts(module, expectedArtifacts);
assertTrue(CollectionUtils.isEmpty(module.getDependencies()));

assertModuleContainsArtifacts(buildInfo, "org.jfrog.example.gradle:services:1.0");
assertModuleContainsArtifacts(buildInfo, "org.jfrog.example.gradle:api:1.0");
assertModuleContainsArtifacts(buildInfo, "org.jfrog.example.gradle:shared:1.0");
assertModuleContainsArtifactsAndDependencies(buildInfo, "org.jfrog.example.gradle:webservice:1.0");
} finally {
cleanupBuilds(pipelineResults, buildName, null, BUILD_NUMBER);
}
}

void gradleCiServerPublicationTest(String buildName) throws Exception {
Set<String> expectedArtifacts = new HashSet<>();
Collections.addAll(expectedArtifacts, pipelineType.toString() + "-gradle-example-ci-server-publication-1.0.jar", pipelineType.toString() + "-gradle-example-ci-server-publication-1.0.pom");
WorkflowRun pipelineResults = null;
try {
pipelineResults = runPipeline("gradleCiServerPublication", false);
BuildInfo buildInfo = artifactoryManager.getBuildInfo(buildName, BUILD_NUMBER, null);
assertEquals(5, buildInfo.getModules().size());

Module module = getAndAssertModule(buildInfo, "org.jfrog.example.gradle:" + pipelineType.toString() + "-gradle-example-ci-server-publication:1.0");
// Gradle 6 and above produce an extra artifact of type "module".
// In order to allow the test to run on Gradle 6 and above, we remove it.
module.setArtifacts(module.getArtifacts().stream().filter(art -> !art.getType().equalsIgnoreCase("module")).collect(Collectors.toList()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,6 @@ public void gradleCiServerTest() throws Exception {
super.gradleCiServerTest("declarative:gradle-ci test");
}

@Test
public void gradleCiServerPublicationTest() throws Exception {
super.gradleCiServerPublicationTest("declarative:gradle-ci-publication test");
}

@Test
public void npmInstallTest() throws Exception {
super.npmTest("npmInstall", "declarative:npm install test", "package-name1:0.0.1");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ private static void createPipelineSubstitution() {
put("MAVEN_JIB_PROJECT_PATH", getProjectPath("maven-jib-example"));
put("GRADLE_PROJECT_PATH", getProjectPath("gradle-example"));
put("GRADLE_CI_PROJECT_PATH", getProjectPath("gradle-example-ci"));
put("GRADLE_CI_PUBLICATION_PROJECT_PATH", getProjectPath("gradle-example-ci-publications"));
put("NPM_PROJECT_PATH", getProjectPath("npm-example"));
put("GO_PROJECT_PATH", getProjectPath("go-example"));
put("PIP_PROJECT_PATH", getProjectPath("pip-example"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,6 @@ public void gradleCiServerTest() throws Exception {
super.gradleCiServerTest("scripted:gradle-ci test");
}

@Test
public void gradleCiServerPublicationTest() throws Exception {
super.gradleCiServerPublicationTest("scripted:gradle-ci-publication test");
}

@Test
public void npmInstallTest() throws Exception {
super.npmTest("npmInstall", "scripted:npm install test", "package-name1:0.0.1");
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 9fadac1

Please sign in to comment.