Skip to content

Commit

Permalink
fix: dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
be-marc committed Jun 12, 2024
1 parent 0de33b2 commit f3b1753
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
3 changes: 3 additions & 0 deletions man/Codomain.Rd

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

13 changes: 9 additions & 4 deletions tests/testthat/test_OptimizerAsync.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ test_that("OptimizerAsync starts local workers", {
skip_on_cran()
skip_if_not_installed("rush")
flush_redis()
library(rush)

rush::rush_plan(n_workers = 2)
rush_plan(n_workers = 2)

instance = oi_async(
objective = OBJ_2D,
Expand All @@ -22,12 +23,14 @@ test_that("OptimizerAsync starts local workers", {
test_that("OptimizerAsync starts remote workers", {
skip_on_cran()
skip_if_not_installed("rush")
skip_if_not_installed("processx")
flush_redis()
library(processx)

rush = rsh(network_id = "test_rush")
expect_snapshot(rush$create_worker_script())

px = processx::process$new("Rscript",
px = process$new("Rscript",
args = c("-e", 'rush::start_worker(network_id = "test_rush", remote = TRUE, url = "redis://127.0.0.1:6379", scheme = "redis", host = "127.0.0.1", port = "6379")'),
supervise = TRUE,
stderr = "|", stdout = "|")
Expand Down Expand Up @@ -58,8 +61,9 @@ test_that("OptimizerAsync assigns result", {
skip_on_cran()
skip_if_not_installed("rush")
flush_redis()
library(rush)

rush::rush_plan(n_workers = 2)
rush_plan(n_workers = 2)

instance = oi_async(
objective = OBJ_2D,
Expand All @@ -78,8 +82,9 @@ test_that("OptimizerAsync throws an error when all workers are lost", {
skip_on_cran()
skip_if_not_installed("rush")
flush_redis()
library(rush)

rush::rush_plan(n_workers = 2)
rush_plan(n_workers = 2)

objective = ObjectiveRFun$new(
fun = function(xs) {
Expand Down

0 comments on commit f3b1753

Please sign in to comment.