Skip to content

Instantly share code, notes, and snippets.

@appplemac
Last active August 29, 2015 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save appplemac/cf987d922f5f938ae9e6 to your computer and use it in GitHub Desktop.
Save appplemac/cf987d922f5f938ae9e6 to your computer and use it in GitHub Desktop.
#!/bin/bash
[ -e /tmp/skip-tests ]; FAIL=$?
for i in $(seq 1 $(expr $CIRCLE_NODE_TOTAL - 1));
do
OUTPUT=`ssh node$i 'until [ -e /tmp/skip-tests ]; do sleep 1; done; cat /tmp/skip-tests'`
if [ "$OUTPUT" == skip ]; then FAIL=true; fi
done
if [ $FAIL == true ]; then
echo "skip" > /tmp/skip-tests
echo "Skipping tests"
for i in $(seq 1 $(expr $CIRCLE_NODE_TOTAL - 1));
do
ssh node$i 'echo skip > /tmp/skip-tests'
done
fi
if [ $FAIL == true ]; then exit 1; else exit 0; fi
#!/bin/bash
bundle exec rspec \
--format RspecJunitFormatter \
--out $CIRCLE_TEST_REPORTS/rspec/tests_fast.xml \
--format progress "$@"
if [ "$?" != 0 ]; then echo "skip" > /tmp/skip-tests; exit 1; else touch /tmp/skip-tests; exit 0; fi
#!/bin/bash
if [ $(cat /tmp/skip-tests) == "skip" ];
then exit 0;
fi
bundle exec rspec \
--format RspecJunitFormatter \
--out $CIRCLE_TEST_REPORTS/rspec/tests_slow.xml \
--format progress "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment