2017-06-09 14:41:44 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
# This script runs the test suites for the CI build
|
|
|
|
|
|
|
|
|
|
# Be verbose and fail script on the first error
|
|
|
|
|
set -xe
|
|
|
|
|
|
|
|
|
|
# By default: all test runs
|
|
|
|
|
if [ -z $1 ]; then
|
|
|
|
|
TEST_SUITE="all"
|
|
|
|
|
else
|
|
|
|
|
TEST_SUITE="$1"
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
case $TEST_SUITE in
|
2021-03-04 22:50:37 -08:00
|
|
|
linters|all)
|
2017-06-09 14:41:44 +02:00
|
|
|
bundle exec rubocop -Dc .rubocop.yml
|
|
|
|
|
bundle exec haml-lint app/views
|
2021-03-02 15:09:34 -08:00
|
|
|
;;&
|
|
|
|
|
models|all)
|
2018-09-19 22:06:42 +02:00
|
|
|
bundle exec rspec --format documentation spec/models
|
2021-03-02 15:09:34 -08:00
|
|
|
;;&
|
|
|
|
|
features|all)
|
2018-09-19 22:06:42 +02:00
|
|
|
bundle exec rspec --format documentation spec/features
|
2021-03-02 15:09:34 -08:00
|
|
|
;;&
|
|
|
|
|
controllers|all)
|
2018-09-19 22:06:42 +02:00
|
|
|
bundle exec rspec --format documentation spec/controllers
|
2021-03-02 15:09:34 -08:00
|
|
|
;;&
|
|
|
|
|
ability|all)
|
2018-09-19 22:06:42 +02:00
|
|
|
bundle exec rspec --format documentation spec/ability
|
2021-03-02 15:09:34 -08:00
|
|
|
;;&
|
|
|
|
|
rest|all)
|
2018-09-19 22:06:42 +02:00
|
|
|
bundle exec rspec --format documentation --exclude-pattern "spec/{models,features,controllers,ability}/**/*_spec.rb"
|
2017-06-09 14:41:44 +02:00
|
|
|
;;
|
|
|
|
|
esac
|