Skip to content

Commit 7f7c2fe

Browse files
committed
Merge pull request #613 from plotly/run-in-testbed
Run in testbed shortcut script
2 parents 25a8d9c + 144c9a1 commit 7f7c2fe

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

circle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ dependencies:
1616
post:
1717
- npm run cibuild
1818
- docker run -d --name mytestbed -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/testbed:latest
19-
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' mytestbed)" -- bash -c "cp -f /var/www/streambed/image_server/plotly.js/test/image/index.html /var/www/streambed/image_server/server_app/index.html"
19+
- sudo ./tasks/run_in_testbed.sh mytestbed "cp -f test/image/index.html ../server_app/index.html"
2020
- wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping
2121
test:
2222
override:
23-
- 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"
24-
- 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"
23+
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/compare_pixels_test.js"
24+
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js"
2525
- npm run citest-jasmine
2626
- npm run test-bundle
2727
- npm run test-syntax

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"bundle": "node tasks/bundle.js",
2626
"header": "node tasks/header.js",
2727
"build": "npm run preprocess && npm run bundle && npm run header",
28-
"cibuild": "node tasks/cibundle.js",
28+
"cibuild": "npm run preprocess && node tasks/cibundle.js",
2929
"watch": "node tasks/watch_plotly.js",
3030
"lint": "eslint . || true",
3131
"lint-fix": "eslint . --fix",

tasks/run_in_testbed.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#! /bin/bash
2+
#
3+
# Useful shortcut to run command inside the `testbed` docker container
4+
# on CircleCI.
5+
#
6+
# ===============================================================================
7+
8+
ID="$1"
9+
CMD="$2"
10+
11+
CONTAINER="$(docker inspect --format '{{.Id}}' $ID)"
12+
REPOPATH="/var/www/streambed/image_server/plotly.js"
13+
14+
lxc-attach -n $CONTAINER -- bash -c "cd $REPOPATH && $CMD"

0 commit comments

Comments
 (0)