Merge pull request #1358 from ZyX-I/container-based-infrastructure

Switch to container-based infrastructure
This commit is contained in:
Nikolai Aleksandrovich Pavlov 2015-05-10 23:10:50 +03:00
commit bac1c0162d
4 changed files with 61 additions and 15 deletions

View File

@ -1,3 +1,19 @@
sudo: false
cache:
directories:
- $HOME/.cache/pip
- tests/bot-ci
addons:
apt:
packages:
- libssl1.0.0
- zsh
# - tcsh
# - mksh
# - busybox
# - rc
# - socat
- bc
language: python
install: tests/install.sh
script: tests/test.sh

View File

@ -1,11 +1,32 @@
#!/bin/bash
git clone --depth=1 git://github.com/powerline/bot-ci tests/bot-ci
git clone --depth=1 git://github.com/powerline/deps tests/bot-ci/deps
set -e
remote_master_hex() {
local url="$1"
git ls-remote "$url" refs/heads/master | cut -f1
}
checkout_cached_dir() {
local url="$1"
local target="$2"
if ! test -e "$target/.version" || \
test "$(cat "$target/.version")" != "$(remote_master_hex "$url")" ; then
rm -rf "$target"
fi
if ! test -d "$target" ; then
git clone --depth=1 "$url" "$target"
mv "$target"/.git/refs/heads/master .version
rm -rf "$target"/.git
fi
}
checkout_cached_dir git://github.com/powerline/bot-ci tests/bot-ci
checkout_cached_dir git://github.com/powerline/deps tests/bot-ci/deps
. tests/bot-ci/scripts/common/main.sh
sudo apt-get install -qq libssl1.0.0
sudo apt-get install -qq zsh tcsh mksh busybox socat realpath bc rc tmux
mkdir -p "$HOME/opt"
if test -n "$USE_UCS2_PYTHON" ; then
pip install virtualenvwrapper
@ -13,9 +34,9 @@ if test -n "$USE_UCS2_PYTHON" ; then
. virtualenvwrapper.sh
set -e
archive="${PWD:-$(pwd)}/tests/bot-ci/deps/cpython-ucs2/cpython-ucs2-${UCS2_PYTHON_VARIANT}.tar.gz"
sudo sh -c "cd /opt && tar xzf $archive"
PYTHON="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/bin/python$UCS2_PYTHON_VARIANT"
export LD_LIBRARY_PATH="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
sh -c "cd $HOME/opt && tar xzf $archive"
PYTHON="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/bin/python$UCS2_PYTHON_VARIANT"
export LD_LIBRARY_PATH="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}${LD_LIBRARY_PATH}"
set +e
mkvirtualenv -p "$PYTHON" cpython-ucs2-$UCS2_PYTHON_VARIANT
set -e
@ -37,11 +58,11 @@ else
fi
if test "$PYTHON_IMPLEMENTATION" = "CPython" ; then
archive="${PWD:-$(pwd)}/tests/bot-ci/deps/zpython/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}.tar.gz"
sudo sh -c "cd /opt && tar xzf $archive"
sh -c "cd $HOME/opt && tar xzf $archive"
fi
archive="${PWD:-$(pwd)}/tests/bot-ci/deps/fish/fish.tar.gz"
sudo sh -c "cd /opt && tar xzf $archive"
sh -c "cd $HOME/opt && tar xzf $archive"
mkdir tests/vim-plugins
@ -52,6 +73,4 @@ for archive in "$ROOT"/tests/bot-ci/deps/vim-plugins/*.tar.gz ; do
)
done
# Travis has too outdated fish. It cannot be used for tests.
# sudo apt-get install fish
true

View File

@ -6,7 +6,7 @@ if test -z "$VIM" ; then
if test -n "$USE_UCS2_PYTHON" ; then
NEW_VIM="$ROOT/tests/bot-ci/deps/vim/tip-$UCS2_PYTHON_VARIANT-ucs2-double/vim"
OLD_VIM="$ROOT/tests/bot-ci/deps/vim/v7-0-112-$UCS2_PYTHON_VARIANT-ucs2/vim"
opt_dir="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT"
opt_dir="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT"
main_path="$opt_dir/lib/python$UCS2_PYTHON_VARIANT"
site_path="$main_path/site-packages"
venv_main_path="$VIRTUAL_ENV/lib/python$UCS2_PYTHON_VARIANT"

View File

@ -9,14 +9,19 @@ export USER HOME
FAILED=0
if test "$TRAVIS" = true ; then
export PATH="/opt/fish/bin:${PATH}"
export PATH="$HOME/opt/fish/bin:${PATH}"
export PATH="$PWD/tests/bot-ci/deps/rc:$PATH"
export PATH="$PWD/tests/bot-ci/deps/mksh:$PATH"
export PATH="$PWD/tests/bot-ci/deps/busybox:$PATH"
export PATH="$PWD/tests/bot-ci/deps/tcsh:$PATH"
export PATH="$PWD/tests/bot-ci/deps/socat:$PATH"
if test "$PYTHON_IMPLEMENTATION" = "CPython" ; then
export PATH="/opt/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}/bin:${PATH}"
export PATH="$HOME/opt/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}/bin:${PATH}"
fi
if test -n "$USE_UCS2_PYTHON" ; then
export LD_LIBRARY_PATH="/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
set +e
. virtualenvwrapper.sh
workon cpython-ucs2-$UCS2_PYTHON_VARIANT
@ -24,6 +29,12 @@ if test "$TRAVIS" = true ; then
fi
fi
if ! which realpath ; then
realpath() {
$PYTHON -c 'import os, sys; print(os.path.realpath(sys.argv[1]))' "$1"
}
fi
export PYTHON="${PYTHON:=python}"
export PYTHONPATH="${PYTHONPATH}${PYTHONPATH:+:}`realpath .`"
for script in tests/run_*_tests.sh ; do