From 7d0863efb044c36b9fa99639a409a014105602d2 Mon Sep 17 00:00:00 2001 From: Hardik Joshi Date: Tue, 24 Sep 2024 16:08:32 +0530 Subject: [PATCH] improved e2e tests --- e2e_tests/setup.sh | 12 +++++++++--- lib/active_graph/migrations/runner.rb | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/e2e_tests/setup.sh b/e2e_tests/setup.sh index f8b3ec97c..e5f623b65 100755 --- a/e2e_tests/setup.sh +++ b/e2e_tests/setup.sh @@ -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" ]] @@ -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 diff --git a/lib/active_graph/migrations/runner.rb b/lib/active_graph/migrations/runner.rb index a7821db08..0a536f994 100644 --- a/lib/active_graph/migrations/runner.rb +++ b/lib/active_graph/migrations/runner.rb @@ -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.