Skip to content

Commit ee23508

Browse files
authored
Merge pull request #2820 from hazendaz/tests
[pom] Move surefire configuration to parent and make properties more …
2 parents 4f04806 + 5a46b2e commit ee23508

File tree

3 files changed

+51
-18
lines changed

3 files changed

+51
-18
lines changed

.github/workflows/ci.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,20 @@ jobs:
4040
- name: Set argLine command line option
4141
if: ${{ matrix.java == '11' }}
4242
run: echo 'ARG_LINE=-D"argLine=--illegal-access=permit"' >> $GITHUB_ENV
43+
- name: Run all tests
44+
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java == '11' }}
45+
run: echo 'ARG_LINE=-D"excludedGroups="' >> $GITHUB_ENV
4346
- name: Skip tests that require illegal reflective access
4447
if: ${{ matrix.os == 'ubuntu-latest' && matrix.java != '11' }}
4548
run: echo 'ARG_LINE=-D"excludedGroups=RequireIllegalAccess"' >> $GITHUB_ENV
4649
- name: Skip tests that require illegal reflective access
4750
if: ${{ matrix.os != 'ubuntu-latest' && matrix.java != '11' }}
4851
run: echo 'ARG_LINE=-D"excludedGroups=TestcontainersTests,RequireIllegalAccess"' >> $GITHUB_ENV
49-
- name: Set env command line option
50-
if: ${{ matrix.os == 'ubuntu-latest' }}
51-
run: echo 'ENV_GITHUB="-Denv.GITHUB"' >> $GITHUB_ENV
52+
- name: Active Profiles
53+
run: ./mvnw help:active-profiles
5254
- name: Test with Maven
5355
if: ${{ matrix.os != 'windows-latest' }}
54-
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" $ENV_GITHUB $ARG_LINE
56+
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" $ARG_LINE
5557
- name: Test with Maven
5658
if: ${{ matrix.os == 'windows-latest' && matrix.java == '11' }}
5759
run: ./mvnw test -B -D"license.skip=true" -D"jacoco.skip=true" -D"argLine=--illegal-access=permit"

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,44 @@ Mybatis-core is now being auto formatted. Given nature of some code logic with
3131
- ```// @formatter:on``` to end the block of unformatted code
3232

3333
If comment sections need same behaviour such as javadocs, note that the entire block must be around entire comment as direct usage does not properly indicate that formatter treats it all as one comment block regardless.
34+
35+
Tests
36+
-----
37+
38+
Mybatis-3 code runs more expressive testing depending on jdk usage and platform.
39+
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>```.
43+
44+
When we run on ci platform, we further make adjustments as needed. See [here](.github/workflows/ci.yaml) for details.
45+
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.
47+
48+
without adjusting settings (ie use as is, platform does not matter)
49+
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
55+
56+
our adjustments for GH actions where platform does matter
57+
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

pom.xml

+4-14
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@
132132

133133
<properties>
134134
<clirr.comparisonVersion>3.4.6</clirr.comparisonVersion>
135+
<!-- Add slow test groups here and annotate classes similar to @Tag('groupName'). -->
136+
<!-- Excluded groups are ran on github ci, to force here, pass -d"excludedGroups=" -->
135137
<excludedGroups>TestcontainersTests</excludedGroups>
136138
<maven.compiler.testCompilerArgument>-parameters</maven.compiler.testCompilerArgument>
137139
<module.name>org.mybatis</module.name>
@@ -335,7 +337,7 @@
335337
<groupId>org.apache.maven.plugins</groupId>
336338
<artifactId>maven-surefire-plugin</artifactId>
337339
<configuration>
338-
<systemProperties>
340+
<systemPropertyVariables>
339341
<property>
340342
<name>derby.stream.error.file</name>
341343
<value>${project.build.directory}/derby.log</value>
@@ -344,7 +346,7 @@
344346
<name>derby.system.home</name>
345347
<value>${project.build.directory}</value>
346348
</property>
347-
</systemProperties>
349+
</systemPropertyVariables>
348350
</configuration>
349351
</plugin>
350352
<plugin>
@@ -418,18 +420,6 @@
418420
</build>
419421

420422
<profiles>
421-
<profile>
422-
<!-- Run slow tests only on github ci, to force run otherwise use -D"env.GITHUB" -->
423-
<id>github-ci</id>
424-
<activation>
425-
<property>
426-
<name>env.GITHUB</name>
427-
</property>
428-
</activation>
429-
<properties>
430-
<excludedGroups />
431-
</properties>
432-
</profile>
433423
<profile>
434424
<id>pre16</id>
435425
<activation>

0 commit comments

Comments
 (0)