Skip to content

Commit

Permalink
E2E test shell script improvements (#1726)
Browse files Browse the repository at this point in the history
* improved e2e tests

* using github.sha

* Update e2e_test.yml

* final cleanup

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* Update setup.sh

* cleanup

* Update setup.sh

* Update e2e_test.yml

* activegraph path cleanup
  • Loading branch information
mrhardikjoshi authored Sep 25, 2024
1 parent b4efa99 commit eb0c5eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/e2e_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,7 @@ jobs:
run: while [ $((curl localhost:7474/ > /dev/null 2>&1); echo $?) -ne 0 ]; do sleep 1; done

- name: Setup test rails app
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
# For pull requests, get the SHA of the last commit in the PR
COMMIT_SHA=$(jq -r '.pull_request.head.sha' < "${{ github.event_path }}")
else
# For push events (like master branch), use the commit SHA
COMMIT_SHA="${{ github.sha }}"
fi
./e2e_tests/setup.sh $COMMIT_SHA
run: e2e_tests/setup.sh

- name: Install dependencies
run: bundle update
Expand Down
9 changes: 3 additions & 6 deletions e2e_tests/setup.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/sh

# Example values of environment variables ACTIVE_MODEL_VERSION=7.1.3 ACTIVEGRAPH_PATH=../ E2E_PORT=7687 E2E_NO_CRED=true

rm -r ./myapp
gem install rails -v $ACTIVE_MODEL_VERSION --no-document

if [[ -n "$ACTIVEGRAPH_PATH" ]]
then
sed 's|.*gem '"'"'activegraph'"'"'.*|gem '"'"'activegraph'"'"', path: "'"$ACTIVEGRAPH_PATH"'"|' docs/activegraph.rb > template.tmp
else
sed 's/.*gem '"'"'activegraph'"'"'.*/gem '"'"'activegraph'"'"', github: "neo4jrb\/activegraph", ref: "'"$1"'"/' docs/activegraph.rb > template.tmp
fi
sed 's|.*gem '"'"'activegraph'"'"'.*|gem '"'"'activegraph'"'"', path: '"'"'../'"'"'|' docs/activegraph.rb > template.tmp

rails \_$ACTIVE_MODEL_VERSION\_ new myapp -O -m ./template.tmp
rm -f ./template.tmp
Expand Down

0 comments on commit eb0c5eb

Please sign in to comment.