Skip to content

Commit

Permalink
Merge pull request #1857 from dklein-pik/develop
Browse files Browse the repository at this point in the history
Ignore missing `historical.mif` in tests because it is an optional input file
  • Loading branch information
dklein-pik authored Oct 14, 2024
2 parents 6aafcbf + 3133317 commit c8ca954
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[[#1818](https://github.com/remindmodel/remind/pull/1818)]
- **scripts** fail transparently if cm_startyear is earlier than that of path_gdx_ref
[[#1851](https://github.com/remindmodel/remind/pull/1851)]

- **testthat** ignore missing historical.mif in tests because it is an optional input file
[[#1857](https://github.com/remindmodel/remind/pull/1857)]

### fixed
- included CCS from plastic waste incineration in CCS mass flows so it is
subject to injection constraints (but did not add CCS costs, see
Expand Down
10 changes: 9 additions & 1 deletion tests/testthat/test_01-inputdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ test_that("Are all input data files present?", {
missinginput <- missingInputData(path = "../..")
if (length(missinginput) > 0) {
lockID <- gms::model_lock(folder = "../..")
updateInputData(cfg = gms::readDefaultConfig("../.."), remindPath = "../..")
w <- capture_warnings(updateInputData(cfg = gms::readDefaultConfig("../.."), remindPath = "../.."))
# ignore warning about missing historical.mif, raise warning if there were other warnings
ignore <- "File historical.mif seems to be missing!"
w <- setdiff(w, ignore)
if (length(w) > 0) {
warning(paste0("'updateInputData' raised the following warnings\n", paste(w, collapse = "\n")))
}
gms::model_unlock(lockID)
missinginput <- missingInputData(path = "../..")
# remove historical.mif since it is optional
missinginput <- grep("historical.mif", missinginput, invert = TRUE, value = TRUE)
if (length(missinginput) > 0) {
warning("Missing input files: ", paste(missinginput, collapse = ", "))
}
Expand Down

0 comments on commit c8ca954

Please sign in to comment.