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

Adds a script to run tests against running docker container #746

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
"typedoc": "^0.20.36",
"typescript": "^4.2.4",
"url": "^0.11.0",
"wait-on": "^6.0.0",
"webpack": "^4.46.0",
"webpack-cli": "^4.6.0",
"xunit-file": "^1.0.0"
Expand Down
22 changes: 22 additions & 0 deletions scripts/test-with-docker
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash -e

CONTAINER_NAME="arangojs-test"

function cleanup {
docker kill "$CONTAINER_NAME" > /dev/null
docker rm "$CONTAINER_NAME" > /dev/null
}

trap cleanup EXIT

docker run \
--detach \
--env "ARANGO_NO_AUTH=1" \
--name "$CONTAINER_NAME" \
-p 127.0.0.1:8529:8529/tcp \
arangodb/arangodb

echo "Waiting for ArangoDB..."
npm exec wait-on http-get://localhost:8529

npm test