Skip to content

Commit d48c869

Browse files
committed
chore: move extracted changes out of Java 8 branch
1 parent 1422265 commit d48c869

2 files changed

Lines changed: 81 additions & 3 deletions

File tree

.github/workflows/tests@v1.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ jobs:
212212
id: cassandra-version
213213
env:
214214
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
215-
GH_TOKEN: ${{ github.token }}
216215
run: make resolve-cassandra-version
217216

218217
- name: Pull CCM image from the cache
@@ -247,9 +246,7 @@ jobs:
247246
- name: Run integration tests on Cassandra (${{ steps.cassandra-version.outputs.value }}) - ${{ matrix.test-group }}
248247
id: run-integration-tests
249248
env:
250-
CASSANDRA_VERSION: ${{ matrix.cassandra-version }}
251249
CASSANDRA_VERSION_RESOLVED: ${{ steps.cassandra-version.outputs.value }}
252-
GH_TOKEN: ${{ github.token }}
253250
MAVEN_EXTRA_ARGS: ${{ steps.test-skip-args.outputs.value }}
254251
run: make test-integration-cassandra
255252

Jenkinsfile-asf

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
#!groovy
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
pipeline {
23+
agent {
24+
label 'cassandra-small'
25+
}
26+
27+
triggers {
28+
// schedules only run against release branches (i.e. 3.x, 4.x, 4.5.x, etc.)
29+
cron(branchPatternCron().matcher(env.BRANCH_NAME).matches() ? '@weekly' : '')
30+
}
31+
32+
stages {
33+
stage('Matrix') {
34+
matrix {
35+
axes {
36+
axis {
37+
name 'TEST_JAVA_VERSION'
38+
values 'openjdk@1.8.0-292', 'openjdk@1.11.0-9', 'openjdk@1.17.0', 'openjdk@1.21.0'
39+
}
40+
axis {
41+
name 'SERVER_VERSION'
42+
values '3.11',
43+
'4.0',
44+
'4.1',
45+
'5.0'
46+
}
47+
}
48+
stages {
49+
stage('Tests') {
50+
agent {
51+
label 'cassandra-medium'
52+
}
53+
steps {
54+
script {
55+
executeTests()
56+
junit testResults: '**/target/surefire-reports/TEST-*.xml', allowEmptyResults: true
57+
junit testResults: '**/target/failsafe-reports/TEST-*.xml', allowEmptyResults: true
58+
}
59+
}
60+
}
61+
}
62+
}
63+
}
64+
}
65+
}
66+
67+
def executeTests() {
68+
def testJavaMajorVersion = (TEST_JAVA_VERSION =~ /@(?:1\.)?(\d+)/)[0][1]
69+
sh """
70+
container_id=\$(docker run -td -e TEST_JAVA_VERSION=${TEST_JAVA_VERSION} -e SERVER_VERSION=${SERVER_VERSION} -e TEST_JAVA_MAJOR_VERSION=${testJavaMajorVersion} -v \$(pwd):/home/docker/cassandra-java-driver apache.jfrog.io/cassan-docker/apache/cassandra-java-driver-testing-ubuntu2204 'sleep 2h')
71+
docker exec --user root \$container_id bash -c \"sudo bash /home/docker/cassandra-java-driver/ci/create-user.sh docker \$(id -u) \$(id -g) /home/docker/cassandra-java-driver\"
72+
docker exec --user docker \$container_id './cassandra-java-driver/ci/run-tests.sh'
73+
( nohup docker stop \$container_id >/dev/null 2>/dev/null & )
74+
"""
75+
}
76+
77+
// branch pattern for cron
78+
// should match 3.x, 4.x, 4.5.x, etc
79+
def branchPatternCron() {
80+
~'((\\d+(\\.[\\dx]+)+))'
81+
}

0 commit comments

Comments
 (0)