Repository navigation
Expand file tree
/
Copy path.travis.yml
More file actions
78 lines (74 loc) · 3.41 KB
/
Copy path.travis.yml
File metadata and controls
78 lines (74 loc) · 3.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
notifications:
irc: irc.freenode.org#vdebug
slack:
secure: BksygPSsoRfvre27w6XQN9ooKB9C1n83Bw96YurvyDHJ6BYM2Gv9fW1Sj6NHpB8MQkMaJ+9gRiBSflkP+l80t3EXAdStuI/8EM/wZu1ov6bmYT/hYQ8HnULmmPNj8uVzsX13VGEUC/YY4osWuJFM1wh61dStoF+SKrpslqWCV4w=
language: minimal
dist: xenial
matrix:
include:
- os: linux
env: DOCKER=false
- os: linux
env: DOCKER=true DISTRO=debian:9
- os: osx
language: minimal
env: DOCKER=false
before_install: |
set -e
if $DOCKER; then
docker run --rm -d --name vdebug-distro-test -v $(pwd):/travis $DISTRO tail -f /dev/null
docker ps
fi
install: |
set -e
if [[ $TRAVIS_OS_NAME = osx ]]; then
#brew update
brew install neovim
pip3 install coverage
bundle install --path vendor/bundle
elif $DOCKER; then
docker exec --env=DEBIAN_FRONTEND=noninteractive vdebug-distro-test apt-get update
# Vim, php, xdebug, bundler and coverage are needed to run the tests.
# Xvfb is needed to use the server feature of vim without a running X
# server (which is needed for some tests). The locales package is used to
# set things up inside the container.
docker exec --env=DEBIAN_FRONTEND=noninteractive vdebug-distro-test apt-get install --no-install-recommends -y vim-gtk3 php-cli php-xdebug bundler python3-coverage xvfb locales xauth
# By default the locale inside the container is latin1. For consistent
# tests we want to use utf8.
docker exec vdebug-distro-test sh -c 'echo en_US.UTF-8 UTF-8 >> /etc/locale.gen'
docker exec vdebug-distro-test sh -c 'echo LANG=en_US.UTF-8 > /etc/default/locale'
docker exec vdebug-distro-test locale-gen
docker exec vdebug-distro-test useradd -u $(id -u) -M -s /bin/bash -d /travis travis
# We are currently on docker 17.09 and the --workdir option for exec was
# only introduced in 17.12. Therefore we have to use the shell with cd.
docker exec -u travis vdebug-distro-test sh -c 'cd /travis && bundle install --path vendor/bundle'
else
sudo apt-get update
sudo apt-get install --no-install-recommends -y vim-gtk3 php-cli php-xdebug bundler python3-coverage xvfb
bundle install --path vendor/bundle
fi
script: |
set -e
if [[ $TRAVIS_OS_NAME = osx ]]; then
coverage3 run -m unittest discover
coverage3 report -m --include="python3/vdebug/*"
bundle exec rake features
bundle exec rake spec
elif $DOCKER; then
# The tests have to be run with su(1) to get the right value for $LANG.
# If docker is used to switch the user and just run sh(1) the locale setup
# from above is not picked up.
docker exec vdebug-distro-test su - travis -c 'python3-coverage run -m unittest discover'
docker exec vdebug-distro-test su - travis -c 'python3-coverage report -m --include="python3/vdebug/*"'
docker exec vdebug-distro-test su - travis -c 'xvfb-run bundle exec rake features'
# The spec/startup_spec.rb test fails randomly on travis so we execute it
# last so all other tests will run first. It seems that some of the
# failures result from the xvfb from above no releasing the display fast
# enough: https://stackoverflow.com/a/8880717
docker exec vdebug-distro-test su - travis -c 'xvfb-run --auto-servernum bundle exec rake spec'
else
python3-coverage run -m unittest discover
python3-coverage report -m --include="python3/vdebug/*"
xvfb-run bundle exec rake features
xvfb-run --auto-servernum bundle exec rake spec
fi