Skip to content

Improve experience of running script/run_build locally. #128

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

Merged
merged 1 commit into from
Jul 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 16 additions & 8 deletions travis/script/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,22 @@ function run_specs_one_by_one {

function run_spec_suite_for {
if [ ! -f ../$1/$SPECS_HAVE_RUN_FILE ]; then # don't rerun specs that have already run
echo "Running specs for $1"
pushd ../$1
unset BUNDLE_GEMFILE
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
travis_retry eval "bundle install $bundle_install_flags"
run_specs_and_record_done
popd
if [ -d ../$1 ]; then
echo "Running specs for $1"
pushd ../$1
unset BUNDLE_GEMFILE
bundle_install_flags=`cat .travis.yml | grep bundler_args | tr -d '"' | grep -o " .*"`
travis_retry eval "bundle install $bundle_install_flags"
run_specs_and_record_done
popd
else
echo ""
echo "WARNING: The ../$1 directory does not exist. Usually the"
echo "travis build cds into that directory and run the specs to"
echo "ensure the specs still pass with your latest changes, but"
echo "we are going to skip that step."
echo ""
fi;
fi;
}

Expand Down Expand Up @@ -116,7 +125,6 @@ function check_style_and_lint {
}

function run_all_spec_suites {
fold "one-by-one specs" run_specs_one_by_one
fold "rspec-core specs" run_spec_suite_for "rspec-core"
fold "rspec-expectations specs" run_spec_suite_for "rspec-expectations"
fold "rspec-mocks specs" run_spec_suite_for "rspec-mocks"
Expand Down
1 change: 1 addition & 0 deletions travis/script/run_build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ if style_and_lint_enforced; then
fi

if is_mri; then
fold "one-by-one specs" run_specs_one_by_one
run_all_spec_suites
else
echo "Skipping the rest of the build on non-MRI rubies"
Expand Down
4 changes: 4 additions & 0 deletions travis/script/travis_functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ fold() {
if [ -n "$TRAVIS" ]; then
printf "travis_fold:start:%s\r\e[0m" "$name"
travis_time_start
else
echo "============= Starting $name ==============="
fi

"$@"
Expand All @@ -57,6 +59,8 @@ fold() {
if [ "$status" -eq 0 ]; then
if [ -n "$TRAVIS" ]; then
printf "travis_fold:end:%s\r\e[0m" "$name"
else
echo "============= Ending $name ==============="
fi
else
STATUS="$status"
Expand Down