Skip to content

Commit

Permalink
fix testing
Browse files Browse the repository at this point in the history
  • Loading branch information
zsigmas committed Jan 16, 2025
1 parent d5dac98 commit dd31182
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 16 deletions.
30 changes: 20 additions & 10 deletions tests/testthat/test-app_server.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)


Expand Down Expand Up @@ -45,7 +46,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)

shiny::testServer(app_server_test(testing_options), {
Expand All @@ -63,7 +65,8 @@ test_that(
{
testing_options <- list(
data = list(),
module_info = resolve_module_list(list("mod_1" = mod_identity(1, "mod_1"), "mod_2" = mod_identity(2, "mod_2")))
module_info = resolve_module_list(list("mod_1" = mod_identity(1, "mod_1"), "mod_2" = mod_identity(2, "mod_2"))),
use_dataset_filter = FALSE
)

shiny::testServer(app_server_test(testing_options), {
Expand All @@ -84,7 +87,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)

shiny::testServer(app_server_test(testing_options), {
Expand All @@ -104,7 +108,8 @@ test_that(
data = list(),
filter_data = NULL,
module_info = resolve_module_list(list("mod_1" = mod_identity(1, mod_id = "mod_1"))),
filter_key = NULL
filter_key = NULL,
use_dataset_filter = FALSE
)

testServer(app_server_test(testing_options), {
Expand All @@ -119,7 +124,8 @@ test_that(
testing_options <- list(
data = list(),
module_info = resolve_module_list(list()),
filter_key = NULL
filter_key = NULL,
use_dataset_filter = FALSE
)
shiny::testServer(app_server_test(testing_options), {
}) %>%
Expand Down Expand Up @@ -157,7 +163,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)

withr::local_locale(.new = list("LC_TIME" = "en_US.UTF-8"))
Expand Down Expand Up @@ -195,7 +202,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)

withr::local_locale(.new = list("LC_TIME" = "en_US.UTF-8"))
Expand Down Expand Up @@ -236,7 +244,8 @@ test_that(
data = datasets,
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg"
filter_key = "mpg",
use_dataset_filter = FALSE
)

withr::local_locale(.new = list("LC_TIME" = "en_US.UTF-8"))
Expand Down Expand Up @@ -269,7 +278,8 @@ test_that(
filter_data = "a",
module_info = resolve_module_list(list()),
filter_key = "mpg",
reload_period = lubridate::duration(1, "seconds")
reload_period = lubridate::duration(1, "seconds"),
use_dataset_filter = FALSE
)
withr::with_dir(tempdir(), {
system2(command = "touch", args = c("restart.txt"), stdout = TRUE)
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-bugs.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ test_that("values are returned when datafilter returns are false", {
data = datasets,
filter_data = "a",
module_list = list(),
use_dataset_filter = FALSE,
filter_key = "mpg" # This filter key is not really good as it is not unique!
)

Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-dv.loader_integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ test_that(
"id_1"
)
),
filter_key = "car"
filter_key = "car",
use_dataset_filter = FALSE
)


Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-functional_testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ local({
"id_1"
)
)),
filter_key = "car"
filter_key = "car",
use_dataset_filter = FALSE
)


Expand Down Expand Up @@ -178,7 +179,8 @@ local({
"id_1"
)
),
filter_key = "car"
filter_key = "car",
use_dataset_filter = FALSE
)


Expand Down
9 changes: 6 additions & 3 deletions tests/testthat/test-module_communication.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ test_that(
value = mm_dispatch("module_output", "mod_1"),
mod_id = "mod_2"
)
))
)),
use_dataset_filter = FALSE
)


Expand Down Expand Up @@ -57,7 +58,8 @@ test_that(
value = mm_dispatch("module_output", "mod_1"),
mod_id = "mod_2"
)
))
)),
use_dataset_filter = FALSE
)


Expand Down Expand Up @@ -93,7 +95,8 @@ test_that(
value = mm_dispatch("module_output", c("mod_1", "mod_3")),
mod_id = "mod_2"
)
))
)),
use_dataset_filter = FALSE
)


Expand Down

0 comments on commit dd31182

Please sign in to comment.