Skip to content

Commit

Permalink
feat(ci): split integration tests execution by category
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Laprun <[email protected]>
  • Loading branch information
metacosm committed Oct 10, 2024
1 parent 68832a0 commit b49ffae
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 4 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/fabric8-next-version-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ jobs:
matrix:
java: [ 11, 17 ]
kubernetes: ['v1.28.12', 'v1.29.7','1.30.3', '1.31.0']
it-category: [baseapi, dependent, workflow]
uses: ./.github/workflows/integration-tests.yml
with:
java-version: ${{ matrix.java }}
kube-version: ${{ matrix.kubernetes }}
it-category: ${{ matrix.it-category }}

httpclient-tests:
strategy:
Expand Down
15 changes: 12 additions & 3 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ on:
type: string
required: false
default: ''
it-category:
type: string
required: false
default: ''

jobs:
integration_tests:
Expand All @@ -42,9 +46,14 @@ jobs:
- name: Set up Minikube
uses: manusa/[email protected]
with:
minikube version: v1.33.0
kubernetes version: ${{ inputs.kube-version }}
minikube version: 'v1.33.0'
kubernetes version: '${{ inputs.kube-version }}'
driver: 'docker'
github token: ${{ secrets.GITHUB_TOKEN }}
- name: Run integration tests
run: ./mvnw ${MAVEN_ARGS} -B package -P no-unit-tests -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
run: |
it_profile="integration-tests"
if [ -z "${{inputs.it-category}}" ]; then
it_profile="integration-tests-${{inputs.it-category}}"
fi
./mvnw ${MAVEN_ARGS} -B package -P${it_profile} -T1C -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
2 changes: 2 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ jobs:
matrix:
java: [ 17, 21 ]
kubernetes: [ 'v1.28.12', 'v1.29.7','1.30.3', '1.31.0' ]
it-category: [ baseapi, dependent, workflow ]
uses: ./.github/workflows/integration-tests.yml
with:
java-version: ${{ matrix.java }}
kube-version: ${{ matrix.kubernetes }}
it-category: ${{ matrix.it-category }}

httpclient-tests:
strategy:
Expand Down
62 changes: 61 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
</build>
</profile>
<profile>
<id>no-unit-tests</id>
<id>integration-tests</id>
<build>
<plugins>
<plugin>
Expand All @@ -386,6 +386,66 @@
</plugins>
</build>
</profile>
<profile>
<id>integration-tests-baseapi</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/baseapi/*IT.java</include>
</includes>
<excludes>
<exclude>**/*Test.java</exclude>
<exclude>**/*E2E.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-tests-dependent</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/dependent/*IT.java</include>
</includes>
<excludes>
<exclude>**/*Test.java</exclude>
<exclude>**/*E2E.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>integration-tests-workflow</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<includes>
<include>**/workflow/*IT.java</include>
</includes>
<excludes>
<exclude>**/*Test.java</exclude>
<exclude>**/*E2E.java</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<!-- Special category of tests. See usage in source code. -->
<profile>
<id>minimal-watch-timeout-dependent-it</id>
Expand Down

0 comments on commit b49ffae

Please sign in to comment.