Codeship
Pages 16
Navigation
- Home
- Getting Started Guide
- Set Up Instructions
- Writing and Tracking Code
- Automated Testing
Clone this wiki locally
Note: This page is a work in progress!
We use Codeship to run our tests on code we've merged, and after the tests pass, it deploys the code to our staging environment so we can manually test it. We have it configured to retry feature groups three times if they fail.
How to set up Codeship
-
In your browser, go to Codeship.
-
Choose "Sign up with GitHub" to sign up with your GitHub account. (If you're not already signed in to GitHub, you'll be prompted to log in.)
-
GitHub will ask you to confirm that you want to authorize Codeship to access your account.
-
Follow Codeship's instructions to create a new project using your fork of the otwarchive repository.
-
For the "Configure Project" step, make sure "Select your technology to prepopulate basic commands" is set to "I want to create my own custom commands."
-
Under "Setup Commands," delete the suggested commands and enter the following:
RUBY_DEV=$(cat .ruby_version)
rvm install $RUBY_DEV
rvm use $RUBY_DEV
gem install bundler
jdk_switcher home oraclejdk8
jdk_switcher use oraclejdk8- On the same page, delete any commands under "Configure Test Pipelines" and enter the following (you may need to choose "+ Add Pipeline" first if there's nowhere to enter text):
export RAILS_ENV=test
bash ./script/prepare_codeship.sh
bash ./script/try_command.sh rspec "bundle exec rspec spec "
bin/rails db:environment:set RAILS_ENV=test
bundle exec rake db:drop
bash ./script/prepare_codeship.sh
# Adding "|| :" to the end of a command will force it to succeed,
# useful for ignoring failed tests
bash ./script/try_command.sh admins "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh bookmarks "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh collections "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh comments_and_kudos "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh gift_exchanges "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh importing "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh other_a "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh other_b "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh prompt_memes_a "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh prompt_memes_b "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh prompt_memes_c "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh search "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh tag_sets "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh tags_and_wrangling "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh users "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"
bash ./script/try_command.sh works "bundle exec cucumber --tags ~@browserstack -f Ao3Cucumber::Formatter -r features features/\$TEST_RUN"- Choose "Save and go to dashboard" to save your configuration.
Next time you push to a branch on your repository, Codeship will run your tests!
If you have any questions regarding code development, please don't hesitate to send an email to [email protected] and we will try to get back to you as soon as possible!