From 3dc9a0ec86bbc2b032b29bf74857e5389845eb85 Mon Sep 17 00:00:00 2001 From: Thibault Charbonnier Date: Fri, 7 Oct 2016 18:56:54 +0200 Subject: [PATCH] chore(ci) test under C* 3.9 and use dev lua-cassandra --- .ci/setup_env.sh | 2 ++ .travis.yml | 10 ++++++---- kong-0.9.3-0.rockspec | 2 +- kong/dao/db/cassandra.lua | 9 ++++++++- spec/kong_tests.conf | 1 + 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.ci/setup_env.sh b/.ci/setup_env.sh index 7be06febc178..993b6769dbd3 100755 --- a/.ci/setup_env.sh +++ b/.ci/setup_env.sh @@ -90,6 +90,8 @@ export PATH=$PATH:$OPENRESTY_INSTALL/nginx/sbin:$OPENRESTY_INSTALL/bin:$LUAROCKS eval `luarocks path` +luarocks purge --tree=$LUAROCKS_INSTALL + # ------------------------------------- # Install ccm & setup Cassandra cluster # ------------------------------------- diff --git a/.travis.yml b/.travis.yml index 996b0bb6c99b..62d073b78d34 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,9 @@ sudo: false -language: c +language: java -compiler: - - gcc +jdk: + - oraclejdk8 notifications: email: false @@ -22,7 +22,7 @@ env: - SERF=0.7.0 - LUAROCKS=2.4.0 - OPENSSL=1.0.2h - - CASSANDRA=2.2.7 + - CASSANDRA=2.2.8 - OPENRESTY_BASE=1.9.15.1 - OPENRESTY_LATEST=1.11.2.1 - OPENRESTY=$OPENRESTY_BASE @@ -37,8 +37,10 @@ env: OPENRESTY=$OPENRESTY_BASE - TEST_SUITE=integration OPENRESTY=$OPENRESTY_LATEST + CASSANDRA=3.9 - TEST_SUITE=plugins OPENRESTY=$OPENRESTY_LATEST + CASSANDRA=3.9 before_install: - source .ci/setup_env.sh diff --git a/kong-0.9.3-0.rockspec b/kong-0.9.3-0.rockspec index 44a1f5892c93..a94a426b2ad0 100644 --- a/kong-0.9.3-0.rockspec +++ b/kong-0.9.3-0.rockspec @@ -20,7 +20,7 @@ dependencies = { "multipart == 0.4", "version == 0.2", "lapis == 1.5.1", - "lua-cassandra == 1.0.0", + "lua-cassandra == dev-0", "pgmoon-mashape == 2.0.1", "luatz == 0.3", "lua_system_constants == 0.1.1", diff --git a/kong/dao/db/cassandra.lua b/kong/dao/db/cassandra.lua index 3a4535a74117..72997ded6091 100644 --- a/kong/dao/db/cassandra.lua +++ b/kong/dao/db/cassandra.lua @@ -44,9 +44,16 @@ function _M.new(kong_config) connect_timeout = kong_config.cassandra_timeout, read_timeout = kong_config.cassandra_timeout, ssl = kong_config.cassandra_ssl, - verify = kong_config.cassandra_ssl_verify + verify = kong_config.cassandra_ssl_verify, + lock_timeout = 30, + silent = ngx.IS_CLI } + if ngx.IS_CLI then + local policy = require("resty.cassandra.policies.reconnection.const") + cluster_options.reconn_policy = policy.new(100) + end + -- -- cluster options from Kong config -- diff --git a/spec/kong_tests.conf b/spec/kong_tests.conf index 060c5cff2190..52d4c1944c87 100644 --- a/spec/kong_tests.conf +++ b/spec/kong_tests.conf @@ -15,6 +15,7 @@ pg_host = 127.0.0.1 pg_port = 5432 pg_database = kong_tests cassandra_keyspace = kong_tests +cassandra_timeout = 10000 anonymous_reports = off lua_package_path = ?/init.lua;./kong/?.lua