Skip to content

Commit 5864532

Browse files
committed
Added java_version to use in GH action Gradle build as -D param
1 parent 4f192f4 commit 5864532

File tree

1 file changed

+9
-28
lines changed

1 file changed

+9
-28
lines changed

.github/workflows/matrix.js

+9-28
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ matrix.addAxis({
4141
'8',
4242
'11',
4343
'17',
44-
'20',
4544
'21 ',
4645
]
4746
});
@@ -67,16 +66,6 @@ matrix.addAxis({
6766
]
6867
});
6968

70-
// Test cases when Object#hashCode produces the same results
71-
// It allows capturing cases when the code uses hashCode as a unique identifier
72-
matrix.addAxis({
73-
name: 'hash',
74-
values: [
75-
{value: 'regular', title: '', weight: 42},
76-
{value: 'same', title: 'same hashcode', weight: 1}
77-
]
78-
});
79-
8069
matrix.addAxis({
8170
name: 'locale',
8271
title: x => x.language + '_' + x.country,
@@ -89,59 +78,51 @@ matrix.addAxis({
8978
});
9079

9180
matrix.setNamePattern([
92-
'java_version', 'java_distribution', 'hash', 'os',
81+
'java_version', 'java_distribution', 'os',
9382
'tz', 'locale',
9483
]);
9584

96-
// Microsoft Java has no distribution for 8, 18, 19
85+
// Microsoft Java has no distribution for 8, 18, 19, 20
9786
matrix.exclude({java_distribution: 'microsoft', java_version: '8'});
9887
matrix.exclude({java_distribution: 'microsoft', java_version: '18'});
9988
matrix.exclude({java_distribution: 'microsoft', java_version: '19'});
10089
matrix.exclude({java_distribution: 'microsoft', java_version: '20'});
10190
// Oracle supports 17+ only
10291
matrix.exclude({java_distribution: 'oracle', java_version: ['8', '11', '19']});
103-
// TODO: remove when compileJava with "same hashcode" issues are resolved
104-
// See https://bugs.openjdk.org/browse/JDK-8288590 is resolved
105-
// See https://github.com/jqwik-team/jqwik/pull/460#issuecomment-1428261036
106-
matrix.exclude({hash: {value: 'same'}});
107-
108-
// The most rare features should be generated the first
109-
// For instance, we have a lot of PostgreSQL versions, so we generate the minimal the first
110-
// It would have to generate other parameters, and it might happen it would cover "most recent Java" automatically
111-
// Ensure at least one job with "same" hashcode exists
112-
// TODO: un-comment once "same hashcode" issues are resolved
113-
// matrix.generateRow({hash: {value: 'same'}});
92+
11493
// Ensure there will be at least one job with minimal supported Java
11594
matrix.generateRow({java_version: matrix.axisByName.java_version.values[0]});
95+
11696
// Ensure there will be at least one job with the latest Java
11797
matrix.generateRow({java_version: matrix.axisByName.java_version.values.slice(-1)[0]});
98+
11899
// Ensure at least one Windows and at least one Linux job is present (macOS is almost the same as Linux)
119-
// matrix.generateRow({os: 'windows-latest'});
100+
matrix.generateRow({os: 'windows-latest'});
120101
matrix.generateRow({os: 'ubuntu-latest'});
121102

122103
const include = matrix.generateRows(process.env.MATRIX_JOBS || 5);
123104
if (include.length === 0) {
124105
throw new Error('Matrix list is empty');
125106
}
107+
126108
include.sort((a, b) => a.name.localeCompare(b.name, undefined, {numeric: true}));
127109
include.forEach(v => {
128110
// Pass locale via Gradle arguments in case it won't be inherited from _JAVA_OPTIONS
129111
// In fact, _JAVA_OPTIONS is non-standard and might be ignored by some JVMs
130112
let gradleArgs = [
131113
`-Duser.country=${v.locale.country}`,
132114
`-Duser.language=${v.locale.language}`,
115+
`-DjavaVersion=${v.java_version}`,
133116
];
134117
v.extraGradleArgs = gradleArgs.join(' ');
135118
});
136119
include.forEach(v => {
137120
let jvmArgs = [];
138121

139-
if (v.hash.value === 'same') {
140-
jvmArgs.push('-XX:+UnlockExperimentalVMOptions', '-XX:hashCode=2');
141-
}
142122
// Pass locale via _JAVA_OPTIONS so all the forked processes inherit it
143123
jvmArgs.push(`-Duser.country=${v.locale.country}`);
144124
jvmArgs.push(`-Duser.language=${v.locale.language}`);
125+
//jvmArgs.push(`-DjavaVersion=${v.java_version}`); // Is that necessary?
145126
if (v.jit === 'hotspot' && Math.random() > 0.5) {
146127
// The following options randomize instruction selection in JIT compiler
147128
// so it might reveal missing synchronization in TestNG code

0 commit comments

Comments
 (0)