Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update expectation for skipped check_tbl_values_required test #183

Closed
zkamvar opened this issue Dec 13, 2024 · 0 comments · Fixed by #184
Closed

Update expectation for skipped check_tbl_values_required test #183

zkamvar opened this issue Dec 13, 2024 · 0 comments · Fixed by #184
Assignees

Comments

@zkamvar
Copy link
Member

zkamvar commented Dec 13, 2024

In #182, I added a skip to a test that was failing due to an unrelated issue to the purpose of the test:

test_that(
"check_tbl_values_required works when config contains non required modeling task.",
{
hub_path <- test_path("testdata/hub-it")
file_path <- "Tm-Md/2023-11-04-Tm-Md.csv"
round_id <- "2023-11-04"
tbl <- read_model_out_file(
file_path = file_path,
hub_path = hub_path,
coerce_types = "chr"
)
expect_s3_class(
check_tbl_values_required(
tbl = tbl,
round_id = round_id,
file_path = file_path,
hub_path = hub_path
),
c("check_success", "hub_check", "rlang_message", "message", "condition")
)
}
)

It returns a "check_failure" because the output type IDs for quantiles do not match.

    library("hubValidations")
    hub_path <- "~/Documents/Git/hubverse-org/PKGS/hubValidations/tests/testthat/testdata/hub-it"
    file_path <- "Tm-Md/2023-11-04-Tm-Md.csv"
    round_id <- "2023-11-04"
    tbl <- read_model_out_file(
      file_path = file_path,
      hub_path = hub_path,
      coerce_types = "chr"
    )
    chk <- check_tbl_values_required(
      tbl = tbl,
      round_id = round_id,
      file_path = file_path,
      hub_path = hub_path
    )
    waldo::compare(tbl$output_type_id, chk$missing$output_type_id, max_diffs = 20)
#>      old     | new                    
#>  [1] "0.010" - "0.01" [1]             
#>  [2] "0.025" - "0.05" [2]             
#>  [3] "0.050" - "0.1"  [3]             
#>  [4] "0.100" - "0.15" [4]             
#>  [5] "0.150" - "0.2"  [5]             
#>  [6] "0.200" - "0.25" [6]             
#>  [7] "0.250" - "0.3"  [7]             
#>  [8] "0.300" - "0.35" [8]             
#>  [9] "0.350" - "0.4"  [9]             
#> [10] "0.400" - "0.45" [10]            
#> [11] "0.450" - "0.5"  [11]            
#> [12] "0.500" - "0.55" [12]            
#> [13] "0.550" - "0.6"  [13]            
#> [14] "0.600" - "0.65" [14]            
#> [15] "0.650" - "0.7"  [15]            
#> [16] "0.700" - "0.75" [16]            
#> [17] "0.750" - "0.8"  [17]            
#> [18] "0.800" - "0.85" [18]            
#> [19] "0.850" - "0.9"  [19]            
#> [20] "0.900" - "0.95" [20]            
#>  ... ...       ...    and 268 more ...

Created on 2024-12-13 with reprex v2.1.1

Originally posted by @zkamvar in #180 (comment)

@annakrystalli points out that this test will succeed if we create an updated tasks.json with output type ids that do not have trailing zeroes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants