From 64f535ad22aa0d039337d919744dbc7c618e030c Mon Sep 17 00:00:00 2001 From: Hardik Joshi Date: Tue, 16 Jan 2024 18:53:18 +0530 Subject: [PATCH] enhance e2esetup steps --- .github/workflows/e2e_test.yml | 7 ++++--- e2e_tests/setup.sh | 19 ++++++++----------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e_test.yml b/.github/workflows/e2e_test.yml index d15d6ad77..6a6a79004 100644 --- a/.github/workflows/e2e_test.yml +++ b/.github/workflows/e2e_test.yml @@ -20,9 +20,10 @@ jobs: ruby: [ jruby-9.4.5.0, ruby-3.2.2 ] neo4j: [ 5.15.0 ] active_model: [ 7.1.2 ] - # exclude: - # - ruby: jruby-9.4.5.0 - # active_model: 7.1.2 + # exclude jruby till bug is fixed + exclude: + - ruby: jruby-9.4.5.0 + active_model: 7.1.2 env: ACTIVE_MODEL_VERSION: ${{ matrix.active_model }} JRUBY_OPTS: --debug -J-Xmx1280m -Xcompile.invokedynamic=false -J-XX:+TieredCompilation -J-XX:TieredStopAtLevel=1 -J-noverify -Xcompile.mode=OFF diff --git a/e2e_tests/setup.sh b/e2e_tests/setup.sh index 8ccb99bb9..f8b3ec97c 100755 --- a/e2e_tests/setup.sh +++ b/e2e_tests/setup.sh @@ -1,20 +1,16 @@ #!/bin/sh -if [[ -n "$ACTIVE_MODEL_VERSION" ]] -then - gem install rails -v $ACTIVE_MODEL_VERSION --no-document -else - gem install rails -v 7.1.2 --no-document -fi +gem install rails -v $ACTIVE_MODEL_VERSION --no-document -if [[ -n "$SHA" ]] +if [[ -n "$ACTIVEGRAPH_PATH" ]] then - sed 's/.*gem '"'"'activegraph'"'"'.*/gem '"'"'activegraph'"'"', github: "neo4jrb\/activegraph", ref: "'"$SHA"'"/' docs/activegraph.rb > template.tmp + sed 's|.*gem '"'"'activegraph'"'"'.*|gem '"'"'activegraph'"'"', path: "'"$ACTIVEGRAPH_PATH"'"|' docs/activegraph.rb > template.tmp else echo "SHA=$(git rev-parse "$GITHUB_SHA")" >> $GITHUB_ENV sed 's/.*gem '"'"'activegraph'"'"'.*/gem '"'"'activegraph'"'"', github: "neo4jrb\/activegraph", ref: "'"$(git rev-parse "$GITHUB_SHA")"'"/' docs/activegraph.rb > template.tmp fi -rails _7.1.2_ new myapp -O -m ./template.tmp + +rails \_$ACTIVE_MODEL_VERSION\_ new myapp -O -m ./template.tmp rm -f ./template.tmp cd myapp @@ -35,16 +31,17 @@ fi bundle exec rails generate model User name:string bundle exec rails generate migration BlahMigration bundle exec rake neo4j:migrate + if echo 'puts "hi"' | bundle exec rails c then echo "rails console works correctly" else exit 1 fi + bundle exec rails s -d -# while [ $((curl localhost:3000/ > /dev/null 2>&1); echo $?) -ne 0 ]; do sleep 1; done until $(curl --output /dev/null --silent --head --fail localhost:3000); do printf '.' - sleep 2 + sleep 1 done kill `cat tmp/pids/server.pid`