Skip to content

Commit edd229e

Browse files
committed
Run v8 tests in travis
1 parent 43605cf commit edd229e

File tree

3 files changed

+27
-53
lines changed

3 files changed

+27
-53
lines changed

.travis.yml

+11-52
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,18 @@
1-
sudo: required
2-
dist: precise
3-
group: legacy
4-
5-
env:
6-
matrix:
7-
- CI_NODE=1 RSPEC=1 RSPEC_PATTERN="spec/{controllers,helpers,lib,mailers,models}/**/*.rb"
8-
- CI_NODE=2 RSPEC=1 USERMANUAL=1 RSPEC_PATTERN="spec/{features,usermanual}/**/*.rb"
9-
- CI_NODE=3 RSPEC=1 RSPEC_PATTERN="spec/integration/{running_tests,comet,feedback,requests}/**/*.rb"
10-
- CI_NODE=4 RSPEC=1 RSPEC_PATTERN="spec/integration/{admin_usecases_spec.rb,broken_utf8_spec.rb,personal_deadlines_spec.rb,reset_password_spec.rb,stats_view_usecases_spec.rb,utf8_exercise_spec.rb}"
11-
- CI_NODE=5 RSPEC=1 RSPEC_PATTERN="spec/integration/{student_usecases_spec.rb}"
12-
- CI_NODE=6 RSPEC=1 RSPEC_PATTERN="spec/integration/{paste_usecases_spec.rb}"
13-
- CI_NODE=7 BREAKMAN=1 AUDIT=1
14-
global:
15-
- secure: XC/0F2K3EyGYrOtS9G+YddR9iW0E/eUBCe7dyjIHT3bAuWmkNLbGaWFvRaRALGCLJaQBzksEwQE47+qv4nS72kuVElHws5S3YU7PYT3A4KENe4pdycx9YitLj1eh7F4ds4LUEJ2TmjRw1+fvlsAXJ//ZW/vqzAxeZPrJPOF52tY=
16-
171
language: ruby
18-
rvm:
19-
- 2.2.0
20-
2+
sudo: required
213
git:
224
submodules: false
23-
24-
addons:
25-
apt:
26-
packages:
27-
- valgrind
28-
- check
29-
- pkg-config
30-
- gcc
31-
5+
env:
6+
global:
7+
- RAILS_ENV=test
8+
services:
9+
- docker
3210
before_install:
33-
- . ./setup-travis.sh
34-
11+
- sed -i 's/git@github.com:/https:\/\/github.com\//' .gitmodules
12+
- git submodule update --init --recursive
3513
install:
36-
- bundle install --retry=3 --jobs=3 --deployment
37-
38-
services:
39-
- postgresql
40-
14+
- docker-compose build
4115
before_script:
42-
- createuser -U postgres -s tmc
43-
- bundle exec rake db:reset
44-
16+
- docker-compose run web bin/rake db:create db:migrate RAILS_ENV=test
4517
script:
46-
- if [ ! -z "$RSPEC" ]; then ./ext/tmc-sandbox/web/webapp.rb start; fi
47-
- if [ ! -z "$RSPEC" ]; then bundle exec rake spec SPEC_OPTS="--pattern $RSPEC_PATTERN --tag ~network -f d" SANDBOX_HOST=127.0.0.1 SANDBOX_PORT=3001; fi
48-
- if [ ! -z "$BREAKMAN" ]; then bundle --binstubs && ./bin/brakeman ; fi
49-
- if [ ! -z "$AUDIT" ]; then bundle exec bundle-audit update && bundle exec bundle-audit check ; fi
50-
51-
after_success:
52-
- if [ ! -z "$USERMANUAL" ]; then ./.travis-update-usermanual.sh; fi
53-
54-
after_failure:
55-
- cat ext/tmc-sandbox/web/log/*
56-
57-
notifications:
58-
slack:
59-
secure: YCiWybZYBoJ2JDjpPp5Idf4OvqScay5WfEuQMdvee42kgsSVolew6V5YUx41E29Of+2xAcQ+be5XImzO7SlTYuaGD6hf0JZvjjxO3gpycCljNSvDgFnBF9s4WuUQ31LozI6eQqo/9c5zUFxW9MGeeaRUWvurlW0rRHM3UKokAQk=
18+
- docker-compose run web bin/spec_v8

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
- ./pg-data:/var/lib/postgresql
77
web:
88
build: .
9-
entrypoint: ./dev-entry.sh
9+
entrypoint: ./docker-wait-for-db.sh
1010
volumes:
1111
- .:/app
1212
ports:

docker-wait-for-db.sh

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
set -eu
3+
4+
cmd=$*
5+
6+
echo "Waiting for postgres..."
7+
until psql -h db -p 5432 -U "postgres" -c '\l' 2> /dev/null; do
8+
>&2 echo -n "."
9+
sleep 1
10+
done
11+
echo ""
12+
if [ ! -z "$cmd" ]; then
13+
echo Running "$cmd"
14+
exec $cmd
15+
fi

0 commit comments

Comments
 (0)