Skip to content

Run in testbed shortcut script #613

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

Merged
merged 2 commits into from
Jun 9, 2016
Merged
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
6 changes: 3 additions & 3 deletions circle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ dependencies:
post:
- npm run cibuild
- docker run -d --name mytestbed -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/testbed:latest
- 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"
- sudo ./tasks/run_in_testbed.sh mytestbed "cp -f test/image/index.html ../server_app/index.html"
- wget --server-response --spider --tries=8 --retry-connrefused http://localhost:9010/ping
test:
override:
- 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"
- 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"
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/compare_pixels_test.js"
- sudo ./tasks/run_in_testbed.sh mytestbed "node test/image/export_test.js"
- npm run citest-jasmine
- npm run test-bundle
- npm run test-syntax
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"bundle": "node tasks/bundle.js",
"header": "node tasks/header.js",
"build": "npm run preprocess && npm run bundle && npm run header",
"cibuild": "node tasks/cibundle.js",
"cibuild": "npm run preprocess && node tasks/cibundle.js",
"watch": "node tasks/watch_plotly.js",
"lint": "eslint . || true",
"lint-fix": "eslint . --fix",
Expand Down
14 changes: 14 additions & 0 deletions tasks/run_in_testbed.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash
#
# Useful shortcut to run command inside the `testbed` docker container
# on CircleCI.
#
# ===============================================================================

ID="$1"
CMD="$2"

CONTAINER="$(docker inspect --format '{{.Id}}' $ID)"
REPOPATH="/var/www/streambed/image_server/plotly.js"

lxc-attach -n $CONTAINER -- bash -c "cd $REPOPATH && $CMD"