-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#367 support resource_type and source_type options
- Loading branch information
Showing
5 changed files
with
145 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
inst/extdata/workflows/config_metadata_zenodo_with_options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"profile": { | ||
"id": "my-workflow", | ||
"name": "My workflow", | ||
"project": "Test geoflow project", | ||
"organization": "My organization", | ||
"logos": [ | ||
"https://via.placeholder.com/300x150.png/09f/fff?text=geoflow" | ||
], | ||
"mode": "entity" | ||
}, | ||
"metadata": { | ||
"entities": [ | ||
{ | ||
"handler": "zenodo", | ||
"source": ["10.5281/zenodo.2547036"], | ||
"options": { | ||
"resource_type": "record", | ||
"source_type": "doi" | ||
} | ||
} | ||
], | ||
"contacts" : [] | ||
}, | ||
"software": [ | ||
{ | ||
"id": "my-zenodo", | ||
"type": "input", | ||
"software_type": "zenodo", | ||
"parameters": { | ||
"url": "https://zenodo.org/api", | ||
"logger": "DEBUG" | ||
} | ||
} | ||
], | ||
"actions": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# test_config_metadata_zenodo_with_options.R | ||
# Author: Emmanuel Blondel <emmanuel.blondel1@gmail.com> | ||
# | ||
# Description: Integration tests for config_metadata_zenodo_with_options.json workflow | ||
#======================= | ||
require(geoflow, quietly = TRUE) | ||
require(testthat) | ||
|
||
#init | ||
test_that("init",{ | ||
testthat::skip_on_cran() | ||
cfg_file = system.file("extdata/workflows/config_metadata_zenodo_with_options.json", package = "geoflow") | ||
CFG <- geoflow::initWorkflow(cfg_file) | ||
expect_is(CFG$metadata$content, "list") | ||
expect_equal(length(CFG$metadata$content), 1L) | ||
expect_equal(names(CFG$metadata$content), "entities") | ||
expect_equal(length(CFG$metadata$content$entities), 1L) | ||
expect_equal(length(CFG$getEntities()), 1L) | ||
expect_equal(length(CFG$actions), 0L) | ||
expect_equal(length(CFG$software), 2L) | ||
expect_equal(names(CFG$software), c("input", "output")) | ||
expect_equal(length(CFG$software$input), 2L) | ||
expect_equal(length(CFG$software$output), 0L) | ||
expect_equal(names(CFG$software$input), c("zenodo", "zenodo_config")) | ||
}) | ||
|
||
#debug | ||
test_that("debug",{ | ||
testthat::skip_on_cran() | ||
cfg_file = system.file("extdata/workflows/config_metadata_zenodo_with_options.json", package = "geoflow") | ||
DEBUG <- geoflow::debugWorkflow(cfg_file, entityIndex = 1, dir = ".") | ||
expect_equal(names(DEBUG), c("config", "entity")) | ||
expect_is(DEBUG$config, "list") | ||
expect_is(DEBUG$entity, "geoflow_entity") | ||
expect_equal(DEBUG$entity$identifiers$doi, "10.5281/zenodo.3378733") | ||
}) | ||
|
||
#execute | ||
test_that("execute",{ | ||
#testthat::skip_on_cran() | ||
#cfg_file = system.file("extdata/workflows/config_metadata_zenodo_with_options.json", package = "geoflow") | ||
#execution | ||
#EXEC <- geoflow::executeWorkflow(cfg_file, dir = ".") | ||
#expect_true(dir.exists(EXEC)) | ||
#expect_true(file.exists(file.path(EXEC, "job.json"))) | ||
#expect_true(file.exists(file.path(EXEC, "job-logs.txt"))) | ||
}) |