Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2E test shell script improvements #1726

Merged
merged 14 commits into from
Sep 25, 2024
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
Loading