Skip to content

Commit c5d0267

Browse files
committed
update visual testing docs
1 parent 48eb0a0 commit c5d0267

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,22 @@ If your pull request fixes a bug and/or implements a new feature, please [write
1212

1313
### Running visual tests via docker
1414

15-
The **plotly** package ships with a [Dockerfile](https://github.com/ropensci/plotly/blob/master/Dockerfile) for running visual tests in a consistent and reproducible environment. You can build and run the docker container like so:
15+
To ensure a consistent and reproducible environment, visual tests should be run against the [cpsievert/plotly-orca](https://hub.docker.com/r/cpsievert/plotly-orca/) docker image. If you add a new visual test and/or expect any differences, run a container like so:
1616

1717
```shell
1818
git clone https://github.com/ropensci/plotly.git
1919
cd plotly
20-
docker build -t plotly-vdiffr .
21-
docker run --privileged -p 3838:3838 plotly-orca
20+
docker run -v $(pwd):/home/plotly --privileged -p 3838:3838 cpsievert/plotly-orca
2221
```
2322

24-
This will launch a shiny app for inspecting and validating any visual differences. To see the shiny app, open your browser to <http://0.0.0.0/3838>. If there are differences that look 'good', you should validate them, then copy the new "baseline" figures over to your host machine (so that you can git add/commit/push the new baselines).
23+
This will launch a shiny app for inspecting and validating any visual differences. To see the shiny app, open your browser to <http://0.0.0.0/3838>. If there are differences that look 'good', you should validate them via the shiny app. This will automatically copy over the new "baseline" figures over to your host machine (so that you can git add/commit/push the new baselines).
24+
25+
If, for some reason, you want to just run the visual tests to see if they'll pass, do:
2526

2627
```shell
27-
# assuming the most recent container you've run has the new baselines
28-
docker cp $(docker ps -aq | head -n 1):/home/plotly/tests/figs ./tests
28+
docker run -e VMODE="ci" -v $(pwd):/home/plotly cpsievert/plotly-orca
2929
```
3030

31-
Say your changes produce changes in the corresponding svg of existing tests and/or you want to do write new tests (hooray!). In that case, you'll want to run `vdiffr::manage_cases()`, which should eventually launch a shiny app of "mismatched" and "new" to visually inspect before approving the changes.
32-
3331
## Code of Conduct
3432

3533
We want to encourage a warm, welcoming, and safe environment for contributing to this project. See the [code of conduct](https://github.com/ropensci/plotly/blob/master/CONDUCT.md) for more information.

0 commit comments

Comments
 (0)