Skip to content

plotly.js image test #7

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 68 commits into from
Nov 17, 2015
Merged
Show file tree
Hide file tree
Changes from 67 commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
3a3382e
put build-baseline-images in tasks/
etpinard Nov 13, 2015
3bbe42d
put image request options getter in tasks/util
etpinard Nov 13, 2015
407fa49
add image server path to tasks/util/constants.js
etpinard Nov 13, 2015
346b55f
update pixel comp script:
etpinard Nov 13, 2015
40a9c00
add npm run test-image script
etpinard Nov 13, 2015
beb5490
fix path
perigee Nov 13, 2015
1d31653
mv 3d mocks to test/image/mocks
etpinard Nov 13, 2015
a3d719d
update doc
perigee Nov 13, 2015
563f14a
mv gl2d testplots to test/image/mocks
etpinard Nov 13, 2015
f14fd76
rm remains of testplot-*
etpinard Nov 13, 2015
2038690
use mock in mocks/ for pummel dashbaord button
etpinard Nov 13, 2015
f8c0a90
rename and clean up test dashboard button lists
etpinard Nov 13, 2015
d755422
rm data-ref annotations from gl2d mocks
etpinard Nov 13, 2015
e92f04a
fix path in gl2d test buttons
etpinard Nov 16, 2015
60efb07
image test README to test/image
etpinard Nov 16, 2015
708c6e5
Merge branch 'master' into image-test
etpinard Nov 16, 2015
e7691c2
make gl2d mocks valid JSON
etpinard Nov 16, 2015
6de726c
put image viewer in functional state
etpinard Nov 16, 2015
1bb53f0
Update README.md
perigee Nov 16, 2015
1179ed1
tmp commit git diff --cached!
etpinard Nov 16, 2015
cc99801
mv docker part doc to docker_part_readme.md
perigee Nov 16, 2015
bf05f6c
mv docker part doc to docker_part_readme.md
perigee Nov 16, 2015
5e41e5a
add image docker test bash wrapper in tasks/
etpinard Nov 16, 2015
93d1be6
add make baseline script
etpinard Nov 16, 2015
7352e87
Merge branch 'image-test' of github.com:plotly/plotly.js into image-test
etpinard Nov 16, 2015
f5ed930
Merge branch 'master' into image-test
etpinard Nov 16, 2015
da056c5
add scroll-bar to image viewer buttons
etpinard Nov 16, 2015
e2b2b41
make image server inder look for plotly.js in build/
etpinard Nov 16, 2015
a0158fa
update docker docs
etpinard Nov 16, 2015
efee288
add sample circleci config file
perigee Nov 16, 2015
d1f864c
update cartesian, polar and geo baselines
etpinard Nov 16, 2015
c2a358a
add gl3d mocks
etpinard Nov 16, 2015
d81c600
don't test gl2d mocks just yet:
etpinard Nov 16, 2015
274dd96
change the script
perigee Nov 16, 2015
f4df76c
merge doc
perigee Nov 16, 2015
26a8c0a
test only image-test branch for the moment
perigee Nov 16, 2015
cb37d4b
add port
perigee Nov 16, 2015
3bcf09b
add gl2d baselines:
etpinard Nov 16, 2015
ab202dd
work around for docker exec
perigee Nov 16, 2015
8b3b950
Merge branch 'image-test' of github.com:plotly/plotly.js into image-test
etpinard Nov 16, 2015
d044e6f
install node, and install pkgs
perigee Nov 16, 2015
ae779f3
Merge branch 'image-test' of github.com:plotly/plotly.js into image-test
perigee Nov 16, 2015
e243b7d
add artifacts
perigee Nov 16, 2015
d59eea9
add cibundle.js task:
etpinard Nov 17, 2015
fe148e4
add citest-jasmine npm script, use it circle test
etpinard Nov 17, 2015
7aa375c
fix typos related to cibundle
etpinard Nov 17, 2015
5176af6
add back docker exec call in test_image.sh
etpinard Nov 17, 2015
864c2a2
restart monit
perigee Nov 17, 2015
03d2012
add service
perigee Nov 17, 2015
769117c
rm preprocess in cibuild script (already done on postinstall)
etpinard Nov 17, 2015
0cce8d2
make gl2d buttons the default in test_dashboard
etpinard Nov 17, 2015
cf9f2c3
Merge branch 'image-test' of github.com:plotly/plotly.js into image-test
etpinard Nov 17, 2015
0f787af
try putting 'monit restart' in same docker run cmd as test
etpinard Nov 17, 2015
adb546f
add sudo
perigee Nov 17, 2015
7d72bc6
merge
perigee Nov 17, 2015
d0de8a7
comment out
perigee Nov 17, 2015
5cc9b92
rm monit restart cmd in circle yml
etpinard Nov 17, 2015
c2fe95e
[testing] make grid line color by red by default
etpinard Nov 17, 2015
393b969
bump sleep time to 20 after docker run
etpinard Nov 17, 2015
fa92c36
try image 0.2.0
etpinard Nov 17, 2015
d59fdd9
try running cibuild in 'post'
etpinard Nov 17, 2015
2a03509
cp test/image index.html to image server
etpinard Nov 17, 2015
8b19f4c
split the commands
perigee Nov 17, 2015
a7e2594
use image 0.2.1 instead
perigee Nov 17, 2015
dc2121e
Revert "[testing] make grid line color by red by default"
perigee Nov 17, 2015
a1be235
move docker run into dependencies sector
perigee Nov 17, 2015
036577b
rm branch-only circle spec
etpinard Nov 17, 2015
44957ab
put docker instructions in test/image/README.md
etpinard Nov 17, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 23 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
general:
artifacts:
- "build/test_images/" # relative to the build directory
- "build/test_images_diff/" # relative to the build directory

machine:
node:
version: 4.2.1
services:
- docker


dependencies:
pre:
- docker pull plotly/imageserver:0.2.1
post:
- npm run cibuild
- docker run -d --name myimageserver -v $PWD:/var/www/streambed/image_server/plotly.js -p 9010:9010 plotly/imageserver:0.2.1; sleep 20
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this command boots up the docker container


test:
override:
- sudo lxc-attach -n "$(docker inspect --format '{{.Id}}' myimageserver)" -- bash -c "cd /var/www/streambed/image_server/plotly.js && node test/image/compare_pixels_test.js"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this command runs the image test inside the docker container.

- npm run citest-jasmine
2 changes: 1 addition & 1 deletion devtools/image_viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<head>
</head>
<body>
<div id="plot-list"></div>
<div id="plot-list" style="overflow:auto; height:100px;"></div>
<div id="plot-images"></div>
<div id="plot-mock"></div>

Expand Down
21 changes: 15 additions & 6 deletions devtools/image_viewer/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var path = require('path');
var exec = require('child_process').exec;

var browserify = require('browserify');
var brfs = require('brfs');
var ecstatic = require('ecstatic');
var _open = require('open');

Expand All @@ -15,23 +16,31 @@ var PORT = '9090';

console.log('Listening on :' + PORT + '\n');

var listName = 'list-of-incorrect-images.txt';
var listPath = constants.pathToTestImagesDiffList;
var listCMD = [
'ls',
constants.pathToTestImagesDiff,
'>',
listPath
].join(' ');

// build image viewer bundle
fs.unlink(constants.pathToImageViewerBundle, function() {
exec('ls ../test-images-diffs/ > ' + listName, function() {
var b = browserify(path.join(__dirname, './viewer.js'), { debug: true });
exec(listCMD, function() {
var b = browserify(path.join(__dirname, './viewer.js'), {
debug: true,
transform: [brfs]
});

b.transform('brfs');
b.bundle(function(err) {
if(err) throw err;

_open('http://localhost:' + PORT + '/devtools/image_viewer');
})
.pipe(fs.createWriteStream(constants.pathToImageViewerBundle));

fs.readFile(listName, 'utf8', function(err, data) {
console.log('In ' + listName + ':\n' + data);
fs.readFile(listPath, 'utf8', function(err, data) {
console.log('In ' + listPath + ':\n' + data);
});
});
});
Expand Down
16 changes: 11 additions & 5 deletions devtools/image_viewer/viewer.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
var fs = require('fs');

var d3 = require('d3');

var constants = require('../../tasks/util/constants');


var $plotlist = document.getElementById('plot-list'),
$images = document.getElementById('plot-images'),
$mock = document.getElementById('plot-mock');

var dirBaseline = '../test-images-baseline/',
dirTest = '../test-images/',
dirDiff = '../test-images-diffs/',
dirMocks = '../mocks/';
var dirBaseline = constants.pathToTestImageBaselines,
dirTest = constants.pathToTestImages,
dirDiff = constants.pathToTestImagesDiff,
dirMocks = constants.pathToTestImageMocks;

// N.B. brfs only understand hard-coded paths
var imageNames = fs.readFileSync(
__dirname + '/list-of-incorrect-images.txt', 'utf8'
__dirname + '/../../build/list_of_incorrect_images.txt',
'utf8'
)
.split('\n')
.filter(function(x) { return x; })
Expand Down
2 changes: 1 addition & 1 deletion devtools/test_dashboard/buttons.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function plotButtons(plots, figDir) {
plotlist.appendChild(pummelButton);

var i = 0;
var mock = require('./testplots-3d/marker-color.json');
var mock = require('@mocks/gl3d_marker-color.json');
var statusDiv = document.getElementById('status-info');

pummelButton.addEventListener('click', function () {
Expand Down
8 changes: 4 additions & 4 deletions devtools/test_dashboard/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ var PORT = '8080';
var testFile;
switch(process.argv[2]) {
case 'geo':
testFile = './test-geo';
testFile = 'test_geo';
break;
case '2d':
testFile = './test-2d';
case 'gl3d':
testFile = 'test_gl3d';
break;
default:
testFile = './test-3d';
testFile = 'test_gl2d';
}

console.log('Using ' + testFile);
Expand Down
74 changes: 0 additions & 74 deletions devtools/test_dashboard/test-2d.js

This file was deleted.

37 changes: 0 additions & 37 deletions devtools/test_dashboard/test-3d.js

This file was deleted.

46 changes: 46 additions & 0 deletions devtools/test_dashboard/test_gl2d.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
var plotButtons = require('./buttons');

var figDir = '../../test/image/baselines/gl2d_';

var plots = {};

plots['10'] = require('@mocks/gl2d_10.json');
plots['14'] = require('@mocks/gl2d_14.json');
plots['12'] = require('@mocks/gl2d_12.json');
plots['17'] = require('@mocks/gl2d_17.json');
plots['22'] = require('@mocks/gl2d_22.json');
plots['24'] = require('@mocks/gl2d_24.json');
plots['28'] = require('@mocks/gl2d_28.json');
plots['30'] = require('@mocks/gl2d_30.json');
plots['32'] = require('@mocks/gl2d_32.json');
plots['axes_booleans'] = require('@mocks/gl2d_axes_booleans.json');
plots['axes_labels'] = require('@mocks/gl2d_axes_labels.json');
plots['axes_lines'] = require('@mocks/gl2d_axes_lines.json');
plots['axes_range_manual'] = require('@mocks/gl2d_axes_range_manual.json');
plots['axes_range_type'] = require('@mocks/gl2d_axes_range_type.json');
plots['axes_range_mode'] = require('@mocks/gl2d_axes_range_mode.json');
plots['basic_error_bar'] = require('@mocks/gl2d_basic_error_bar.json');
plots['bubble_markersize0'] = require('@mocks/gl2d_bubble_markersize0.json');
plots['bubble_nonnumeric-sizes'] = require('@mocks/gl2d_bubble_nonnumeric-sizes.json');
plots['date_axes'] = require('@mocks/gl2d_date_axes.json');
plots['error_bar_asymmetric_array'] = require('@mocks/gl2d_error_bar_asymmetric_array.json');
plots['error_bar_asymmetric_constant'] = require('@mocks/gl2d_error_bar_asymmetric_constant.json');
plots['error_bar_horizontal'] = require('@mocks/gl2d_error_bar_horizontal.json');
plots['error_bar_style'] = require('@mocks/gl2d_error_bar_style.json');
plots['fonts'] = require('@mocks/gl2d_fonts.json');
plots['global_font'] = require('@mocks/gl2d_global_font.json');
plots['legend_inside'] = require('@mocks/gl2d_legend_inside.json');
plots['legend_labels'] = require('@mocks/gl2d_legend_labels.json');
plots['legend_outside'] = require('@mocks/gl2d_legend_outside.json');
plots['legend_style'] = require('@mocks/gl2d_legend_style.json');
plots['line_style'] = require('@mocks/gl2d_line_style.json');
plots['multiple_subplots'] = require('@mocks/gl2d_multiple_subplots.json');
plots['scatter-colorscale-colorbar'] = require('@mocks/gl2d_scatter-colorscale-colorbar.json');
plots['scatter-marker-line-colorscales'] = require('@mocks/gl2d_scatter-marker-line-colorscales.json');
plots['show_legend'] = require('@mocks/gl2d_show_legend.json');
plots['simple_inset'] = require('@mocks/gl2d_simple_inset.json');
plots['size_margins'] = require('@mocks/gl2d_size_margins.json');
plots['stacked_coupled_subplots'] = require('@mocks/gl2d_stacked_coupled_subplots.json');
plots['stacked_subplots'] = require('@mocks/gl2d_stacked_subplots.json');

plotButtons(plots, figDir);
37 changes: 37 additions & 0 deletions devtools/test_dashboard/test_gl3d.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
var plotButtons = require('./buttons');

var figDir = '../../test/image/baselines/gl3d_';

var plots = {};

plots['bunny-hull'] = require('@mocks/gl3d_bunny-hull.json');
plots['ibm-plot'] = require('@mocks/gl3d_ibm-plot.json');
plots['marker-color'] = require('@mocks/gl3d_marker-color.json');
plots['log-axis-big'] = require('@mocks/gl3d_log-axis-big.json');
plots['delaunay'] = require('@mocks/gl3d_delaunay.json');
plots['log-axis'] = require('@mocks/gl3d_log-axis.json');
plots['multi-scene'] = require('@mocks/gl3d_multi-scene.json');
plots['surface-lighting'] = require('@mocks/gl3d_surface-lighting.json');
plots['z-range'] = require('@mocks/gl3d_z-range.json');
plots['mirror-ticks'] = require('@mocks/gl3d_mirror-ticks.json');
plots['autorange-zero'] = require('@mocks/gl3d_autorange-zero.json');
plots['contour-lines'] = require('@mocks/gl3d_contour-lines.json');
plots['xy-defined-ticks'] = require('@mocks/gl3d_xy-defined-ticks.json');
plots['opacity-surface'] = require('@mocks/gl3d_opacity-surface.json');
plots['projection-traces'] = require('@mocks/gl3d_projection-traces.json');
plots['opacity-scaling-spikes'] = require('@mocks/gl3d_opacity-scaling-spikes.json');
plots['text-weirdness'] = require('@mocks/gl3d_text-weirdness.json');
plots['wire-surface'] = require('@mocks/gl3d_wire-surface.json');
plots['triangle-mesh3d'] = require('@mocks/gl3d_triangle.json');
plots['snowden'] = require('@mocks/gl3d_snowden.json');
plots['bunny'] = require('@mocks/gl3d_bunny.json');
plots['ribbons'] = require('@mocks/gl3d_ribbons.json');
plots['date-time'] = require('@mocks/gl3d_scatter-date.json');
plots['cufflinks'] = require('@mocks/gl3d_cufflinks.json');
plots['chrisp-nan-1'] = require('@mocks/gl3d_chrisp-nan-1.json');
plots['marker-arrays'] = require('@mocks/gl3d_marker-arrays.json');
plots['scatter3d-colorscale'] = require('@mocks/gl3d_scatter3d-colorscale.json');
plots['autocolorscale'] = require('@mocks/gl3d_autocolorscale.json');
plots['nan-holes'] = require('@mocks/gl3d_nan-holes.json');

plotButtons(plots, figDir);
Loading