Skip to content

Commit

Permalink
temp : split springboot profile into smaller subprofiles
Browse files Browse the repository at this point in the history
Signed-off-by: Rohan Kumar <[email protected]>
  • Loading branch information
rohanKanojia committed Oct 4, 2024
1 parent a64e553 commit 831f3e4
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 28 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fail-fast: false
matrix:
kubernetes: [v1.25.13,v1.28.1]
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile']
suite: ['quarkus','quarkus-native','springboot-zeroconfig','springboot-complete','springboot-others','webapp','other','dockerfile']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: ['quarkus','quarkus-native','springboot','webapp','other','dockerfile']
suite: ['quarkus','quarkus-native','springboot-zeroconfig','springboot-complete','springboot-others','webapp','other','dockerfile']
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down Expand Up @@ -197,7 +197,7 @@ jobs:
fail-fast: false
matrix:
openshift: [v3.10.0]
suite: ['quarkus','springboot','webapp','other']
suite: ['quarkus','springboot-zeroconfig','springboot-complete','springboot-others','webapp','other']
steps:
# This seems to cause problems with OpenShift Setup Action
# - name: Harden Runner
Expand Down Expand Up @@ -274,7 +274,7 @@ jobs:
# OKD version is bound to crc version
okd: [v4.14.0]
crc: [2.32.0]
suite: [ 'quarkus','springboot','webapp','other' ]
suite: [ 'quarkus','springboot-zeroconfig','springboot-complete','springboot-others','webapp','other' ]
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ public List<String> getProfiles() {
return Collections.singletonList("OpenShift-Docker");
}

@Override
public String getApplication() {
return "spring-boot-complete-openshift-docker";
}

@Test
@Order(1)
@ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE)
Expand Down Expand Up @@ -86,9 +91,9 @@ void ocResource() throws Exception {
final File metaInfDirectory = new File(
String.format("../%s/target/classes/META-INF", getProject()));
assertThat(metaInfDirectory.exists(), equalTo(true));
assertListResource(new File(metaInfDirectory, "jkube/openshift.yml"));
assertThat(new File(metaInfDirectory, "jkube/openshift/spring-boot-complete-deploymentconfig.yml"), yaml(not(anEmptyMap())));
assertThat(new File(metaInfDirectory, "jkube/openshift/spring-boot-complete-service.yml"), yaml(not(anEmptyMap())));
assertListResource(new File(metaInfDirectory, "jkube-openshift-docker/openshift.yml"));
assertThat(new File(metaInfDirectory, "jkube-openshift-docker/openshift/spring-boot-complete-openshift-docker-deploymentconfig.yml"), yaml(not(anEmptyMap())));
assertThat(new File(metaInfDirectory, "jkube-openshift-docker/openshift/spring-boot-complete-openshift-docker-service.yml"), yaml(not(anEmptyMap())));
}

@Test
Expand Down Expand Up @@ -130,10 +135,10 @@ void ocUndeploy() throws Exception {
cleanUpCluster();
}

@Override
public void cleanUpCluster() {
// NO OP
// Don't clean up cluster to avoid removing builds and image streams for other tests
// TODO: Split the Complete test project by profile into multiple projects to avoid this issue
}
// @Override
// public void cleanUpCluster() {
// // NO OP
// // Don't clean up cluster to avoid removing builds and image streams for other tests
// // TODO: Split the Complete test project by profile into multiple projects to avoid this issue
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public List<String> getProfiles() {
return Collections.singletonList("OpenShift-Docker-Spring-Layers-Disabled");
}


@Override
public String getApplication() {
return "spring-boot-complete-oc-docker-spring-layers-disabled";
}

@Test
@Order(1)
@ResourceLock(value = CLUSTER_RESOURCE_INTENSIVE, mode = READ_WRITE)
Expand Down Expand Up @@ -84,9 +90,9 @@ void ocResource() throws Exception {
final File metaInfDirectory = new File(
String.format("../%s/target/classes/META-INF", getProject()));
assertThat(metaInfDirectory.exists(), equalTo(true));
assertListResource(new File(metaInfDirectory, "jkube/openshift.yml"));
assertThat(new File(metaInfDirectory, "jkube/openshift/spring-boot-complete-deploymentconfig.yml"), yaml(not(anEmptyMap())));
assertThat(new File(metaInfDirectory, "jkube/openshift/spring-boot-complete-service.yml"), yaml(not(anEmptyMap())));
assertListResource(new File(metaInfDirectory, "jkube-oc-docker-spring-layers-disabled/openshift.yml"));
assertThat(new File(metaInfDirectory, "jkube-oc-docker-spring-layers-disabled/openshift/spring-boot-complete-oc-docker-spring-layers-disabled-deploymentconfig.yml"), yaml(not(anEmptyMap())));
assertThat(new File(metaInfDirectory, "jkube-oc-docker-spring-layers-disabled/openshift/spring-boot-complete-oc-docker-spring-layers-disabled-service.yml"), yaml(not(anEmptyMap())));
}

@Test
Expand Down Expand Up @@ -128,10 +134,10 @@ void ocUndeploy() throws Exception {
cleanUpCluster();
}

@Override
public void cleanUpCluster() {
// NO OP
// Don't clean up cluster to avoid removing builds and image streams for other tests
// TODO: Split the Complete test project by profile into multiple projects to avoid this issue
}
// @Override
// public void cleanUpCluster() {
// // NO OP
// // Don't clean up cluster to avoid removing builds and image streams for other tests
// // TODO: Split the Complete test project by profile into multiple projects to avoid this issue
// }
}
66 changes: 60 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
<javax.servlet-api.version>4.0.1</javax.servlet-api.version>
<javax.servlet.jsp-api.version>2.3.3</javax.servlet.jsp-api.version>
<!-- JKube version also needs to be updated in projects-to-be-tested/maven/buildpacks/simple/pom.xml -->
<jkube.version>1.17-SNAPSHOT</jkube.version>
<jkube.version>1.18-SNAPSHOT</jkube.version>
<junit.version>5.11.0</junit.version>
<karaf.version>4.4.6</karaf.version>
<license-maven-plugin.version>4.2</license-maven-plugin.version>
Expand Down Expand Up @@ -374,20 +374,71 @@
</build>
</profile>
<profile>
<id>springboot</id>
<id>springboot-zeroconfig</id>
<modules>
<module>projects-to-be-tested/maven/spring/zero-config</module>
<module>projects-to-be-tested/maven/spring/zero-config-fatjar</module>
</modules>
<activation>
<file>
<exists>
projects-to-be-tested/maven/spring/zero-config/target
</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/integrationtests/springboot/zeroconfig/*ITCase.java</include>
<include>**/integrationtests/springboot/zeroconfigfatjar/*ITCase.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>springboot-complete</id>
<modules>
<module>projects-to-be-tested/maven/spring/complete</module>
</modules>
<activation>
<file>
<exists>
projects-to-be-tested/maven/spring/complete/target
</exists>
</file>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/integrationtests/springboot/complete/*ITCase.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>springboot-others</id>
<modules>
<module>projects-to-be-tested/maven/spring/crd</module>
<module>projects-to-be-tested/maven/spring/helm-config</module>
<module>projects-to-be-tested/maven/spring/multi-profile</module>
<module>projects-to-be-tested/maven/spring/watch</module>
<module>projects-to-be-tested/maven/spring/zero-config</module>
<module>projects-to-be-tested/maven/spring/zero-config-fatjar</module>
</modules>
<activation>
<file>
<exists>
projects-to-be-tested/maven/spring/complete/target
projects-to-be-tested/maven/spring/crd/target
</exists>
</file>
</activation>
Expand All @@ -398,7 +449,10 @@
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<includes>
<include>**/integrationtests/springboot/**/*ITCase.java</include>
<include>**/integrationtests/springboot/crd/*ITCase.java</include>
<include>**/integrationtests/springboot/helmconfig/*ITCase.java</include>
<include>**/integrationtests/springboot/multiprofile/*ITCase.java</include>
<include>**/integrationtests/springboot/watch/*ITCase.java</include>
</includes>
</configuration>
</plugin>
Expand Down
12 changes: 12 additions & 0 deletions projects-to-be-tested/maven/spring/complete/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,12 @@
<properties>
<jkube.environment>oc</jkube.environment>
<jkube.build.strategy>docker</jkube.build.strategy>
<jkube.generator.name>spring-boot-complete-openshift-docker</jkube.generator.name>
<jkube.targetDir>${project.build.outputDirectory}/META-INF/jkube-openshift-docker</jkube.targetDir>
<jkube.openshiftManifest>${project.build.outputDirectory}/META-INF/jkube-openshift-docker/openshift.yml</jkube.openshiftManifest>
<jkube.enricher.jkube-controller.name>spring-boot-complete-openshift-docker</jkube.enricher.jkube-controller.name>
<jkube.enricher.jkube-project-label.app>spring-boot-complete-openshift-docker</jkube.enricher.jkube-project-label.app>
<jkube.enricher.jkube-service.name>spring-boot-complete-openshift-docker</jkube.enricher.jkube-service.name>
</properties>
<build>
<plugins>
Expand Down Expand Up @@ -219,6 +225,12 @@
<id>OpenShift-Docker-Spring-Layers-Disabled</id>
<properties>
<jkube.build.strategy>docker</jkube.build.strategy>
<jkube.generator.name>spring-boot-complete-oc-docker-spring-layers-disabled</jkube.generator.name>
<jkube.targetDir>${project.build.outputDirectory}/META-INF/jkube-oc-docker-spring-layers-disabled</jkube.targetDir>
<jkube.openshiftManifest>${project.build.outputDirectory}/META-INF/jkube-oc-docker-spring-layers-disabled/openshift.yml</jkube.openshiftManifest>
<jkube.enricher.jkube-controller.name>spring-boot-complete-oc-docker-spring-layers-disabled</jkube.enricher.jkube-controller.name>
<jkube.enricher.jkube-project-label.app>spring-boot-complete-oc-docker-spring-layers-disabled</jkube.enricher.jkube-project-label.app>
<jkube.enricher.jkube-service.name>spring-boot-complete-oc-docker-spring-layers-disabled</jkube.enricher.jkube-service.name>
</properties>
<build>
<plugins>
Expand Down

0 comments on commit 831f3e4

Please sign in to comment.