From 232e9688e4810d23c9a6420e7be7d7e9c7feadb8 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Fri, 28 Sep 2018 20:14:09 -0700 Subject: [PATCH] chore(ci) add a ScyllaDB job (wip) --- .ci/setup_env.sh | 41 +++++++++++++++++++++++++++++++++++------ .travis.yml | 20 +++++++++++--------- spec/helpers.lua | 5 +++++ util/prove_ccm.sh | 17 +++++++++++++++-- 4 files changed, 66 insertions(+), 17 deletions(-) diff --git a/.ci/setup_env.sh b/.ci/setup_env.sh index 3d04c314..ced51506 100755 --- a/.ci/setup_env.sh +++ b/.ci/setup_env.sh @@ -4,12 +4,41 @@ set -e # Install ccm # ----------- pip install --user PyYAML six -git clone https://github.com/pcmanus/ccm.git -pushd ccm - # sha of 'Release 3.0.1' - git checkout 599e2026035e334dbc2ce24117ce745641506374 - ./setup.py install --user -popd + +if [ -z "$SCYLLADB" ]; then + git clone https://github.com/pcmanus/ccm.git + pushd ccm + # sha of 'Release 3.0.1' + git checkout 599e2026035e334dbc2ce24117ce745641506374 + ./setup.py install --user + popd + +else + pip install --user -I cassandra-driver==3.7.1 psutil + + mkdir -p scylla-dir/resources + pushd scylla-dir + git clone https://github.com/scylladb/scylla.git + git clone https://github.com/scylladb/scylla-ccm.git + pushd scylla-ccm + source scylla_ccm_env.sh + popd + + git clone https://github.com/scylladb/scylla-jmx.git + pushd scylla-jmx + mvn install + popd + + git clone https://github.com/scylladb/scylla-tools-java.git + pushd scylla-tools-java + ant + popd + + ln -s $PWD/scylla-tools-java ./resources/cassandra + + export SCYLLADB_DIR=$PWD/scylla-tools-java + popd +fi if [ "$OPENRESTY_TESTS" = true ]; then #------------------------------ diff --git a/.travis.yml b/.travis.yml index dc4916aa..66101780 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,16 +25,18 @@ env: - INSTALL_CACHE=$HOME/install-cache - PERL_DIR=$HOME/perl5 matrix: - - LUA="lua 5.1" - - LUA="lua 5.2" - - LUA="luajit 2.0" - - LUA="luajit 2.1" + #- LUA="lua 5.1" + #- LUA="lua 5.2" + #- LUA="luajit 2.0" + #- LUA="luajit 2.1" + #- OPENRESTY_TESTS=true + # CASSANDRA=3.9 + #- OPENRESTY_TESTS=true + # CASSANDRA=2.2.8 + #- OPENRESTY_TESTS=true + # CASSANDRA=2.1.16 - OPENRESTY_TESTS=true - CASSANDRA=3.9 - - OPENRESTY_TESTS=true - CASSANDRA=2.2.8 - - OPENRESTY_TESTS=true - CASSANDRA=2.1.16 + SCYLLADB=2.3.0 before_install: - source .ci/setup_env.sh diff --git a/spec/helpers.lua b/spec/helpers.lua index 2cee5d09..35d2ea21 100644 --- a/spec/helpers.lua +++ b/spec/helpers.lua @@ -25,6 +25,8 @@ end local _M = { cassandra_version = os.getenv("CASSANDRA") or "3.9", + scylladb_version = os.getenv("SCYLLADB") or "", + scylladb_dir = os.getenv("SCYLLADB_DIR") or "", ssl_path = os.getenv("SSL_PATH") or "spec/fixtures/ssl" } @@ -74,6 +76,9 @@ function _M.ccm_start(opts) if opts.pwd_auth then cmd = cmd.." --pwd-auth" end + if _M.scylladb_version then + cmd = cmd.." --scylla --vnodes --install-dir='".._M.SCYLLADB_DIR.."' --debug" + end exec(cmd) end diff --git a/util/prove_ccm.sh b/util/prove_ccm.sh index c6fff26b..a25c7515 100755 --- a/util/prove_ccm.sh +++ b/util/prove_ccm.sh @@ -1,10 +1,23 @@ #!/usr/bin/env bash -CASSANDRA=${1:-3.9} +set -x +which ccm ccm stop + if [[ ! $(ccm list | grep lua_cassandra_prove) ]]; then - ccm create lua_cassandra_prove -v binary:$CASSANDRA -n 3 + if [[ -z "$SCYLLADB" ]]; then + CASSANDRA=${1:-3.9} + + ccm create lua_cassandra_prove -v binary:$CASSANDRA -n 3 + else + set -e + ccm create lua_cassandra_prove --scylla --vnodes -n 3 --install-dir=$SCYLLADB_DIR + ccm populate -n 3 + ccm start --no-wait + exit 0 + fi fi + ccm switch lua_cassandra_prove ccm start --wait-for-binary-proto