Skip to content

Commit 74afffe

Browse files
committed
feat(ci): split integration tests execution by category
Signed-off-by: Chris Laprun <claprun@redhat.com>
1 parent 68832a0 commit 74afffe

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed

.github/workflows/fabric8-next-version-schedule.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ jobs:
3232
matrix:
3333
java: [ 11, 17 ]
3434
kubernetes: ['v1.28.12', 'v1.29.7','1.30.3', '1.31.0']
35+
it-category: [baseapi, dependent, workflow]
3536
uses: ./.github/workflows/integration-tests.yml
3637
with:
3738
java-version: ${{ matrix.java }}
3839
kube-version: ${{ matrix.kubernetes }}
40+
it-category: ${{ matrix.it-category }}
3941

4042
httpclient-tests:
4143
strategy:

.github/workflows/integration-tests.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ on:
2121
type: string
2222
required: false
2323
default: ''
24+
it-category:
25+
type: string
26+
required: false
27+
default: ''
2428

2529
jobs:
2630
integration_tests:
@@ -42,9 +46,14 @@ jobs:
4246
- name: Set up Minikube
4347
uses: manusa/actions-setup-minikube@v2.12.0
4448
with:
45-
minikube version: v1.33.0
46-
kubernetes version: ${{ inputs.kube-version }}
49+
minikube version: 'v1.33.0'
50+
kubernetes version: '${{ inputs.kube-version }}''
4751
driver: 'docker'
4852
github token: ${{ secrets.GITHUB_TOKEN }}
4953
- name: Run integration tests
50-
run: ./mvnw ${MAVEN_ARGS} -B package -P no-unit-tests -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml
54+
run: |
55+
it_profile = "integration-tests"
56+
if [ -z "${{inputs.it-category}}" ]; then
57+
it_profile = "integration-tests-${{inputs.it-category}}"
58+
fi
59+
./mvnw ${MAVEN_ARGS} -B package -P${it_profile} -T1C -Dfabric8-httpclient-impl.name=${{inputs.http-client}} --file pom.xml

.github/workflows/pr.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,12 @@ jobs:
3535
matrix:
3636
java: [ 17, 21 ]
3737
kubernetes: [ 'v1.28.12', 'v1.29.7','1.30.3', '1.31.0' ]
38+
it-category: [ baseapi, dependent, workflow ]
3839
uses: ./.github/workflows/integration-tests.yml
3940
with:
4041
java-version: ${{ matrix.java }}
4142
kube-version: ${{ matrix.kubernetes }}
43+
it-category: ${{ matrix.it-category }}
4244

4345
httpclient-tests:
4446
strategy:

pom.xml

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@
367367
</build>
368368
</profile>
369369
<profile>
370-
<id>no-unit-tests</id>
370+
<id>integration-tests</id>
371371
<build>
372372
<plugins>
373373
<plugin>
@@ -386,6 +386,66 @@
386386
</plugins>
387387
</build>
388388
</profile>
389+
<profile>
390+
<id>integration-tests-baseapi</id>
391+
<build>
392+
<plugins>
393+
<plugin>
394+
<groupId>org.apache.maven.plugins</groupId>
395+
<artifactId>maven-surefire-plugin</artifactId>
396+
<configuration>
397+
<includes>
398+
<include>**/baseapi/*IT.java</include>
399+
</includes>
400+
<excludes>
401+
<exclude>**/*Test.java</exclude>
402+
<exclude>**/*E2E.java</exclude>
403+
</excludes>
404+
</configuration>
405+
</plugin>
406+
</plugins>
407+
</build>
408+
</profile>
409+
<profile>
410+
<id>integration-tests-dependent</id>
411+
<build>
412+
<plugins>
413+
<plugin>
414+
<groupId>org.apache.maven.plugins</groupId>
415+
<artifactId>maven-surefire-plugin</artifactId>
416+
<configuration>
417+
<includes>
418+
<include>**/dependent/*IT.java</include>
419+
</includes>
420+
<excludes>
421+
<exclude>**/*Test.java</exclude>
422+
<exclude>**/*E2E.java</exclude>
423+
</excludes>
424+
</configuration>
425+
</plugin>
426+
</plugins>
427+
</build>
428+
</profile>
429+
<profile>
430+
<id>integration-tests-workflow</id>
431+
<build>
432+
<plugins>
433+
<plugin>
434+
<groupId>org.apache.maven.plugins</groupId>
435+
<artifactId>maven-surefire-plugin</artifactId>
436+
<configuration>
437+
<includes>
438+
<include>**/workflow/*IT.java</include>
439+
</includes>
440+
<excludes>
441+
<exclude>**/*Test.java</exclude>
442+
<exclude>**/*E2E.java</exclude>
443+
</excludes>
444+
</configuration>
445+
</plugin>
446+
</plugins>
447+
</build>
448+
</profile>
389449
<!-- Special category of tests. See usage in source code. -->
390450
<profile>
391451
<id>minimal-watch-timeout-dependent-it</id>

0 commit comments

Comments
 (0)