Skip to content

Commit 2d15069

Browse files
committed
add export test runners
1 parent 9c5521b commit 2d15069

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

circle.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ dependencies:
2020
test:
2121
override:
2222
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
23+
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/export_test.js"
2324
- npm run citest-jasmine
2425
- npm run test-bundle
2526
- npm run test-syntax

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"test-jasmine": "karma start test/jasmine/karma.conf.js",
3232
"citest-jasmine": "karma start test/jasmine/karma.ciconf.js",
3333
"test-image": "./tasks/test_image.sh",
34+
"test-export": "./tasks/test_export.sh",
3435
"test-syntax": "node test/syntax_test.js",
3536
"test-bundle": "node tasks/test_bundle.js",
3637
"test": "npm run citest-jasmine && npm run test-image && npm run test-syntax && npm run test-bundle",

tasks/test_export.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#! /bin/bash
2+
#
3+
# TODO adapt this for Windows
4+
#
5+
# ===============================================================================
6+
7+
CONTAINER_NAME="imagetest" # same as in docker-compose.yml
8+
9+
# create/run/start docker container with:
10+
# $ docker-compose up -d
11+
12+
CMD=(
13+
"cd /var/www/streambed/image_server/plotly.js &&"
14+
"cp -f test/image/index.html ../server_app/index.html &&"
15+
"supervisorctl restart nw1 && "
16+
"wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping &&"
17+
"node test/image/export_test.js $1"
18+
)
19+
20+
docker exec -i $CONTAINER_NAME /bin/bash -c "${CMD[*]}"

0 commit comments

Comments
 (0)