daattali / ggExtra

📊 Add marginal histograms to ggplot2, and more ggplot2 enhancements
http://daattali.com/shiny/ggExtra-ggMarginal-demo/
Other
383 stars 45 forks source link

Refactor tests #139

Closed crew102 closed 5 years ago

crew102 commented 5 years ago

This PR refactors ggExtra's test code, closing #100. The main refactoring invovles grouping the functions in funList together based on which test_that() call they appear in. This makes the organization of the functions clearer in helper-funs.R, and allows us to specify the names of the functions in only one place (they were previously having to appear in both helper-funs.R as well as in test-ggMarginal.R...1da367ac55cd01f9923ab649cb0472963717b431 fixes this). A few notes regarding the notes that appear in #100:

  • have the code in test-ggMarginal check that all of the figs in tests/figs have a corresponding function in funList (in case you forget to add call to a function in test-ggMarinal)

runMarginalTests() now loops over all the functions in funList, so this is no longer an issue.

  • runInternalTestsApply() only needs to test under latest version of ggplot2

It's probably not necessary to run the ggplot2 internals tests against each ggplot2 version, but i'd like to keep it as is for now.

crew102 commented 5 years ago

Also FYI, I have no idea why Travis failed when run on your account but passed when run on mine (https://travis-ci.org/crew102/ggExtra/builds/493505494?utm_source=github_status&utm_medium=notification).

crew102 commented 5 years ago

Hmm, 1 test failed when Travis ran using 8b961ec4b1914bcef598a1c763329514de943d25 and 2 failed when using fee2e2d. No idea why this would be the case, or why tests would fail to begin with. I haven't been able to get the detailed test logs when the job fails (only when it passes), so I'm going to have to run Travis in debug mode again to see if I can figure out what's going on (hopefully fixing #140). We can keep this PR open till then if you want.

daattali commented 5 years ago

I tried running travis 3 times to make sure it works, all good!