From 19b3c6925aaee70531e14bbbb8dde0109e08f145 Mon Sep 17 00:00:00 2001 From: Alex Gorbatchev Date: Thu, 16 Sep 2021 15:25:37 -0700 Subject: [PATCH] Adds a script to run tests against running docker container --- package.json | 1 + scripts/test-with-docker | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100755 scripts/test-with-docker diff --git a/package.json b/package.json index 6e6f508f7..f13893e35 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/test-with-docker b/scripts/test-with-docker new file mode 100755 index 000000000..5811ffd23 --- /dev/null +++ b/scripts/test-with-docker @@ -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