File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,33 @@ To check test coverage:
7878npm run coverage
7979```
8080
81+ ### Running image tests
82+
83+ #### Build Docker image
84+ To produce images reproducibly,
85+ we need to make sure Orca is running in exactly the same environment.
86+ To achieve this, we package Orca in a Docker image which can be built with:
87+ ```
88+ export DOCKER_ORCA_IMAGE=orca_dev
89+ docker build -t "$DOCKER_ORCA_IMAGE" -f deployment/Dockerfile .
90+ ```
91+
92+ #### Build images and compare
93+
94+ To run the image tests, run the following:
95+ ```
96+ ./test/image/render_mocks_cli build/test_images "$DOCKER_ORCA_IMAGE" && \
97+ ./test/image/compare_images test/image/baselines build/test_images build/
98+ ```
99+
100+ #### Generate new baselines
101+ Simply build images as above but save then at ` test/image/baselines ` instead:
102+ ```
103+ ./test/image/render_mocks_cli test/image/baselines "$DOCKER_ORCA_IMAGE"
104+ ```
105+ ** Note that one can change the version of plotly.js used to build images
106+ by editing ` test/image/render_mocks_cli ` . **
107+
81108## Packaging
82109
83110We use [ ` electron-builder ` ] ( https://github.com/electron-userland/electron-builder ) to pack up
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22set -e
3-
43programname=$0
54
5+ PLOTLYJS_URL=" https://cdn.plot.ly/plotly-1.47.2.min.js"
6+
67function usage {
78 echo " usage: $programname output_folder [docker:image]"
89 echo " it renders all the JSON files found in ./test/image/mocks into the output_folder."
2627 ORCA_OPTS=(--topojson /plotly-geo-assets.js --mathjax /mathjax/MathJax.js)
2728
2829 # pin Plotly.js' version
29- ORCA_OPTS+=(--plotlyJS " https://cdn.plot.ly/plotly-1.47.2.min.js " )
30+ ORCA_OPTS+=(--plotlyJS " $PLOTLYJS_URL " )
3031
3132 # Set Orca options
3233 ORCA_OPTS+=(--verbose --format " $format " --output-dir " $1 " )
You can’t perform that action at this time.
0 commit comments