Skip to content

Instantly share code, notes, and snippets.

@mbjoseph
Created August 26, 2021 17:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbjoseph/7d19752ce4363ef1167352b14abe954b to your computer and use it in GitHub Desktop.
Save mbjoseph/7d19752ce4363ef1167352b14abe954b to your computer and use it in GitHub Desktop.
Visualizing execution time for tests within a file using testthat's ListReporter
library(forcats)
library(ggplot2)
library(testthat)
path <- testthat_example("success")
l <- test_file(path, reporter = "list")
l %>%
as.data.frame() %>%
ggplot(aes(y = fct_reorder(test, real), x = real)) +
geom_point() +
xlab("Execution time") +
ylab("Test")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment