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

Ignore missing historical.mif in tests because it is an optional input file #1857

Merged
merged 7 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading