Skip to content

Commit

Permalink
enhance e2esetup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhardikjoshi committed Jan 16, 2024
1 parent edbb339 commit 64f535a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 8 additions & 11 deletions e2e_tests/setup.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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`

0 comments on commit 64f535a

Please sign in to comment.