Skip to content

Commit

Permalink
Add test that confirms same result resurned across all checks when su…
Browse files Browse the repository at this point in the history
…pplying derived_task_ids manually
  • Loading branch information
annakrystalli committed Nov 21, 2024
1 parent 1f6729e commit d6c3a1d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/validate_submission.md
Original file line number Diff line number Diff line change
Expand Up @@ -1356,7 +1356,7 @@
Error:
! Number of accepted model output files per round exceeded. Should be 1 but pre-existing round submission file "team1-goodmodel/2022-10-08-team1-goodmodel.parquet" found in team directory.

# validate_submission works with v4 flusight
# validate_submission works with v4 flusight (contains derived_task_ids)

Code
check_for_errors(v4_missing_meta)
Expand Down
14 changes: 13 additions & 1 deletion tests/testthat/test-validate_submission.R
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ test_that("validate_submission works with v4 simple", {
expect_true(suppressMessages(check_for_errors(v4_simple)))
})

test_that("validate_submission works with v4 flusight", {
test_that("validate_submission works with v4 flusight (contains derived_task_ids)", {
skip_if_offline()

hub_path <- system.file("testhubs", "v4", "flusight", package = "hubUtils")
Expand All @@ -442,4 +442,16 @@ test_that("validate_submission works with v4 flusight", {
# TODO: Update snapshot when v4 flusight hub is updated
expect_s3_class(v4_missing_meta, c("hub_validations", "list"), exact = TRUE)
expect_snapshot(check_for_errors(v4_missing_meta), error = TRUE)

# Check we get the same result when manually supplying derived_task_ids
expect_equal(
v4_missing_meta,
validate_submission(
hub_path,
file_path = file_path,
skip_submit_window_check = TRUE,
skip_check_config = TRUE,
derived_task_ids = "target_date"
)
)
})

0 comments on commit d6c3a1d

Please sign in to comment.