@@ -12,7 +12,11 @@ if (report_diffs || build_table) {
1212 message(" Spinning up an independent R session with plotly's master branch installed" )
1313 Rserve :: Rserve(args = " --vanilla --RS-enable-remote" )
1414 conn <- RSconnect()
15- # master version should _always_ depend on the CRAN version of ggplot2
15+ # ensure the seed is the same for randomized tests
16+ set.seed(1 )
17+ RSeval(conn , " set.seed(1)" )
18+ # we don't make assumptions about ggplot2 versioning,
19+ # but it is _strongly_ recommended to use the CRAN version (of ggplot2)
1620 RSeval(conn , " devtools::install_github('ropensci/plotly')" )
1721 RSeval(conn , " library(plotly)" )
1822 if (report_diffs ) {
@@ -23,6 +27,19 @@ if (report_diffs || build_table) {
2327 master_hash <- substr(master_hash , 1 , 7 )
2428 # plotly-test-table repo hosts the diff pages & keeps track of previous versions
2529 table_dir <- normalizePath(" ../../plotly-test-table" , mustWork = T )
30+ # Make sure we have appropriate versions of plotlyjs
31+ # (see plotly-test-table/template/template/index.html)
32+ file.copy(
33+ file.path(" .." , " inst" , " htmlwidgets" , " lib" , " plotlyjs" , " plotly-latest.min.js" ),
34+ file.path(table_dir , " template" , " New.min.js" ),
35+ overwrite = TRUE
36+ )
37+ download.file(
38+ " https://raw.githubusercontent.com/ropensci/plotly/master/inst/htmlwidgets/lib/plotlyjs/plotly-latest.min.js" ,
39+ file.path(table_dir , " template" , " Old.min.js" ),
40+ method = " curl"
41+ )
42+ # directory for placing test differences
2643 this_dir <- file.path(table_dir , this_hash )
2744 if (dir.exists(this_dir )) {
2845 message(" Tests were already run on this commit. Nuking the old results..." )
@@ -102,9 +119,7 @@ save_outputs <- function(gg, name) {
102119 dir.create(test_dir , recursive = T )
103120 # copy over diffing template
104121 file.copy(
105- file.path(table_dir , " template" , " template" , " index.html" ),
106- test_dir ,
107- recursive = T
122+ dir(file.path(table_dir , " template" , " template" ), full.names = TRUE ), test_dir
108123 )
109124 # overwrite the default JSON
110125 writeLines(
0 commit comments