-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from thibaultCha/feat/rewrite
feat(rewrite)
- Loading branch information
Showing
114 changed files
with
7,703 additions
and
3,072 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
local ansicolors = require 'ansicolors' | ||
|
||
return function(options) | ||
local handler = require 'busted.outputHandlers.utfTerminal'(options) | ||
|
||
handler.fileStart = function(file) | ||
io.write('\n' .. ansicolors('%{cyan}' .. file.name) .. ':') | ||
end | ||
|
||
handler.testStart = function(element, parent, status, debug) | ||
io.write('\n ' .. handler.getFullName(element) .. ' ... ') | ||
io.flush() | ||
end | ||
|
||
local busted = require 'busted' | ||
|
||
busted.subscribe({ 'file', 'start' }, handler.fileStart) | ||
busted.subscribe({ 'test', 'start' }, handler.testStart) | ||
|
||
return handler | ||
end |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ "$OPENRESTY_TESTS" != "yes" ]; then | ||
busted -v --coverage -o .ci/busted_print.lua | ||
make lint | ||
luacov-coveralls -i cassandra | ||
else | ||
prove -l t | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
arr=(${HOSTS//,/ }) | ||
|
||
pip install --user PyYAML six | ||
git clone https://github.com/pcmanus/ccm.git | ||
pushd ccm | ||
./setup.py install --user | ||
popd | ||
ccm create test -v binary:$CASSANDRA_VERSION -n ${#arr[@]} -d | ||
ccm start -v | ||
ccm status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/bin/bash | ||
|
||
# A script for setting up environment for travis-ci testing. | ||
# Sets up Lua and Luarocks. | ||
# LUA must be "lua5.1", "lua5.2" or "luajit". | ||
# luajit2.0 - master v2.0 | ||
# luajit2.1 - master v2.1 | ||
|
||
LUAJIT="no" | ||
|
||
source .ci/platform.sh | ||
|
||
############ | ||
# Lua/LuaJIT | ||
############ | ||
|
||
if [ "$LUA" == "luajit" ]; then | ||
LUAJIT="yes" | ||
LUA="luajit-2.0" | ||
elif [ "$LUA" == "luajit-2.0" ]; then | ||
LUAJIT="yes" | ||
elif [ "$LUA" == "luajit-2.1" ]; then | ||
LUAJIT="yes" | ||
fi | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
mkdir -p $LUAJIT_DIR | ||
|
||
# If cache is empty, download and compile | ||
if [ ! "$(ls -A $LUAJIT_DIR)" ]; then | ||
git clone http://luajit.org/git/luajit-2.0.git | ||
pushd luajit-2.0 | ||
|
||
if [ "$LUA" == "luajit-2.0" ]; then | ||
git checkout v2.0.4 | ||
elif [ "$LUA" == "luajit-2.1" ]; then | ||
git checkout v2.1 | ||
fi | ||
|
||
make | ||
make install PREFIX=$LUAJIT_DIR | ||
popd | ||
|
||
if [ "$LUA" == "luajit-2.1" ]; then | ||
ln -sf $LUAJIT_DIR/bin/luajit-2.1.0-beta1 $LUAJIT_DIR/bin/luajit | ||
fi | ||
|
||
ln -sf $LUAJIT_DIR/bin/luajit $LUAJIT_DIR/bin/lua | ||
fi | ||
|
||
LUA_INCLUDE="$LUAJIT_DIR/include/$LUA" | ||
else | ||
if [ "$LUA" == "lua5.1" ]; then | ||
curl http://www.lua.org/ftp/lua-5.1.5.tar.gz | tar xz | ||
pushd lua-5.1.5 | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
curl http://www.lua.org/ftp/lua-5.2.3.tar.gz | tar xz | ||
pushd lua-5.2.3 | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
curl http://www.lua.org/ftp/lua-5.3.0.tar.gz | tar xz | ||
pushd lua-5.3.0 | ||
fi | ||
|
||
make $PLATFORM | ||
make install INSTALL_TOP=$LUA_DIR | ||
popd | ||
|
||
LUA_INCLUDE="$LUA_DIR/include" | ||
fi | ||
|
||
########## | ||
# Luarocks | ||
########## | ||
|
||
LUAROCKS_BASE=luarocks-$LUAROCKS_VERSION | ||
CONFIGURE_FLAGS="" | ||
|
||
git clone https://github.com/keplerproject/luarocks.git $LUAROCKS_BASE | ||
|
||
pushd $LUAROCKS_BASE | ||
git checkout v$LUAROCKS_VERSION | ||
|
||
if [ "$LUAJIT" == "yes" ]; then | ||
LUA_DIR=$LUAJIT_DIR | ||
elif [ "$LUA" == "lua5.1" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.1" | ||
elif [ "$LUA" == "lua5.2" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.2" | ||
elif [ "$LUA" == "lua5.3" ]; then | ||
CONFIGURE_FLAGS=$CONFIGURE_FLAGS" --lua-version=5.3" | ||
fi | ||
|
||
./configure \ | ||
--prefix=$LUAROCKS_DIR \ | ||
--with-lua-bin=$LUA_DIR/bin \ | ||
--with-lua-include=$LUA_INCLUDE \ | ||
$CONFIGURE_FLAGS | ||
|
||
make build && make install | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/bin/bash | ||
|
||
if [ "$OPENRESTY_TESTS" != "yes" ]; then | ||
exit | ||
echo "Exiting, no openresty tests" | ||
fi | ||
|
||
set -e | ||
|
||
mkdir -p $OPENRESTY_DIR | ||
|
||
if [ ! "$(ls -A $OPENRESTY_DIR)" ]; then | ||
OPENRESTY_BASE=ngx_openresty-$OPENRESTY_VERSION | ||
|
||
curl https://openresty.org/download/$OPENRESTY_BASE.tar.gz | tar xz | ||
pushd $OPENRESTY_BASE | ||
|
||
./configure \ | ||
--prefix=$OPENRESTY_DIR \ | ||
--with-luajit=$LUAJIT_DIR \ | ||
--without-http_coolkit_module \ | ||
--without-lua_resty_dns \ | ||
--without-lua_resty_lrucache \ | ||
--without-lua_resty_upstream_healthcheck \ | ||
--without-lua_resty_websocket \ | ||
--without-lua_resty_upload \ | ||
--without-lua_resty_string \ | ||
--without-lua_resty_mysql \ | ||
--without-lua_resty_redis \ | ||
--without-http_redis_module \ | ||
--without-http_redis2_module \ | ||
--without-lua_redis_parser | ||
|
||
make | ||
make install | ||
popd | ||
fi | ||
|
||
git clone git://github.com/travis-perl/helpers travis-perl-helpers | ||
pushd travis-perl-helpers | ||
source ./init | ||
popd | ||
cpan-install Test::Nginx::Socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nginx_tmp | ||
t/servroot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
unused_args = false | ||
globals = {"ngx", "describe", "setup", "teardown", "it", "pending"} | ||
redefined = false | ||
globals = {"ngx", "describe", "setup", "teardown", "it", "pending", "before_each", "after_each", "finally", "spy", "mock"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,50 @@ | ||
language: erlang | ||
|
||
language: perl | ||
perl: "5.18" | ||
sudo: false | ||
notifications: | ||
email: false | ||
addons: | ||
apt: | ||
packages: | ||
- libreadline-dev | ||
- libncurses5-dev | ||
- libpcre3-dev | ||
- libssl-dev | ||
- build-essential | ||
env: | ||
global: | ||
- LUAROCKS=2.2.2 | ||
- CASSANDRA_VERSION=2.1.8 | ||
- CASSANDRA_VERSION=2.1.9 | ||
- LUAROCKS_VERSION=2.2.2 | ||
- OPENRESTY_VERSION=1.9.3.1 | ||
- LUA_DIR=$HOME/lua | ||
- LUAJIT_DIR=$HOME/luajit | ||
- LUAROCKS_DIR=$HOME/luarocks | ||
- OPENRESTY_DIR=$HOME/openresty | ||
- "HOSTS=127.0.0.1,127.0.0.2,127.0.0.3" | ||
- SMALL_LOAD=true | ||
matrix: | ||
- LUA=lua5.1 | ||
- LUA=lua5.2 | ||
- LUA=lua5.3 | ||
- LUA=luajit | ||
|
||
- LUA=luajit-2.1 | ||
- OPENRESTY_TESTS: "yes" | ||
LUA: "luajit-2.1" | ||
before_install: | ||
- bash .travis/setup_lua.sh | ||
- bash .travis/setup_cassandra.sh | ||
- sudo luarocks install luasocket | ||
- sudo make dev | ||
|
||
script: | ||
- "busted -v --coverage" | ||
- "make lint" | ||
|
||
after_success: "luacov-coveralls -i cassandra" | ||
|
||
notifications: | ||
email: false | ||
- bash .ci/setup_cassandra.sh | ||
- bash .ci/setup_lua.sh | ||
- bash .ci/setup_openresty.sh | ||
- export PATH=$LUA_DIR/src:$LUAJIT_DIR/bin:$LUAROCKS_DIR/bin:$OPENRESTY_DIR/nginx/sbin:$PATH | ||
- export LUA_PATH="./?.lua;$LUAROCKS_DIR/share/lua/5.1/?.lua;$LUAROCKS_DIR/share/lua/5.1/?/init.lua;$LUAROCKS_DIR/lib/lua/5.1/?.lua;$LUA_PATH" | ||
- export LUA_CPATH="$LUAROCKS_DIR/lib/lua/5.1/?.so;$LUA_CPATH" | ||
install: | ||
- make dev | ||
- luarocks install ansicolors | ||
script: .ci/run_tests.sh | ||
cache: | ||
cpan: true | ||
apt: true | ||
pip: true | ||
directories: | ||
- $LUAJIT_DIR | ||
- $OPENRESTY_DIR | ||
- $HOME/.ccm/repository/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.