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 2020/03/26 12:23:46 UTC

[cassandra-builds] branch master updated: Revert "Jenkins tests to use testclasslist where possible (like CircleCI) (CASSANDRA-15651)" This reverts commit 399a8a0c87489aea236b240ca0edaf781c1c4966.

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 08e94f6  Revert "Jenkins tests to use testclasslist where possible (like CircleCI) (CASSANDRA-15651)"  This reverts commit 399a8a0c87489aea236b240ca0edaf781c1c4966.
08e94f6 is described below

commit 08e94f6d7dad4b1e24033cb70b31880eda528b63
Author: mck <mc...@apache.org>
AuthorDate: Thu Mar 26 13:22:41 2020 +0100

    Revert "Jenkins tests to use testclasslist where possible (like CircleCI) (CASSANDRA-15651)"
     This reverts commit 399a8a0c87489aea236b240ca0edaf781c1c4966.
---
 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, 83 insertions(+), 64 deletions(-)

diff --git a/build-scripts/cassandra-jvm-dtest.sh b/build-scripts/cassandra-jvm-dtest.sh
new file mode 100755
index 0000000..0b41323
--- /dev/null
+++ b/build-scripts/cassandra-jvm-dtest.sh
@@ -0,0 +1,32 @@
+#!/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
deleted file mode 100755
index bdb255f..0000000
--- a/build-scripts/cassandra-test.sh
+++ /dev/null
@@ -1,60 +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_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
new file mode 100755
index 0000000..0c91c26
--- /dev/null
+++ b/build-scripts/cassandra-unittest.sh
@@ -0,0 +1,36 @@
+#!/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 294d966..699748e 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', 'test-jvm-dtest-forking']
+def testTargets = ['test', 'test-burn', 'test-cdc', 'test-compression', 'stress-test', 'fqltool-test', 'long-test']
 if(binding.hasVariable("CASSANDRA_ANT_TEST_TARGETS")) {
     testTargets = "${CASSANDRA_ANT_TEST_TARGETS}".split(",")
 }
@@ -367,12 +367,23 @@ cassandraBranches.each {
                     node / scm / branches / 'hudson.plugins.git.BranchSpec' / name(branchName)
                 }
                 steps {
-                    shell("./cassandra-builds/build-scripts/cassandra-test.sh ${targetName}")
+                    shell("./cassandra-builds/build-scripts/cassandra-unittest.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
      */
@@ -412,7 +423,6 @@ cassandraBranches.each {
                 node / scm / branches / 'hudson.plugins.git.BranchSpec' / name(branchName)
             }
             steps {
-                shell("git clean -xdff")
                 shell('./pylib/cassandra-cqlsh-tests.sh $WORKSPACE')
             }
         }
@@ -551,7 +561,7 @@ testTargets.each {
         steps {
             buildDescription('', buildDescStr)
             shell("git clean -xdff ; git clone -b ${buildsBranch} ${buildsRepo}")
-            shell("./cassandra-builds/build-scripts/cassandra-test.sh ${targetName}")
+            shell("./cassandra-builds/build-scripts/cassandra-unittest.sh ${targetName}")
         }
         publishers {
             archiveArtifacts {
@@ -691,6 +701,7 @@ 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-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org