Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
run examples using shinytest2 (#983)
UPDATE: This is meant to be an example implementation copy&pasted in other repos. This is what I came up with when testing examples against strict argument match (a separate PR; let's not discuss it here) and then I realize this could be an alternative solution to #917. This is a draft and remain draft for a time being. The aim is to compare and discuss alternative approaches. CC @vedhav After additional silencing logger (a separate PR not to mix it here) this is the output: ``` r$> devtools::test(filter = "examples") ℹ Testing teal.modules.clinical ✔ | F W S OK | Context ✖ | 1 114 | examples [3.2s] ─────────────────────────────────────────────────────────────────── Failure (test-examples.R:19:9): example-template_binary_outcome.Rd Expected `suppress_warnings(...)` to run without any errors. i Actually got a <simpleError> with text: object 'adrs' not found ─────────────────────────────────────────────────────────────────── ══ Results ════════════════════════════════════════════════════════ Duration: 3.2 s ── Failed tests ─────────────────────────────────────────────────── Failure (test-examples.R:19:9): example-template_binary_outcome.Rd Expected `suppress_warnings(...)` to run without any errors. i Actually got a <simpleError> with text: object 'adrs' not found [ FAIL 1 | WARN 0 | SKIP 0 | PASS 114 ] ``` Locally, it took ~5secs to get all the examples tested ``` r library(tictoc) tic() capture.output( devtools::test("/Users/ruckip/Documents/repo/gh/insightsengineering/teal.modules.clinical", filter = "examples"), file = nullfile() ) #> ℹ Testing teal.modules.clinical #> Registered S3 method overwritten by 'teal': #> method from #> c.teal_slices teal.slice #> #> Registered S3 method overwritten by 'tern': #> method from #> tidy.glm broom #> #> mmrm() registered as emmeans extension toc() #> 4.778 sec elapsed ``` <sup>Created on 2024-01-26 with [reprex v2.1.0](https://reprex.tidyverse.org)</sup> --------- Signed-off-by: Pawel Rucki <[email protected]> Co-authored-by: 27856297+dependabot-preview[bot]@users.noreply.github.com <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Vedha Viyash <[email protected]> Co-authored-by: Dony Unardi <[email protected]> Co-authored-by: André Veríssimo <[email protected]>
- Loading branch information