Skip to content

Commit 1179ed1

Browse files
committed
tmp commit git diff --cached!
1 parent 6de726c commit 1179ed1

File tree

4 files changed

+35
-6
lines changed

4 files changed

+35
-6
lines changed

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@
4949
"watch": "node tasks/watch_plotly.js",
5050
"lint": "cd src && jshint . || true",
5151
"test-jasmine": "karma start test/jasmine/karma.conf.js",
52-
"test-image": "node test/image/compare_pixels_test.js",
52+
"test-image": "./tasks/test_image.sh",
5353
"test": "npm run test-jasmine && npm test-image",
5454
"start-test_dashboard": "node devtools/test_dashboard/server.js",
55-
"start-image_viewer": "node devtools/image_viewer/server.js"
55+
"start-image_viewer": "node devtools/image_viewer/server.js",
56+
"make-baseline": "./tasks/make_baseline.sh"
5657
},
5758
"dependencies": {
5859
"3d-view": "^2.0.0",

tasks/test_image.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#! /bin/bash
2+
#
3+
# TODO adapt this for Windows
4+
5+
# TODO add package.json config arguments to configure the container name,
6+
# ports and imageserver version
7+
8+
CONTAINER_NAME=""
9+
10+
11+
docker run -d --name $CONTAINER_NAME \
12+
-v $PWD/plotly.js:/var/www/streambed/image_server/plotly.js \
13+
-p 9010:9010 -p 2022:22 plotly/imageserver:[version]
14+
15+
docker exec -i $CONTAINER_NAME /bin/bash \
16+
-c "cd /var/www/streambed/image_server/plotly.js && \
17+
cp -f test/image/index.html ../server_app/index.html && \
18+
monit restart nw1 && \
19+
sleep 5 && \
20+
node test/image/compare_pixels_test.js"
21+

test/image/compare_pixels_test.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
'use strict';
2-
31
var fs = require('fs');
4-
var request = require('request');
52
var path = require('path');
63

74
var constants = require('../../tasks/util/constants');
85
var getOptions = require('../../tasks/util/get_image_request_options');
96

107
// packages inside the image server docker
8+
var request = require('request');
119
var test = require('tape');
1210
var gm = require('gm');
1311

@@ -72,7 +70,6 @@ function testMock (fileName, t) {
7270
tolerance: 0.0
7371
};
7472

75-
console.log(savedImagePath)
7673
if(statusCode === 485) {
7774
console.error(imageFileName, '- skip');
7875
}

test/image/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<body>
4+
<!-- this index file gets copied in to the image server docker -->
5+
<script type="text/javascript" src="../plotly.js/dist/extras/mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
6+
<script type="text/javascript" src="../plotly.js/dist/plotly.js" charset="utf-8"></script>
7+
<script type="text/javascript" src="../plotly.js/dist/plotly-geo-assets.js" charset="utf-8"></script>
8+
<script type="text/javascript" src="./main.js"></script>
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)