insightsengineering / thevalidatoR

Github Action that generates R Package Validation documentation 🏁
https://github.com/marketplace/actions/r-package-validation-report
MIT License
57 stars 5 forks source link

[Bug]: traceability chunk fails when nrows < 1 #74

Closed cicdguy closed 5 months ago

cicdguy commented 5 months ago

What happened?

See https://github.com/insightsengineering/goshawk/actions/runs/9290347520/job/25585057202 for example. The table creation fails as there are no rows available for the traceability matrix.

In such a case, instead of attempting to create a table, there should be a message that says "No test suites" or something similar.

Relevant log output

16/21 [traceability]   
Error:
! Number of rows in `x` must be at least `1`
Backtrace:
 1. tinytable::tt(...)
 2. tinytable:::assert_data_frame(x, min_rows = 1, min_cols = 1)

Quitting from lines 180-216 [traceability] (template.qmd)
Execution halted
Error in `quarto_render()`:
✖ Error running quarto cli.
Caused by error:
! System command 'quarto' failed
Backtrace:
    ▆
 1. └─quarto::quarto_render(template_path, output_file = "validation_report.pdf")
 2.   └─quarto:::quarto_run(args, echo = TRUE, quarto_bin = quarto_bin)
 3.     └─base::tryCatch(...)
 4.       └─base (local) tryCatchList(expr, classes, parentenv, handlers)
 5.         └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
 6.           └─value[[3L]](cond)
 7.             └─cli::cli_abort(msg, call = .call, parent = e)
 8.               └─rlang::abort(...)
Execution halted

Code of Conduct

Contribution Guidelines

Security Policy