Skip to content

Commit

Permalink
Showing 2 changed files with 29 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@ env:
- JT='test specs :library'
- JT='test specs :truffle'
- JT='test integration fast'
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m"
- JT='test integration long' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true

matrix:
include:
49 changes: 28 additions & 21 deletions test/truffle/integration/rails.sh
Original file line number Diff line number Diff line change
@@ -8,31 +8,38 @@ JRUBY_BIN=../../../../bin
JRUBY=$JRUBY_BIN/jruby
JTR=$JRUBY_BIN/jruby+truffle

$JRUBY_BIN/gem install bundler
if [ -n "$CI" -a -z "$HAS_REDIS" ]
then
echo "No Redis. Skipping rails test."

$JTR setup
$JTR run -r rubygems -- bin/rails server &
serverpid=$!
url=http://localhost:3000
else

while ! curl -s "$url/people.json";
do
echo -n .
sleep 1
done
$JRUBY_BIN/gem install bundler

This comment has been minimized.

Copy link
@chrisseaton

chrisseaton Apr 11, 2016

Contributor

I think this might need to be $JRUBY_BIN/jruby $JRUBY_BIN/gem otherwise the gem command shell script will try to use a system JRuby. That could be anything on some of our CI systems.

This comment has been minimized.

Copy link
@eregon

eregon Apr 11, 2016

Member

Or alternatively $JRUBY_BIN/jruby -S gem install ...

This comment has been minimized.

Copy link
@pitr-ch

pitr-ch Apr 11, 2016

Author Member

Thanks, updating. I am not sure about -S, it uses PATH to look up the script, doesn't it?

This comment has been minimized.

Copy link
@eregon

eregon Apr 11, 2016

Member

That's what MRI's -h says but I do not believe it. It can be used to locate gem binaries for instance.
bin/gem seems simpler here.


echo Server is up
$JTR setup
$JTR run -r rubygems -- bin/rails server &
serverpid=$!
url=http://localhost:3000

set -x
curl -s -X "DELETE" "$url/people/destroy_all.json"
test "$(curl -s "$url/people.json")" = '[]'
curl -s --data 'name=Anybody&email=ab@example.com' "$url/people.json"
echo "$(curl -s "$url/people.json")" | grep '"name":"Anybody","email":"ab@example.com"'
curl -s -X "DELETE" "$url/people/destroy_all.json"
while ! curl -s "$url/people.json";
do
echo -n .
sleep 1
done

kill %1
kill $(cat tmp/pids/server.pid)
echo Server is up

set +x
set +e
set -x
curl -s -X "DELETE" "$url/people/destroy_all.json"
test "$(curl -s "$url/people.json")" = '[]'
curl -s --data 'name=Anybody&email=ab@example.com' "$url/people.json"
echo "$(curl -s "$url/people.json")" | grep '"name":"Anybody","email":"ab@example.com"'
curl -s -X "DELETE" "$url/people/destroy_all.json"

kill %1
kill $(cat tmp/pids/server.pid)

set +x
set +e

fi

0 comments on commit 7d4d142

Please sign in to comment.