Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up builds on travis #384

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
02cd86f
Split long docker commands
lucc Oct 5, 2018
2f2b6a9
Remove travis gem from requirements
lucc Oct 5, 2018
8ea61e7
Install bundler and coverage with apt
lucc Oct 5, 2018
2abe482
Local bundler install
lucc Oct 6, 2018
10d5a5c
Do not allocate a tty for docker commands
lucc Oct 6, 2018
808cbb2
Separate flaky tests from other tests
lucc Oct 6, 2018
3905978
Clean up locale setup and usage
lucc Oct 6, 2018
74b2387
Fix startup of xvfb if display is not free
lucc Oct 6, 2018
86eeb7d
Run on bare ubuntu instead of docker and add job for osx
lucc Nov 30, 2018
923568e
reorder and fix yaml
lucc Nov 30, 2018
73dd5f5
Add newlines
lucc Nov 30, 2018
d992c67
fix
lucc Nov 30, 2018
6d98301
add sudo
lucc Nov 30, 2018
30a6a1e
Use newer python
lucc Nov 30, 2018
ac04b2c
Remove lang from osx
lucc Nov 30, 2018
5536caa
Switch to the minimal image
lucc Nov 30, 2018
732e406
debug : show versions on osx
lucc Nov 30, 2018
4a6efda
osx: install coverage
lucc Nov 30, 2018
3d479e2
remove which
lucc Nov 30, 2018
20b5eb8
osx fix coverage call
lucc Nov 30, 2018
5282a65
improve ubuntu install
lucc Nov 30, 2018
c8b9d7b
osx bundle install
lucc Nov 30, 2018
5376dfb
fix strange byte
lucc Nov 30, 2018
35566a6
osx insall vim with client server
lucc Nov 30, 2018
60f4395
CHeck vim version
lucc Nov 30, 2018
ae24634
Install all vims on osx
lucc Nov 30, 2018
bd84162
remove plain vim
lucc Nov 30, 2018
cfeff1e
remove plain vim
lucc Nov 30, 2018
435962a
remove neovim
lucc Nov 30, 2018
77809b5
replace macvim with neovim
lucc Nov 30, 2018
7fa6344
remove version checks
lucc Nov 30, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 74 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,77 @@ notifications:
irc: irc.freenode.org#vdebug
slack:
secure: BksygPSsoRfvre27w6XQN9ooKB9C1n83Bw96YurvyDHJ6BYM2Gv9fW1Sj6NHpB8MQkMaJ+9gRiBSflkP+l80t3EXAdStuI/8EM/wZu1ov6bmYT/hYQ8HnULmmPNj8uVzsX13VGEUC/YY4osWuJFM1wh61dStoF+SKrpslqWCV4w=
language: python
env:
matrix:
- DISTRO: 'ubuntu:16.04'
- DISTRO: 'debian:9'
before_install:
- docker run --rm -d --name vdebug-distro-test -v $(pwd):/travis $DISTRO tail -f /dev/null
- docker ps
install:
- |-
docker exec -t vdebug-distro-test bash -c "apt-get update && apt-get install -y sudo vim-gtk3 xvfb python3 python3-pip ruby-dev gcc make automake libtool php-cli php-xdebug locales && gem install bundler && pip3 install coverage && echo 'en_US.UTF-8 UTF-8' >> /etc/locale.gen && locale-gen && echo 'LANG=en_US.UTF-8' > /etc/default/locale && useradd -u $(id -u) -M -s /bin/bash -d /travis travis && echo '%travis ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/travis"
- docker exec -t vdebug-distro-test su - travis -c "bundle install"
script:
- docker exec -t vdebug-distro-test su - travis -c "coverage run -m unittest discover && coverage report -m --include='python3/vdebug/*'"
- docker exec -t vdebug-distro-test su - travis -c "xvfb-run bundle exec rake spec features"

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
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ gem 'rake', '~> 10.0.4'
gem 'rspec', '~> 2.13.0'
gem 'vimrunner', '~> 0.3.0'
gem 'cucumber'
gem 'travis'