You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by mc...@apache.org on 2021/05/06 15:30:21 UTC

[cassandra-builds] branch trunk updated: Fixes for parallel docker runs - empty splits will fail, just run one test instead (to create the needed junit xml report) - tests that don't split need to avoid any last argument

This is an automated email from the ASF dual-hosted git repository.

mck pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/cassandra-builds.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 14504b9  Fixes for parallel docker runs  - empty splits will fail, just run one test instead (to create the needed junit xml report)  - tests that don't split need to avoid any last argument
14504b9 is described below

commit 14504b98b25a50b51ed07ee3163f2139498df736
Author: Mick Semb Wever <mc...@apache.org>
AuthorDate: Thu May 6 17:28:21 2021 +0200

    Fixes for parallel docker runs
     - empty splits will fail, just run one test instead (to create the needed junit xml report)
     - tests that don't split need to avoid any last argument
---
 build-scripts/cassandra-test.sh           | 12 +++++++-----
 jenkins-dsl/cassandra_job_dsl_seed.groovy | 12 ++++++++----
 2 files changed, 15 insertions(+), 9 deletions(-)

diff --git a/build-scripts/cassandra-test.sh b/build-scripts/cassandra-test.sh
index 0bb428d..5680792 100755
--- a/build-scripts/cassandra-test.sh
+++ b/build-scripts/cassandra-test.sh
@@ -30,6 +30,7 @@ _timeout_for() {
 }
 
 _build_all_dtest_jars() {
+    mkdir -p build
     cd $TMP_DIR
     until git clone --quiet --depth 1 --no-single-branch https://github.com/apache/cassandra.git cassandra-dtest-jars ; do echo "git clone failed… trying again… " ; done
     cd cassandra-dtest-jars
@@ -51,12 +52,13 @@ _run_testlist() {
     local _split_chunk=$3
     local _test_timeout=$4
     testlist="$( _list_tests "${_target_prefix}" | _split_tests "${_split_chunk}")"
-    if ! [[ -z "$testlist" ]]; then
-      ant clean jar
-      ant $_testlist_target -Dtest.classlistprefix="${_target_prefix}" -Dtest.classlistfile=<(echo "${testlist}") -Dtest.timeout="${_test_timeout}" -Dtmp.dir="${TMP_DIR}" || echo "failed ${_target_prefix} ${$_testlist_target}"
-    else
-      echo Skipping ${_target_prefix} ${_testlist_target}, no tests in split ${_split_chunk}
+    if [[ -z "$testlist" ]]; then
+      # something has to run in the split to generate a junit xml result
+      echo Hacking ${_target_prefix} ${_testlist_target} to run only first test found as no tests in split ${_split_chunk} were found
+      testlist="$( _list_tests "${_target_prefix}" | head -n1)"
     fi
+    ant clean jar
+    ant $_testlist_target -Dtest.classlistprefix="${_target_prefix}" -Dtest.classlistfile=<(echo "${testlist}") -Dtest.timeout="${_test_timeout}" -Dtmp.dir="${TMP_DIR}" || echo "failed ${_target_prefix} ${$_testlist_target}"
 }
 
 _main() {
diff --git a/jenkins-dsl/cassandra_job_dsl_seed.groovy b/jenkins-dsl/cassandra_job_dsl_seed.groovy
index 3bebff3..1201640 100644
--- a/jenkins-dsl/cassandra_job_dsl_seed.groovy
+++ b/jenkins-dsl/cassandra_job_dsl_seed.groovy
@@ -352,8 +352,8 @@ matrixJob('Cassandra-template-cqlsh-tests') {
     steps {
         buildDescription('', buildDescStr)
         shell("""
-            git clean -xdff" ;
-            ./pylib/cassandra-cqlsh-tests.sh $WORKSPACE' ;
+            git clean -xdff ;
+            ./pylib/cassandra-cqlsh-tests.sh \$WORKSPACE ;
             echo "\${BUILD_TAG}) cassandra: `git log -1 --pretty=format:'%h %an %ad %s'`" > \${BUILD_TAG}.head ;
             wget "\${BUILD_URL}/timestamps/?time=HH:mm:ss&timeZone=UTC&appendLog" -qO - > console.log.xz
             """)
@@ -444,11 +444,13 @@ cassandraBranches.each {
             matrixJob("${jobNamePrefix}-${targetName}") {
                 disabled(false)
                 using('Cassandra-template-test')
+                def _testSplits = ''
                 axes {
                     if (isSplittableTest(targetName)) {
                         List<String> values = new ArrayList<String>()
                         (1..testSplits).each { values << it.toString() }
                         text('split', values)
+                        _testSplits = "/${testSplits}"
                     }
                     // jvm-dtest-upgrade would require mixed JDK compilations to support JDK11+
                     if ((branchName == 'trunk' || branchName == 'cassandra-4.0') && targetName != 'jvm-dtest-upgrade') {
@@ -467,7 +469,7 @@ cassandraBranches.each {
                 }
                 steps {
                     shell("""
-                            ./cassandra-builds/build-scripts/cassandra-test-docker.sh apache ${branchName} ${buildsRepo} ${buildsBranch} ${testDockerImage} ${targetName} \${split}/${testSplits} ;
+                            ./cassandra-builds/build-scripts/cassandra-test-docker.sh apache ${branchName} ${buildsRepo} ${buildsBranch} ${testDockerImage} ${targetName} \${split}${_testSplits} ;
                             ./cassandra-builds/build-scripts/cassandra-test-report.sh ;
                             xz TESTS-TestSuites.xml ;
                             wget "\${BUILD_URL}/timestamps/?time=HH:mm:ss&timeZone=UTC&appendLog" -qO - > console.log.xz
@@ -809,11 +811,13 @@ testTargets.each {
     matrixJob("Cassandra-devbranch-${targetName}") {
         description(jobDescription)
         concurrentBuild()
+        def _testSplits = ''
         axes {
             if (isSplittableTest(targetName)) {
                 List<String> values = new ArrayList<String>()
                 (1..testSplits).each { values << it.toString() }
                 text('split', values)
+                _testSplits = "/${testSplits}"
             }
             jdk(jdkLabel,'jdk_11_latest')
             if (use_arm64_test_label()) {
@@ -1119,7 +1123,7 @@ matrixJob('Cassandra-devbranch-cqlsh-tests') {
         shell("""
                 git clean -xdff ;
                 echo "Cassandra-devbranch-cqlsh-tests) cassandra: `git log -1 --pretty=format:'%h %an %ad %s'`" > Cassandra-devbranch-cqlsh-tests.head ;
-                ./pylib/cassandra-cqlsh-tests.sh $WORKSPACE ;
+                ./pylib/cassandra-cqlsh-tests.sh \$WORKSPACE ;
                 wget "\${BUILD_URL}/timestamps/?time=HH:mm:ss&timeZone=UTC&appendLog" -qO - > console.log.xz
              """)
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org