Skip to content

Commit e08b503

Browse files
authored
Merge pull request mybatis#3348 from hazendaz/pom-cleanup
Cleanup CI GHA an cleanup docs on test case ran
2 parents 77bbd6f + 9b0695b commit e08b503

File tree

3 files changed

+38
-59
lines changed

3 files changed

+38
-59
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,11 @@ jobs:
2020
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
2121
uses: actions/setup-java@v4
2222
with:
23-
java-version: ${{ matrix.java }}
23+
cache: ${{ matrix.cache }}
2424
distribution: ${{ matrix.distribution }}
25-
- name: Print JDK Version
26-
run: java -version
27-
- name: Cache local Maven m2
28-
uses: actions/cache@v4
29-
with:
30-
path: ~/.m2
31-
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32-
restore-keys: |
33-
${{ runner.os }}-m2
34-
- name: Skip tests that require illegal reflective access
25+
java-version: ${{ matrix.java }}
26+
- name: Setup testContainers profile for ubuntu
3527
if: ${{ matrix.os == 'ubuntu-latest' }}
36-
run: echo 'ARG_LINE=-D"excludedGroups=RequireIllegalAccess"' >> $GITHUB_ENV
37-
- name: Skip tests that require illegal reflective access
38-
if: ${{ matrix.os != 'ubuntu-latest' }}
39-
run: echo 'ARG_LINE=-D"excludedGroups=TestcontainersTests,RequireIllegalAccess"' >> $GITHUB_ENV
40-
- name: Active Profiles
41-
run: ./mvnw help:active-profiles
42-
- name: Test with Maven
43-
if: ${{ matrix.os != 'windows-latest' }}
44-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
28+
run: echo 'TEST_CONTAINERS_PROFILE=-PtestContainers' >> $GITHUB_ENV
4529
- name: Test with Maven
46-
if: ${{ matrix.os == 'windows-latest' }}
47-
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"
30+
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" $TEST_CONTAINERS_PROFILE

README.md

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,38 +37,36 @@ Tests
3737

3838
Mybatis-3 code runs more expressive testing depending on jdk usage and platform.
3939

40-
By default, we set ```<excludedGroups>TestcontainersTests</excludedGroups>``` which will exclude a subset of tests with @Tag('TestcontainersTests'). Further, if pre jdk 16, we will further exclude record classes from executions further reducing tests.
41-
42-
When using jdk 16+, we adjust the rule to ```<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>```.
40+
By default, we set ```<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>``` which will exclude a subset of tests with @Tag('TestcontainersTests') and @Tag('RequireIllegalAccess').
4341

4442
When we run on ci platform, we further make adjustments as needed. See [here](.github/workflows/ci.yaml) for details.
4543

46-
As of 2/20/2023, using combined system + jdk will result in given number of tests ran. This will change as tests are added or removed over time.
44+
As of 12/28/2024, using combined system + jdk will result in given number of tests ran. This will change as tests are added or removed over time.
4745

4846
without adjusting settings (ie use as is, platform does not matter)
4947

50-
- any OS + jdk 11 = 1730 tests
51-
- any OS + jdk 17 = 1710 tests
52-
- any OS + jdk 19 = 1710 tests
53-
- any OS + jdk 20 = 1710 tests
54-
- any OS + jdk 21 = 1710 tests
48+
- any OS + jdk 17 = 1899 tests
49+
- any OS + jdk 21 = 1899 tests
50+
- any OS + jdk 23 = 1899 tests
51+
- any OS + jdk 24 = 1899 tests
52+
- any OS + jdk 25 = 1899 tests
5553

5654
our adjustments for GH actions where platform does matter
5755

58-
- windows + jdk 11 = 1730 tests
59-
- windows + jdk 17 = 1710 tests
60-
- windows + jdk 19 = 1710 tests
61-
- windows + jdk 20 = 1710 tests
62-
- windows + jdk 21 = 1710 tests
63-
64-
- linux + jdk 11 = 1765 tests
65-
- linux + jdk 17 = 1745 tests
66-
- linux + jdk 19 = 1745 tests
67-
- linux + jdk 20 = 1745 tests
68-
- linux + jdk 21 = 1745 tests
69-
70-
- mac + jdk 11 = 1730 tests
71-
- mac + jdk 17 = 1710 tests
72-
- mac + jdk 19 = 1710 tests
73-
- mac + jdk 20 = 1710 tests
74-
- mac + jdk 21 = 1710 tests
56+
- windows + jdk 17 = 1899 tests
57+
- windows + jdk 21 = 1899 tests
58+
- windows + jdk 23 = 1899 tests
59+
- windows + jdk 24 = 1899 tests
60+
- windows + jdk 25 = 1899 tests
61+
62+
- linux + jdk 17 = 1934 tests
63+
- linux + jdk 21 = 1934 tests
64+
- linux + jdk 23 = 1934 tests
65+
- linux + jdk 24 = 1934 tests
66+
- linux + jdk 25 = 1934 tests
67+
68+
- mac + jdk 17 = 1899 tests
69+
- mac + jdk 21 = 1899 tests
70+
- mac + jdk 23 = 1899 tests
71+
- mac + jdk 24 = 1899 tests
72+
- mac + jdk 25 = 1899 tests

pom.xml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@
8181

8282
<!-- Add slow test groups here and annotate classes similar to @Tag('groupName'). -->
8383
<!-- Excluded groups are ran on github ci, to force here, pass -d"excludedGroups=" -->
84-
<excludedGroups>TestcontainersTests</excludedGroups>
84+
<!-- Note: RequireIllegalAccess tests are now no longer valid as they only worked prior to java 16 -->
85+
<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>
8586

8687
<!-- Automatic Module Name -->
8788
<module.name>org.mybatis</module.name>
@@ -232,12 +233,12 @@
232233
<artifactId>junit-jupiter</artifactId>
233234
<version>${testcontainers.version}</version>
234235
<scope>test</scope>
235-
<!--Only Mysqlcontainer is allowed to use junit 4: Uncomment to test
236+
<!--Only Mysqlcontainer is allowed to use junit 4 due to testContainers coupling: Uncomment to test no other leakage
236237
<exclusions>
237-
<exclusion>
238-
<groupId>junit</groupId>
239-
<artifactId>junit</artifactId>
240-
</exclusion>
238+
<exclusion>
239+
<groupId>junit</groupId>
240+
<artifactId>junit</artifactId>
241+
</exclusion>
241242
</exclusions>
242243
-->
243244
</dependency>
@@ -423,12 +424,9 @@
423424

424425
<profiles>
425426
<profile>
426-
<id>16</id>
427-
<activation>
428-
<jdk>[16,)</jdk>
429-
</activation>
427+
<id>testContainers</id>
430428
<properties>
431-
<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>
429+
<excludedGroups>RequireIllegalAccess</excludedGroups>
432430
</properties>
433431
</profile>
434432
<profile>

0 commit comments

Comments
 (0)