Skip to content

Commit 39cc083

Browse files
committed
start of test harness script
1 parent afa2271 commit 39cc083

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

script/test_all

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/bin/bash
2+
3+
set -e -x
4+
5+
function is_jruby() {
6+
if ruby -e 'exit RUBY_PLATFORM == "java"'; then
7+
return 0
8+
else
9+
return 1
10+
fi
11+
}
12+
13+
# Needed by Bundler 1.3: https://github.com/carlhuda/bundler/issues/2382
14+
export RUBYOPT='-rrbconfig'
15+
16+
# idea taken from: http://blog.headius.com/2010/03/jruby-startup-time-tips.html
17+
export JRUBY_OPTS='-X-C' # disable JIT since these processes are so short lived
18+
19+
# force jRuby to use client mode JVM or a compilation mode thats as close as possible,
20+
# idea taken from https://github.com/jruby/jruby/wiki/Improving-startup-time
21+
export JAVA_OPTS='-client -XX:+TieredCompilation -XX:TieredStopAtLevel=1'
22+
23+
echo "Bundling Standalone so we can run the specs w/o bundler loaded"
24+
bundle install --standalone --binstubs
25+
26+
echo "Running all..."
27+
bin/rspec spec -b --format progress --profile
28+
29+
echo
30+
echo "--------------------------------------------------------------------"
31+
echo
32+
33+
if is_jruby; then
34+
echo "Skipping one-by-one spec runs due to expensive JVM load time"
35+
else
36+
for file in `find spec -iname '*_spec.rb'`; do
37+
NO_COVERALLS=1 bin/rspec $file -b --format progress
38+
done
39+
fi
40+
41+
# Prepare RUBYOPT for scenarios that are shelling out to ruby,
42+
# and PATH for those that are using `rspec` or `rake`.
43+
# RUBYOPT="-I${PWD}/bundle -rbundler/setup" \
44+
# PATH="${PWD}/bin:$PATH" \
45+
# bin/cucumber
46+
47+
# For now, use this instead, due to a bug in bundler:
48+
# https://github.com/carlhuda/bundler/issues/2382
49+
bundle exec bin/cucumber

0 commit comments

Comments
 (0)