Skip to content

Commit

Permalink
Simplify test scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
rosston committed Sep 25, 2024
1 parent d0d4a91 commit fa1f2ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 24 deletions.
2 changes: 1 addition & 1 deletion script/test
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ bundle

echo "---> Running tests"
bundle exec rake
./script/test_example_app $@
BUNDLE_GEMFILE="${1-Gemfile}" ./script/test_example_app

bundle exec rake test

Expand Down
36 changes: 13 additions & 23 deletions script/test_example_app
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,17 @@

set -e

gemfile="${1-Gemfile}"

run_example_tests() {
bundle
yarn install

# test a normal test run
bundle exec rake db:test:prepare
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
bundle exec rake cypress:run

# test that passing options works (by printing help)
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
echo "Failed to pass options to cypress run"
exit 1
fi
}


cd example

echo "---> Running example tests with ${gemfile}"
BUNDLE_GEMFILE=$gemfile run_example_tests

bundle
yarn install

# test a normal test run
bundle exec rake db:test:prepare
NODE_OPTIONS=--openssl-legacy-provider RAILS_ENV=test bundle exec rake assets:precompile
bundle exec rake cypress:run

# test that passing options works (by printing help)
if ! bundle exec rake cypress:run CYPRESS_RAILS_CYPRESS_OPTS="-h" | grep -q "Usage: cypress run \[options\]"; then
echo "Failed to pass options to cypress run"
exit 1
fi

0 comments on commit fa1f2ee

Please sign in to comment.