Skip to content

Commit 33f404c

Browse files
committed
misc(git) re-implement some changes
1 parent 33e55d9 commit 33f404c

File tree

2 files changed

+22
-32
lines changed

2 files changed

+22
-32
lines changed

.ci/run_tests.sh

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,15 @@
22
set -e
33

44
export BUSTED_ARGS="-o gtest -v --exclude-tags=flaky,ipv6"
5-
export TEST_CMD="bin/busted $BUSTED_ARGS"
65

7-
createuser --createdb kong
8-
createdb -U kong kong_tests
9-
10-
if [ "$TEST_SUITE" == "lint" ]; then
11-
make lint
12-
elif [ "$TEST_SUITE" == "unit" ]; then
13-
make test
14-
elif [ "$TEST_SUITE" == "integration" ]; then
15-
make test-integration
16-
elif [ "$TEST_SUITE" == "plugins" ]; then
17-
make test-plugins
18-
elif [ "$TEST_SUITE" == "pdk" ]; then
19-
TEST_NGINX_RANDOMIZE=1 prove -I. -j$JOBS -r t/01-pdk
20-
elif [ "$TEST_SUITE" == "old-unit" ]; then
21-
make old-test
22-
elif [ "$TEST_SUITE" == "old-integration" ]; then
23-
make old-test-integration
24-
elif [ "$TEST_SUITE" == "old-plugins" ]; then
25-
make old-test-plugins
26-
fi
6+
if [ "$KONG_TEST_DATABASE" == "postgres" ]; then
7+
export TEST_CMD="bin/busted $BUSTED_ARGS,cassandra"
8+
eval "$TEST_CMD" spec/02-integration/
9+
eval "$TEST_CMD" spec/03-plugins/
10+
eval "$TEST_CMD" spec-old-api/02-integration/
11+
eval "$TEST_CMD" spec-old-api/03-plugins/
12+
elif [ "$KONG_TEST_DATABASE" == "cassandra" ]; then
13+
export TEST_CMD="bin/busted $BUSTED_ARGS,postgres"
14+
eval "$TEST_CMD" spec/02-integration/
15+
eval "$TEST_CMD" spec/03-plugins/
16+
fi

.ci/setup_env.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,22 @@ eval `luarocks path`
108108
# -------------------------------------
109109
# Install ccm & setup Cassandra cluster
110110
# -------------------------------------
111-
if [[ "$TEST_SUITE" != "unit" ]] && [[ "$TEST_SUITE" != "lint" ]]; then
112-
echo "Installing ccm and setting up Cassandra cluster..."
113-
pip install --user PyYAML six ccm &> build.log || (cat build.log && exit 1)
114-
ccm create test -v $CASSANDRA -n 1 -d
115-
ccm start -v
116-
ccm status
111+
if [[ "$KONG_TEST_DATABASE" == "cassandra" ]]; then
112+
echo "Setting up Cassandra"
113+
docker run -d --name=cassandra --rm -p 7199:7199 -p 7000:7000 -p 9160:9160 -p 9042:9042 cassandra:$CASSANDRA
114+
grep -q 'Created default superuser role' <(docker logs -f cassandra)
117115
fi
118116

119117
# -------------------
120118
# Install Test::Nginx
121119
# -------------------
122-
echo "Installing CPAN dependencies..."
123-
chmod +x $CPAN_DOWNLOAD/cpanm
124-
cpanm --notest Test::Nginx &> build.log || (cat build.log && exit 1)
125-
cpanm --notest --local-lib=$TRAVIS_BUILD_DIR/perl5 local::lib && eval $(perl -I $TRAVIS_BUILD_DIR/perl5/lib/perl5/ -Mlocal::lib)
120+
if [[ "$TEST_SUITE" == "pdk" ]]; then
121+
echo "Installing CPAN dependencies..."
122+
chmod +x $CPAN_DOWNLOAD/cpanm
123+
cpanm --notest Test::Nginx &> build.log || (cat build.log && exit 1)
124+
cpanm --notest --local-lib=$TRAVIS_BUILD_DIR/perl5 local::lib && eval $(perl -I $TRAVIS_BUILD_DIR/perl5/lib/perl5/ -Mlocal::lib)
125+
fi
126126

127127
nginx -V
128128
resty -V
129-
luarocks --version
129+
luarocks --version

0 commit comments

Comments
 (0)