Skip to content

Commit

Permalink
Merge pull request #42 from KristinaGomoryova/correct-tests
Browse files Browse the repository at this point in the history
Failing tests corrected
  • Loading branch information
hechth authored Jul 25, 2024
2 parents 5265322 + 11f9fbc commit b545949
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ jobs:
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Create conda environment
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: mfassignr-dev
auto-update-conda: true
Expand Down
18 changes: 13 additions & 5 deletions tests/testthat/test-MFAssignCHO.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
make_path <- function(mode, identifier) {
file.path("test-data", paste0(mode, "_cho_", identifier, ".rds"))
}

load_expected <- function(mode) {
unambig <- readRDS(file.path("test-data", paste0(mode, "_cho_unambig.rds")))
ambig <- readRDS(file.path("test-data", paste0(mode, "_cho_ambig.rds")))
none <- readRDS(file.path("test-data", paste0(mode, "_cho_none.rds")))
unambig <- readRDS(make_path(mode, "unambig"))
ambig <- readRDS(make_path(mode, "ambig"))
none <- readRDS(make_path(mode, "none"))
return(list(Unambig = unambig, Ambig = ambig, None = none))
}

update_expected <- function(actual, mode) {
saveRDS(actual$Ambig, file = make_path(mode, "ambig"))
saveRDS(actual$Unambig, file = make_path(mode, "unambig"))
saveRDS(actual$None, file = make_path(mode, "none"))
}

patrick::with_parameters_test_that("MFAssignCHO works",
{
peaks <- readRDS(file.path("test-data", paste0(mode, "_iso.rds")))
Expand All @@ -15,8 +25,6 @@ patrick::with_parameters_test_that("MFAssignCHO works",
)

expected <- load_expected(mode)
# keys <- c("Ambig", "Unambig", "None")
# expect_equal(actual[keys], expected)

expect_equal(actual$Ambig, expected$Ambig)
expect_equal(actual$Unambig, expected$Unambig)
Expand Down
Binary file modified tests/testthat/test-data/neg_cho_ambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_cho_none.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_cho_unambig.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_recal_iso.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_recal_mono.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/neg_recal_recallist.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_recal_iso.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_recal_mono.rds
Binary file not shown.
Binary file modified tests/testthat/test-data/pos_recal_recallist.rds
Binary file not shown.

0 comments on commit b545949

Please sign in to comment.