[cassandra-builds] branch master updated: Jenkins tests to use testclasslist where possible (like CircleCI) (CASSANDRA-15651)

2020-03-28 Thread mck
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 571b2ed  Jenkins tests to use testclasslist where possible (like 
CircleCI) (CASSANDRA-15651)
571b2ed is described below

commit 571b2ed35655e6bc13e03aa7784729b952989eb6
Author: mck 
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..000
--- 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 000..be8e5be
--- /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.classlistprefix=burn 
-Dtest.timeout=$(_timeout_for "test.burn.timeout") -Dtest.classlistfile=<( 
_list_tests "burn" ) || echo "failed $target"
+  ;;
+"long-test")
+  ant testclasslist -Dtest.classlistprefix=long 
-Dtest.timeout=$(_timeout_for "test.long.timeout") -Dtest.classlistfile=<( 
_list_tests "long" ) || echo "failed $target"
+  ;;
+"jvm-dtest")
+  ant testclasslist -Dtest.classlistprefix=distributed 
-Dtest.timeout=$(_timeout_for "test.distributed.timeout") 
-Dtest.classlistfile=<( _list_distributed_tests_no_upgrade ) || 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..000
--- 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
-#
-
-

[cassandra-builds] branch master updated: Jenkins tests to use testclasslist where possible (like CircleCI) (CASSANDRA-15651)

2020-03-25 Thread mck
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 
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..000
--- 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 000..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..000
--- 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