start_old_tests 1 KB
Newer Older
Andrew Lee's avatar
Andrew Lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#!/bin/bash

# Only sync what is needed to run the tests
echo "Syncing files..."
sudo rsync -aq --ignore-missing-args --include-from=- /obs_readonly/ /obs/ <<EOF
+ Rakefile
+ docs/
+ docs/api/
+ docs/api/api/***
+ src/
+ src/api/
+ src/api/app/***
+ src/api/bin/***
- src/api/config/options.yml
- src/api/config/database.yml
+ src/api/config/***
+ src/api/db/***
+ src/api/lib/***
+ src/api/public/***
+ src/api/script/***
+ src/api/test/***
- src/backend/build/.git
- src/backend/build/.gitignore
+ src/backend/build/***
- src/backend/examples
- src/backend/t
- src/backend/testdata
+ src/backend/***
- *
EOF

echo "Preparing application..."
bundle exec rake dev:bootstrap[old_test_suite] RAILS_ENV=test

echo "Changing source_port to 3200..."
perl -pi -e 's/source_port: 5352/source_port: 3200/' config/options.yml

echo "Setting up sphinx..."
cp config/thinking_sphinx.yml{.example,}
touch config/test.sphinx.conf

echo "Running api test suite..."
if [[ -n $1 ]]
then
  bin/rails test $1
else
  bundle exec rake test:api
fi