Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Test suite warnings from missing compute function #2208

Closed
dylan-stark opened this Issue Jul 15, 2017 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

dylan-stark commented Jul 15, 2017

Warnings are issued from ggproto_formals(calculate) call in test-function-args.r when using R 3.4.1.

In each case, calculate is NULL and so the string name of the function is passed to .Internal(formals(fun)). It looks like the warning for this case (and a TODO comment to stop on this condition in the future) was added in R 3.4.0.

From what I can see, compute was changed to compute_panel in a previous commit. And I verified that making the same update in the test fixes the issue -- I'm happy to put together a PR with that patch if that's sufficient.

To reproduce, go to the package root and use the following with R >= 3.4.0 to see the warnings:

devtools::test(pkg = "/home/rstudio/ggplot2", filter = "function-args")
#> Loading ggplot2
#> Loading required package: testthat
#> Testing ggplot2
#> function-args: ............................................W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.W.
#> 
#> Warnings ------------------------------------------------------------------
#> 1. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 2. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 3. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 4. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 5. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 6. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 7. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 8. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 9. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 10. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 11. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 12. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 13. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 14. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 15. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 16. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 17. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 18. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 19. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 20. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 21. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 22. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 23. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 24. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 25. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 26. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> 27. stat_xxx and StatXxx$draw arg defaults match (@test-function-args.r#59) - argument is not a function
#> 
#> DONE ======================================================================
Collaborator

karawoo commented Jul 15, 2017

Yeah I've been getting these warnings (and studiously putting off dealing with them for the time being 😜) as well. Your fix seems right to me. It looks like there are also some comments in the stat tests that were directly copied from the geom section above and should be updated. A PR would be welcome!

karawoo added the bug label Jul 15, 2017

karawoo closed this in #2209 Jul 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment