Skip to content

Cleanup CI GHA an cleanup docs on test case ran #3348

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,11 @@ jobs:
- name: Set up JDK ${{ matrix.java }} ${{ matrix.distribution }}
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
cache: ${{ matrix.cache }}
distribution: ${{ matrix.distribution }}
- name: Print JDK Version
run: java -version
- name: Cache local Maven m2
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-m2
- name: Skip tests that require illegal reflective access
java-version: ${{ matrix.java }}
- name: Setup testContainers profile for ubuntu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: echo 'ARG_LINE=-D"excludedGroups=RequireIllegalAccess"' >> $GITHUB_ENV
- name: Skip tests that require illegal reflective access
if: ${{ matrix.os != 'ubuntu-latest' }}
run: echo 'ARG_LINE=-D"excludedGroups=TestcontainersTests,RequireIllegalAccess"' >> $GITHUB_ENV
- name: Active Profiles
run: ./mvnw help:active-profiles
- name: Test with Maven
if: ${{ matrix.os != 'windows-latest' }}
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
run: echo 'TEST_CONTAINERS_PROFILE=-PtestContainers' >> $GITHUB_ENV
- name: Test with Maven
if: ${{ matrix.os == 'windows-latest' }}
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" -D"jacoco.skip=true" -D"excludedGroups=TestcontainersTests,RequireIllegalAccess"
run: ./mvnw test -B -V --no-transfer-progress -D"license.skip=true" $TEST_CONTAINERS_PROFILE
50 changes: 24 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,38 +37,36 @@ Tests

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

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.

When using jdk 16+, we adjust the rule to ```<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>```.
By default, we set ```<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>``` which will exclude a subset of tests with @Tag('TestcontainersTests') and @Tag('RequireIllegalAccess').

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

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.
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.

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

- any OS + jdk 11 = 1730 tests
- any OS + jdk 17 = 1710 tests
- any OS + jdk 19 = 1710 tests
- any OS + jdk 20 = 1710 tests
- any OS + jdk 21 = 1710 tests
- any OS + jdk 17 = 1899 tests
- any OS + jdk 21 = 1899 tests
- any OS + jdk 23 = 1899 tests
- any OS + jdk 24 = 1899 tests
- any OS + jdk 25 = 1899 tests

our adjustments for GH actions where platform does matter

- windows + jdk 11 = 1730 tests
- windows + jdk 17 = 1710 tests
- windows + jdk 19 = 1710 tests
- windows + jdk 20 = 1710 tests
- windows + jdk 21 = 1710 tests

- linux + jdk 11 = 1765 tests
- linux + jdk 17 = 1745 tests
- linux + jdk 19 = 1745 tests
- linux + jdk 20 = 1745 tests
- linux + jdk 21 = 1745 tests

- mac + jdk 11 = 1730 tests
- mac + jdk 17 = 1710 tests
- mac + jdk 19 = 1710 tests
- mac + jdk 20 = 1710 tests
- mac + jdk 21 = 1710 tests
- windows + jdk 17 = 1899 tests
- windows + jdk 21 = 1899 tests
- windows + jdk 23 = 1899 tests
- windows + jdk 24 = 1899 tests
- windows + jdk 25 = 1899 tests

- linux + jdk 17 = 1934 tests
- linux + jdk 21 = 1934 tests
- linux + jdk 23 = 1934 tests
- linux + jdk 24 = 1934 tests
- linux + jdk 25 = 1934 tests

- mac + jdk 17 = 1899 tests
- mac + jdk 21 = 1899 tests
- mac + jdk 23 = 1899 tests
- mac + jdk 24 = 1899 tests
- mac + jdk 25 = 1899 tests
20 changes: 9 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@

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

<!-- Automatic Module Name -->
<module.name>org.mybatis</module.name>
Expand Down Expand Up @@ -232,12 +233,12 @@
<artifactId>junit-jupiter</artifactId>
<version>${testcontainers.version}</version>
<scope>test</scope>
<!--Only Mysqlcontainer is allowed to use junit 4: Uncomment to test
<!--Only Mysqlcontainer is allowed to use junit 4 due to testContainers coupling: Uncomment to test no other leakage
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
-->
</dependency>
Expand Down Expand Up @@ -423,12 +424,9 @@

<profiles>
<profile>
<id>16</id>
<activation>
<jdk>[16,)</jdk>
</activation>
<id>testContainers</id>
<properties>
<excludedGroups>TestcontainersTests,RequireIllegalAccess</excludedGroups>
<excludedGroups>RequireIllegalAccess</excludedGroups>
</properties>
</profile>
<profile>
Expand Down
Loading