Skip to content

Commit

Permalink
improved e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhardikjoshi committed Sep 24, 2024
1 parent 523a07e commit 7d0863e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions e2e_tests/setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/bin/sh

# Example values of environment variables ACTIVE_MODEL_VERSION=7.1.3 ACTIVEGRAPH_PATH=../ E2E_PORT=7687 E2E_NO_CRED=true
gem install rails -v $ACTIVE_MODEL_VERSION --no-document

if [[ -n "$ACTIVEGRAPH_PATH" ]]
Expand Down Expand Up @@ -28,18 +29,23 @@ then
mv dev_env.tmp config/environments/development.rb
fi

echo "Generating model"
bundle exec rails generate model User name:string
echo "Generating migration"
bundle exec rails generate migration BlahMigration
echo "Running migration"
bundle exec rake neo4j:migrate

if echo 'puts "hi"' | bundle exec rails c
if echo 'puts "Starting rails console"' | bundle exec rails c
then
echo "rails console works correctly"
echo "Rails console works correctly"
else
echo "Rails console didn't start"
exit 1
fi

bundle exec rails s -d
echo "Starting rails server"
bundle exec rails s &
until $(curl --output /dev/null --silent --head --fail localhost:3000); do
printf '.'
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion lib/active_graph/migrations/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def handle_incomplete_states!
return unless incomplete_states.any?
incomplete_versions = incomplete_states.map(&:migration_id)
fail MigrationError, <<-MSG
There are migrations struck in an incomplete states, that could not be fixed automatically:
There are migrations stuck in an incomplete states, that could not be fixed automatically:
#{incomplete_versions.join('\n')}
This can happen when there's a critical error inside a migration.
Expand Down

0 comments on commit 7d0863e

Please sign in to comment.