Skip to content

Commit 6cd2d8f

Browse files
authored
JAVA-2622: Add Cassandra 4.0 to build matrix for ITs (apache#1390)
- also fixes the build.yaml for CI builds
1 parent dddb8c6 commit 6cd2d8f

2 files changed

Lines changed: 37 additions & 17 deletions

File tree

build.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ cassandra:
99
- '2.1'
1010
- '3.0'
1111
- '3.11'
12+
- '4.0'
1213
- 'dse-4.8'
1314
- 'dse-5.0'
1415
- 'dse-5.1'
@@ -27,41 +28,45 @@ schedules:
2728
- jabba: openjdk_jdk11
2829
- jabba: openjdk_jdk12
2930
- jabba: openjdk_jdk13
31+
disable_commit_status: true
32+
notify:
33+
slack: java-driver-dev-bots
3034
nightly:
3135
schedule: nightly
3236
matrix:
3337
exclude:
3438
# No excludes for JDK8
3539
# Exclude JDK11 for all but the latest Cassandra and DSE 6.7+
3640
- jabba: openjdk_jdk11
37-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
41+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
3842
# Exclude JDK12 for all but the latest Cassandra and DSE 6.7+
3943
- jabba: openjdk_jdk12
40-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
44+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
4145
# Exclude JDK13 for all but the latest Cassandra and DSE 6.7+
4246
- jabba: openjdk_jdk13
43-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
47+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
48+
disable_commit_status: true
49+
notify:
50+
slack: java-driver-dev-bots
51+
4452
adhoc:
4553
schedule: adhoc
4654
matrix:
4755
exclude:
4856
# No excludes for JDK8
4957
# Exclude JDK11 for all but the latest Cassandra and DSE 6.7+
5058
- jabba: openjdk_jdk11
51-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
59+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
5260
# Exclude JDK12 for all but the latest Cassandra and DSE 6.7+
5361
- jabba: openjdk_jdk12
54-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
62+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
5563
# Exclude JDK13 for all but the latest Cassandra and DSE 6.7+
5664
- jabba: openjdk_jdk13
57-
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', dse-6.8']
65+
cassandra: ['2.1', '3.0', 'dse-4.8', 'dse-5.0', 'dse-5.1', 'dse-6.0', 'dse-6.8']
66+
disable_commit_status: true
67+
notify:
68+
slack: java-driver-dev-bots
5869
build:
59-
- type: maven
60-
- properties: |
61-
ccm.version=$CCM_CASSANDRA_VERSION
62-
ccm.dse=$CCM_IS_DSE
63-
proxy.path=$HOME/proxy
64-
maven.javadoc.skip=true
6570
- script: |
6671
# Jabba default should be a JDK8 for now
6772
jabba use default
@@ -72,11 +77,8 @@ build:
7277
# Use the matrix JDK for testing
7378
jabba use $JABBA_JDK_NAME
7479
# Run tests against matrix JDK
75-
mvn -B -V verify --batch-mode --show-version
80+
mvn -B -V verify --batch-mode --show-version -Dccm.version=$CCM_CASSANDRA_VERSION -Dccm.dse=$CCM_IS_DSE -Dproxy.path=$HOME/proxy -Dmaven.javadoc.skip=true
7681
- xunit:
7782
- "**/target/surefire-reports/TEST-*.xml"
7883
- "**/target/failsafe-reports/TEST-*.xml"
7984
- jacoco: true
80-
disable_commit_status: true
81-
notify:
82-
slack: java-driver-dev-bots

test-infra/src/main/java/com/datastax/oss/driver/api/testinfra/ccm/CcmBridge.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,24 @@ public Version getCassandraVersion() {
186186
}
187187
}
188188

189+
private String getCcmVersionString(Version version) {
190+
// for 4.0 pre-releases, the CCM version string needs to be "4.0-alpha1" or "4.0-alpha2"
191+
// Version.toString() always adds a patch value, even if it's not specified when parsing.
192+
if (version.getMajor() == 4
193+
&& version.getMinor() == 0
194+
&& version.getPatch() == 0
195+
&& version.getPreReleaseLabels() != null) {
196+
// truncate the patch version from the Version string
197+
StringBuilder sb = new StringBuilder();
198+
sb.append(version.getMajor()).append('.').append(version.getMinor());
199+
for (String preReleaseString : version.getPreReleaseLabels()) {
200+
sb.append('-').append(preReleaseString);
201+
}
202+
return sb.toString();
203+
}
204+
return version.toString();
205+
}
206+
189207
public void create() {
190208
if (created.compareAndSet(false, true)) {
191209
if (INSTALL_DIRECTORY != null) {
@@ -194,7 +212,7 @@ public void create() {
194212
createOptions.add("-v git:" + BRANCH.trim().replaceAll("\"", ""));
195213

196214
} else {
197-
createOptions.add("-v " + VERSION.toString());
215+
createOptions.add("-v " + getCcmVersionString(VERSION));
198216
}
199217
if (DSE_ENABLEMENT) {
200218
createOptions.add("--dse");

0 commit comments

Comments
 (0)