Skip to content

Commit

Permalink
feat: Gradle tests executed with latest Gradle (v8.2.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
manusa committed Aug 4, 2023
1 parent f282437 commit d10c280
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 18 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ jobs:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
downloads.gradle.org:443
github.com:443
repo.gradle.org:443
repo.maven.apache.org:443
repo1.maven.org:443
repository.jboss.org:443
services.gradle.org:443
- name: Checkout
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Setup Java 11
Expand Down Expand Up @@ -111,6 +113,7 @@ jobs:
auth.docker.io:443
azure.archive.ubuntu.com:80
cdn03.quay.io:443
downloads.gradle.org:443
gcr.io:443
github.com:443
jcenter.bintray.com:443
Expand All @@ -127,6 +130,7 @@ jobs:
ppa.launchpad.net:80
production.cloudflare.docker.com:443
quay.io:443
services.gradle.org:443
registry-1.docker.io:443
registry.access.redhat.com:443
registry.k8s.io:443
Expand Down Expand Up @@ -187,6 +191,7 @@ jobs:
auth.docker.io:443
azure.archive.ubuntu.com:80
cdn03.quay.io:443
downloads.gradle.org:443
gcr.io:443
github.com:443
jcenter.bintray.com:443
Expand All @@ -203,6 +208,7 @@ jobs:
ppa.launchpad.net:80
production.cloudflare.docker.com:443
quay.io:443
services.gradle.org:443
registry-1.docker.io:443
registry.access.redhat.com:443
registry.k8s.io:443
Expand Down Expand Up @@ -234,7 +240,7 @@ jobs:
openshift: [v3.11.0,v3.10.0]
suite: ['quarkus','springboot','webapp','other']
steps:
# This seems to cause problems with OpenShift Setup Action
# This seems to cause problems with OpenShift Setup Action
# - name: Harden Runner
# uses: step-security/harden-runner@97689868c8aca5a4bcd16ab96bbda25a0efb734b
# with:
Expand Down Expand Up @@ -275,7 +281,7 @@ jobs:
./jkube
key: cache-it-${{ github.run_id }}
- name: Check Docker Status
run: systemctl status docker.service
run: systemctl status docker.service
- name: Setup OpenShift
uses: manusa/actions-setup-openshift@e59fe3caa18d7cde81e2ce4797e6549a13f7648c
with:
Expand Down
14 changes: 11 additions & 3 deletions it/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,15 @@
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-test-kit</artifactId>
<artifactId>gradle-all</artifactId>
<version>${gradle.version}</version>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-tooling-api</artifactId>
<!-- Required by Gradle -->
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${guava.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -112,6 +116,10 @@
<name>jkubeVersion</name>
<value>${jkube.version}</value>
</property>
<property>
<name>gradleVersion</name>
<value>${gradle.version}</value>
</property>
</systemProperties>
</configuration>
</plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
public interface JKubeCase {

String JKUBE_VERSION_SYSTEM_PROPERTY = "jkubeVersion";
String GRADLE_VERSION_SYSTEM_PROPERTY = "gradleVersion";

// TODO: Move to KubernetesCase interface
KubernetesClient getKubernetesClient();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
import java.util.List;
import java.util.function.Predicate;

import static org.eclipse.jkube.integrationtests.JKubeCase.GRADLE_VERSION_SYSTEM_PROPERTY;

public class GradleExtension implements BaseExtension, BeforeAllCallback, BeforeEachCallback {

private volatile boolean cleanBuild = false;
Expand Down Expand Up @@ -72,8 +74,7 @@ private JKubeGradleRunner getJKubeGradleRunner(ExtensionContext context) throws
}
var projectPath = rootPath.resolve("projects-to-be-tested").resolve("gradle");
var gradleRunner = GradleRunner.create()
.withGradleDistribution(new URI("https://services.gradle.org/distributions/gradle-7.6-bin.zip"))
// .withGradleInstallation(getGradleInstallation())
.withGradleDistribution(new URI("https://services.gradle.org/distributions/gradle-" + System.getProperty(GRADLE_VERSION_SYSTEM_PROPERTY) + "-bin.zip"))
.withProjectDir(projectPath.toFile());
if (annotation.forwardOutput()) {
gradleRunner.forwardOutput();
Expand Down
24 changes: 13 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
<com.fasterxml.jackson.core.version>2.15.2</com.fasterxml.jackson.core.version>
<com.fasterxml.jackson.dataformat.yaml.version>2.15.2</com.fasterxml.jackson.dataformat.yaml.version>
<fabric8.kubernetes-client.version>6.8.0</fabric8.kubernetes-client.version>
<gradle.version>6.1.1</gradle.version>
<guava.version>32.1.2-jre</guava.version> <!-- Required by Gradle Test Toolkit (testkit) -->
<gradle.version>8.2.1</gradle.version>
<gradle-api-maven-plugin-version>0.0.2</gradle-api-maven-plugin-version>
<hamcrest.version>2.0.0.0</hamcrest.version>
<jkube.version>1.14-SNAPSHOT</jkube.version>
<junit.version>5.9.1</junit.version>
Expand Down Expand Up @@ -121,16 +123,6 @@
<artifactId>commons-codec</artifactId>
<version>${apache.commons-codec.version}</version>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-test-kit</artifactId>
<version>${gradle.version}</version>
</dependency>
<dependency>
<groupId>org.gradle</groupId>
<artifactId>gradle-tooling-api</artifactId>
<version>${gradle.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down Expand Up @@ -175,6 +167,11 @@
<artifactId>license-maven-plugin</artifactId>
<version>${license-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>com.marcnuri.plugins</groupId>
<artifactId>gradle-api-maven-plugin</artifactId>
<version>${gradle-api-maven-plugin-version}</version>
</plugin>
<plugin>
<groupId>io.reactiverse</groupId>
<artifactId>vertx-maven-plugin</artifactId>
Expand Down Expand Up @@ -262,6 +259,11 @@
</licenseSets>
</configuration>
</plugin>
<plugin>
<groupId>com.marcnuri.plugins</groupId>
<artifactId>gradle-api-maven-plugin</artifactId>
<extensions>true</extensions>
</plugin>
</plugins>
</build>
<profiles>
Expand Down

0 comments on commit d10c280

Please sign in to comment.