Tests: order-dependent snapshots, unseeded data, silent skips and assertions that cannot fail
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Start with test-impute-missing-scores.R, test-metrics-binary.R, test-class-forecast-ordinal.R, and the print snapshot tests, then inspect shared fixtures in setup.R. Run the review's filtered test commands to reproduce the order dependent snapshots and a full test run to check random failures, skips, assertions, prints, warnings, and labels. Done when these test issues are addressed and the relevant tests pass without unintended skips or warnings.
Written by the indexing model from the issue text.
Description
CLAUDE: - [ ] Six plot snapshots depend on test order. test-impute-missing-scores.R does scores <- scores_quantile and later data.table::setkeyv(scores, names(scores)), which sorts the shared fixture from setup.R by reference. The vdiffr snapshots of plot_heatmap(), plot_wis() and plot_pairwise_comparisons() were recorded against the sorted fixture:
devtools::test(filter = "plot_heatmap|plot_wis") # 4 failures
devtools::test(filter = "impute-missing-scores|plot_heatmap|plot_wis") # 0 failures
Fix: data.table::copy() in that test and re-record the snapshots.
-
test-metrics-binary.Rdrawsobservedwithrbinom()and no seed at file level; when all ten draws are equal (about 1 in 400) six tests fail. - Eleven
skip_if_not()guards intest-impute-missing-scores.R(e.g. onexists("build_missing_grid", ...)) would silently skip tests of exported functions if an internal helper were renamed. - Assertions that cannot fail:
expect_s3_class(x, c("forecast_quantile", "data.table", "data.frame"))passes for any data.frame (noexact = TRUE); seven bareexpect_error()/expect_warning()calls without a message;get_metrics()tests only checkexpect_type(, "list"); the permutation test only usesexpect_no_condition();get_pit_histogram()tests never check a density. - Print tests: nominal, ordinal and multivariate are not in the print snapshot test, and the same
print()is snapshotted four times per data set. - Unused fixtures in
setup.R(scores_sample_discrete,scores_nominal,metrics_no_cov_no_ae); a clean run has four warnings that nothing fails on. - Mislabelled tests in
test-class-forecast-ordinal.R("get_metrics.forecast_nominal()", "is_forecast_nominal() works").
Related: #685, #686, #986.
Found during a full review of the package (version 2.3.0.9000, main at 779d7d68).
- Dominant language
- R
- Stars
- 67
- Forks
- 24
- Avg merge
- 1h 24m
- Merged PRs (30d)
- 2
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from epiforecasts/scoringutils
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
epiforecasts/scoringutils#1264 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
epiforecasts/scoringutils#1265 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
epiforecasts/scoringutils#1260 ·
Maintainers usually reply within 1 day
-
Incorrect guidance in `NEWS.md` re `add_relative_skill()`?Possibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1226 · 1 comment · 2 reactions ·
Maintainers usually reply within 1 day
-
get_pit_histogram(): unsorted breaks produce negative densities; num_bins = 1 returns an empty tablePossibly taken @nikosbosse claimed this 15 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
epiforecasts/scoringutils#1219 ·
Maintainers usually reply within 1 day
All issues in epiforecasts/scoringutils
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
leppott/BioMonTools#162 ·
-
publications
Difficulty 1/5 Under an hour Newbie friendliness 85/100
epiforecasts/epiforecasts.github.io#161 ·
Maintainers usually reply within 1 day
-
Label `{sas}` chunk source as `sas` instead of `txt`, so it gets syntax highlightingPossibly taken @michaelmayer2 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
microbiome/OMA#1031 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ThinkR-open/golem#1265 ·