Skip to content

Commit d8eb50c

Browse files
committed
new testing instructions
1 parent 94e40d6 commit d8eb50c

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

CONTRIBUTING.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,16 @@ See the [opening issues template](https://github.com/ropensci/plotly/blob/master
66

77
## Development guidelines
88

9-
If you'd like to contribute changes to plotly, we use [the GitHub flow](https://guides.github.com/introduction/flow/index.html) for proposing, submitting, reviewing, and accepting changes. If you haven't done this before, Hadley Wickham provides a nice overview of git (<http://r-pkgs.had.co.nz/git.html>), as well as best practices for submitting pull requests (<http://r-pkgs.had.co.nz/git.html#pr-make>). We also recommend using his style guide when writing code (<http://adv-r.had.co.nz/Style.html>).
9+
If you'd like to contribute changes to plotly, we use [the GitHub flow](https://guides.github.com/introduction/flow/index.html) for proposing, submitting, reviewing, and accepting changes. If you aren't familiar with git and/or GitHub, we recommend studying these excellent free resources by [Hadley Wickham](http://r-pkgs.had.co.nz/git.html) and [Jenny Bryan](http://happygitwithr.com). We also prefer R coding style that adheres to <http://style.tidyverse.org/>.
1010

11-
If your pull request fixes a bug, or implements a new feature, it's a good idea to write a test (<http://r-pkgs.had.co.nz/tests.html>) to demonstrate it's working. If you'd like to closely simulate the tests that run when you submit your pull request, open R under your local plotly git repo, then do the following:
11+
If your pull request fixes a bug, or implements a new feature, please [write a test via testthat](http://r-pkgs.had.co.nz/tests.html) to demonstrate it's working. The testing suite can optionally leverage **vdiffr**'s `expect_doppelganger()` to monitor changes via svg -- to make sure those those tests run, do:
1212

1313
```r
14-
# the pull request number is arbitrary when running locally
15-
Sys.setenv('TRAVIS_PULL_REQUEST' = '1')
16-
Sys.setenv('TRAVIS_COMMIT' = substr(system('git rev-parse HEAD', intern = T), 1, 7))
17-
devtools::load_all(); source('tests/testthat.R', chdir = TRUE)
14+
Sys.setenv("USE_VDIFFR" = "true")
15+
devtools::test()
1816
```
1917

20-
You can also build a ggplot2/plotly comparison table. To do so, you'll first need to clone the [plotly-test-table](https://github.com/cpsievert/plotly-test-table) repo.
21-
22-
```shell
23-
$ git clone https://github.com/cpsievert/plotly-test-table.git ../plotly-test-table
24-
```
25-
26-
Then, from R:
27-
28-
```r
29-
Sys.setenv('PLOTLY_TABLE' = 'TRUE')
30-
devtools::load_all(); source('tests/testthat.R', chdir = TRUE)
31-
```
18+
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.
3219

3320
## Code of Conduct
3421

0 commit comments

Comments
 (0)