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

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


The following commit(s) were added to refs/heads/master by this push:
     new 399a8a0  Jenkins tests to use testclasslist where possible (like 
CircleCI) (CASSANDRA-15651)
399a8a0 is described below

commit 399a8a0c87489aea236b240ca0edaf781c1c4966
Author: mck <m...@apache.org>
AuthorDate: Sat Mar 21 12:21:07 2020 +0100

    Jenkins tests to use testclasslist where possible (like CircleCI) 
(CASSANDRA-15651)
---
 build-scripts/cassandra-jvm-dtest.sh      | 32 -----------------
 build-scripts/cassandra-test.sh           | 60 +++++++++++++++++++++++++++++++
 build-scripts/cassandra-unittest.sh       | 36 -------------------
 jenkins-dsl/cassandra_job_dsl_seed.groovy | 19 +++-------
 4 files changed, 64 insertions(+), 83 deletions(-)

diff --git a/build-scripts/cassandra-jvm-dtest.sh 
b/build-scripts/cassandra-jvm-dtest.sh
deleted file mode 100755
index 0b41323..0000000
--- a/build-scripts/cassandra-jvm-dtest.sh
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env bash
-
-set -o xtrace
-set -o errexit
-set -o pipefail
-set -o nounset
-
-# lists all tests for the specific test type
-_list_tests() {
-  local readonly classlistprefix="$1"
-
-  find "test/$classlistprefix" -name '*Test.java' | sed 
"s;^test/$classlistprefix/;;g"
-}
-
-_list_tests_no_upgrade() {
- _list_tests "distributed" | grep -v "upgrade"
-}
-
-_main() {
-  local java_version
-  java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' | awk 
-F. '{print $1}')
-  if [ "$java_version" -ge 11 ]; then
-    export CASSANDRA_USE_JDK11=true
-  fi
-
-  local test_timeout
-  test_timeout=$(grep 'name="test.distributed.timeout"' build.xml | awk -F'"' 
'{print $4}')
-
-  ant testclasslist -Dtest.timeout="$test_timeout" -Dtest.classlistfile=<( 
_list_tests_no_upgrade ) -Dtest.classlistprefix=distributed || echo "ant 
testclasslist failed"
-}
-
-_main "$@"
diff --git a/build-scripts/cassandra-test.sh b/build-scripts/cassandra-test.sh
new file mode 100755
index 0000000..bdb255f
--- /dev/null
+++ b/build-scripts/cassandra-test.sh
@@ -0,0 +1,60 @@
+#!/usr/bin/env bash
+
+set -o xtrace
+set -o errexit
+set -o pipefail
+set -o nounset
+
+# lists all tests for the specific test type
+_list_tests() {
+  local readonly classlistprefix="$1"
+  find "test/$classlistprefix" -name '*Test.java' | sed 
"s;^test/$classlistprefix/;;g"
+}
+
+_list_distributed_tests_no_upgrade() {
+  _list_tests "distributed" | grep -v "upgrade"
+}
+
+_timeout_for() {
+  grep "name=\"$1\"" build.xml | awk -F'"' '{print $4}'
+}
+
+_main() {
+  local target="${1:-}"
+  local java_version=$(java -version 2>&1 | awk -F '"' '/version/ {print $2}' 
| awk -F. '{print $1}')
+  if [ "$java_version" -ge 11 ]; then
+    export CASSANDRA_USE_JDK11=true
+  fi
+
+  ant clean jar
+
+  case $target in
+    "stress-test" | "fqltool-test")
+      ant $target || echo "failed $target"
+      ;;
+    "test")
+      ant testclasslist -Dtest.classlistfile=<( _list_tests "unit" ) || echo 
"failed $target"
+      ;;
+    "test-cdc")
+      ant testclasslist-cdc -Dtest.classlistfile=<( _list_tests "unit" ) || 
echo "failed $target"
+      ;;
+    "test-compression")
+      ant testclasslist-compression -Dtest.classlistfile=<( _list_tests "unit" 
) || echo "failed $target"
+      ;;
+    "test-burn")
+      ant testclasslist -Dtest.timeout=$(_timeout_for "test.burn.timeout") 
-Dtest.classlistfile=<( _list_tests "burn" ) || echo "failed $target"
+      ;;
+    "long-test")
+      ant testclasslist -Dtest.timeout=$(_timeout_for "test.long.timeout") 
-Dtest.classlistfile=<( _list_tests "long" ) || echo "failed $target"
+      ;;
+    "test-jvm-dtest-forking")
+      ant testclasslist -Dtest.timeout=$(_timeout_for 
"test.distributed.timeout") -Dtest.classlistfile=<( 
_list_distributed_tests_no_upgrade ) -Dtest.classlistprefix=distributed || echo 
"failed $target"
+      ;;
+    *)
+      echo "unregconised \"$target\""
+      exit 1
+      ;;
+  esac
+}
+
+_main "$@"
diff --git a/build-scripts/cassandra-unittest.sh 
b/build-scripts/cassandra-unittest.sh
deleted file mode 100755
index 0c91c26..0000000
--- a/build-scripts/cassandra-unittest.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash -x
-
-################################
-#
-# Prep
-#
-################################
-
-# Pass in target to run, default to `ant test`
-TEST_TARGET="${1:-test}"
-
-################################
-#
-# Main
-#
-################################
-
-# Loop to prevent failure due to maven-ant-tasks not downloading a jar..
-for x in $(seq 1 3); do
-    ant clean jar
-    RETURN="$?"
-    if [ "${RETURN}" -eq "0" ]; then
-        # Run target and exit cleanly for usable "Unstable" status
-        ant "${TEST_TARGET}"
-        exit 0
-    fi
-done
-
-################################
-#
-# Clean
-#
-################################
-
-# If we failed `ant jar` loop
-exit "${RETURN}"
diff --git a/jenkins-dsl/cassandra_job_dsl_seed.groovy 
b/jenkins-dsl/cassandra_job_dsl_seed.groovy
index 699748e..294d966 100644
--- a/jenkins-dsl/cassandra_job_dsl_seed.groovy
+++ b/jenkins-dsl/cassandra_job_dsl_seed.groovy
@@ -41,7 +41,7 @@ if(binding.hasVariable("CASSANDRA_BRANCHES")) {
     cassandraBranches = "${CASSANDRA_BRANCHES}".split(",")
 }
 // Ant test targets
-def testTargets = ['test', 'test-burn', 'test-cdc', 'test-compression', 
'stress-test', 'fqltool-test', 'long-test']
+def testTargets = ['test', 'test-burn', 'test-cdc', 'test-compression', 
'stress-test', 'fqltool-test', 'long-test', 'test-jvm-dtest-forking']
 if(binding.hasVariable("CASSANDRA_ANT_TEST_TARGETS")) {
     testTargets = "${CASSANDRA_ANT_TEST_TARGETS}".split(",")
 }
@@ -367,23 +367,12 @@ cassandraBranches.each {
                     node / scm / branches / 'hudson.plugins.git.BranchSpec' / 
name(branchName)
                 }
                 steps {
-                    
shell("./cassandra-builds/build-scripts/cassandra-unittest.sh ${targetName}")
+                    shell("./cassandra-builds/build-scripts/cassandra-test.sh 
${targetName}")
                 }
             }
         }
     }
 
-     job("${jobNamePrefix}-test-jvm-dtest-forking") {
-        disabled(false)
-        using('Cassandra-template-test')
-        configure { node ->
-            node / scm / branches / 'hudson.plugins.git.BranchSpec' / 
name(branchName)
-        }
-        steps {
-            shell("./cassandra-builds/build-scripts/cassandra-jvm-dtest.sh")
-        }
-    }
-
     /**
      * Main branch dtest variation jobs
      */
@@ -423,6 +412,7 @@ cassandraBranches.each {
                 node / scm / branches / 'hudson.plugins.git.BranchSpec' / 
name(branchName)
             }
             steps {
+                shell("git clean -xdff")
                 shell('./pylib/cassandra-cqlsh-tests.sh $WORKSPACE')
             }
         }
@@ -561,7 +551,7 @@ testTargets.each {
         steps {
             buildDescription('', buildDescStr)
             shell("git clean -xdff ; git clone -b ${buildsBranch} 
${buildsRepo}")
-            shell("./cassandra-builds/build-scripts/cassandra-unittest.sh 
${targetName}")
+            shell("./cassandra-builds/build-scripts/cassandra-test.sh 
${targetName}")
         }
         publishers {
             archiveArtifacts {
@@ -701,7 +691,6 @@ matrixJob('Cassandra-devbranch-cqlsh-tests') {
     steps {
         buildDescription('', buildDescStr)
         shell("git clean -xdff")
-        shell('git clone -b ${DTEST_BRANCH} ${DTEST_REPO}')
         shell('./pylib/cassandra-cqlsh-tests.sh $WORKSPACE')
     }
     publishers {


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

Reply via email to