Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mllg committed Jul 25, 2019
1 parent fc896b3 commit ed75f69
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion man/batchtools-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PKG_CFLAGS=${R_DEBUG_FLAGS}
2 changes: 1 addition & 1 deletion tests/testthat/test_Algorithm.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ test_that("addAlgorithm", {
expect_is(algo, "Algorithm")
expect_equal(algo$name, "a1")
expect_function(algo$fun)
expect_file(getAlgorithmURI(reg, algo$name))
expect_file_exists(getAlgorithmURI(reg, algo$name))

prob = addProblem(reg = reg, "p1", data = iris, fun = function(job, data) nrow(data))
algo = addAlgorithm(reg = reg, "a2", fun = function(...) NULL)
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test_ExperimentRegistry.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ test_that("makeTestExperimentRegistry", {
expect_is(reg, "Registry")
expect_is(reg, "ExperimentRegistry")
expect_true(is.environment(reg))
expect_directory(reg$file.dir, access = "rw")
expect_directory(reg$work.dir, access = "r")
expect_directory(fs::path(reg$file.dir, c("jobs", "results", "updates", "logs")))
expect_directory_exists(reg$file.dir, access = "rw")
expect_directory_exists(reg$work.dir, access = "r")
expect_directory_exists(fs::path(reg$file.dir, c("jobs", "results", "updates", "logs")))
expect_file(fs::path(reg$file.dir, "registry.rds"))
expect_character(reg$packages, any.missing = FALSE)
expect_character(reg$namespaces, any.missing = FALSE)
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test_JobCollection.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ test_that("makeJobCollection", {
jc = makeJobCollection(ids, resources = list(foo = 42), reg = reg)
expect_environment(jc, c("file.dir", "job.hash", "jobs", "log.file", "packages", "resources", "uri", "work.dir"))

expect_directory(jc$file.dir)
expect_directory_exists(jc$file.dir)
expect_string(jc$job.hash, pattern = "^job[[:alnum:]]{32}$")
expect_data_table(jc$jobs, key = "job.id")
expect_string(jc$log.file)
expect_character(jc$packages, any.missing = FALSE)
expect_list(jc$resources, names = "unique")
expect_string(jc$uri)
expect_directory(jc$work.dir)
expect_directory_exists(jc$work.dir)
expect_list(jc$jobs$job.pars)
expect_string(jc$array.var, na.ok = TRUE)
expect_flag(jc$array.jobs)
Expand Down Expand Up @@ -47,14 +47,14 @@ test_that("makeJobCollection.ExperimentCollection", {

jc = makeJobCollection(ids, resources = list(foo = 42), reg = reg)

expect_directory(jc$file.dir)
expect_directory_exists(jc$file.dir)
expect_string(jc$job.hash, pattern = "^job[[:alnum:]]{32}$")
expect_data_table(jc$jobs, key = "job.id")
expect_string(jc$log.file)
expect_character(jc$packages, any.missing = FALSE)
expect_list(jc$resources, names = "unique")
expect_string(jc$uri)
expect_directory(jc$work.dir)
expect_directory_exists(jc$work.dir)
expect_list(jc$jobs$prob.pars)
expect_list(jc$jobs$algo.pars)
expect_character(jc$jobs$problem)
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test_Problem.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("addProblem / removeProblem", {
expect_equal(prob$name, "p1")
expect_function(prob$fun)
expect_null(prob$seed)
expect_file(getProblemURI(reg, prob$name))
expect_file_exists(getProblemURI(reg, prob$name))
expect_false(prob$cache)
expect_false(fs::dir_exists(getProblemCacheDir(reg, "p1")))

Expand All @@ -18,7 +18,7 @@ test_that("addProblem / removeProblem", {
expect_equal(prob$name, "p2")
expect_function(prob$fun)
expect_identical(prob$seed, 42L)
expect_file(getProblemURI(reg, prob$name))
expect_file_exists(getProblemURI(reg, prob$name))
expect_true(prob$cache)
expect_directory_exists(getProblemCacheDir(reg, "p2"))

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test_Registry.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ test_that("makeRegistry", {
reg = makeTestRegistry()
expect_is(reg, "Registry")
expect_true(is.environment(reg))
expect_directory(reg$file.dir, access = "rw")
expect_directory(reg$work.dir, access = "r")
expect_directory(fs::path(reg$file.dir, c("jobs", "results", "updates", "logs")))
expect_file(fs::path(reg$file.dir, "registry.rds"))
expect_directory_exists(reg$file.dir, access = "rw")
expect_directory_exists(reg$work.dir, access = "r")
expect_directory_exists(fs::path(reg$file.dir, c("jobs", "results", "updates", "logs")))
expect_file_exists(fs::path(reg$file.dir, "registry.rds"))
expect_character(reg$packages, any.missing = FALSE)
expect_character(reg$namespaces, any.missing = FALSE)
expect_int(reg$seed, na.ok = FALSE)
Expand Down

0 comments on commit ed75f69

Please sign in to comment.