Skip to content

Commit 8510d5f

Browse files
committed
Merge pull request #128 from rspec/make-build-runnable-alone
Improve experience of running `script/run_build` locally.
2 parents 88bbf3d + 5b7fced commit 8510d5f

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

travis/script/functions.sh

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,22 @@ function run_specs_one_by_one {
6464

6565
function run_spec_suite_for {
6666
if [ ! -f ../$1/$SPECS_HAVE_RUN_FILE ]; then # don't rerun specs that have already run
67-
echo "Running specs for $1"
68-
pushd ../$1
69-
unset BUNDLE_GEMFILE
70-
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
71-
travis_retry eval "bundle install $bundle_install_flags"
72-
run_specs_and_record_done
73-
popd
67+
if [ -d ../$1 ]; then
68+
echo "Running specs for $1"
69+
pushd ../$1
70+
unset BUNDLE_GEMFILE
71+
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
72+
travis_retry eval "bundle install $bundle_install_flags"
73+
run_specs_and_record_done
74+
popd
75+
else
76+
echo ""
77+
echo "WARNING: The ../$1 directory does not exist. Usually the"
78+
echo "travis build cds into that directory and run the specs to"
79+
echo "ensure the specs still pass with your latest changes, but"
80+
echo "we are going to skip that step."
81+
echo ""
82+
fi;
7483
fi;
7584
}
7685

@@ -116,7 +125,6 @@ function check_style_and_lint {
116125
}
117126

118127
function run_all_spec_suites {
119-
fold "one-by-one specs" run_specs_one_by_one
120128
fold "rspec-core specs" run_spec_suite_for "rspec-core"
121129
fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations"
122130
fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks"

travis/script/run_build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ if style_and_lint_enforced; then
1919
fi
2020

2121
if is_mri; then
22+
fold "one-by-one specs" run_specs_one_by_one
2223
run_all_spec_suites
2324
else
2425
echo "Skipping the rest of the build on non-MRI rubies"

travis/script/travis_functions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ fold() {
4747
if [ -n "$TRAVIS" ]; then
4848
printf "travis_fold:start:%s\r\e[0m" "$name"
4949
travis_time_start
50+
else
51+
echo "============= Starting $name ==============="
5052
fi
5153

5254
"$@"
@@ -57,6 +59,8 @@ fold() {
5759
if [ "$status" -eq 0 ]; then
5860
if [ -n "$TRAVIS" ]; then
5961
printf "travis_fold:end:%s\r\e[0m" "$name"
62+
else
63+
echo "============= Ending $name ==============="
6064
fi
6165
else
6266
STATUS="$status"

0 commit comments

Comments
 (0)