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

PR for comparison - testing tests@main #755

Closed
wants to merge 10 commits into from
Closed
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
57 changes: 3 additions & 54 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
push:
branches:
- main
- testing_tests@main
workflow_dispatch:

jobs:
Expand All @@ -28,7 +29,7 @@ jobs:
additional-env-vars: |
_R_CHECK_CRAN_INCOMING_REMOTE_=false
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=11
TESTING_DEPTH=5
TESTING_DEPTH=4
additional-r-cmd-check-params: --as-cran
enforce-note-blocklist: true
note-blocklist: |
Expand All @@ -50,7 +51,7 @@ jobs:
with:
additional-env-vars: |
_R_CHECK_EXAMPLE_TIMING_THRESHOLD_=11
TESTING_DEPTH=5
TESTING_DEPTH=4
enforce-note-blocklist: true
publish-unit-test-report-gh-pages: false
junit-xml-comparison: false
Expand All @@ -66,55 +67,3 @@ jobs:
checking Rd .usage sections .* NOTE
checking for unstated dependencies in vignettes .* NOTE
checking top-level files .* NOTE
coverage:
name: Coverage 📔
uses: insightsengineering/r.pkg.template/.github/workflows/test-coverage.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
linter:
if: github.event_name != 'push'
name: SuperLinter 🦸‍♀️
uses: insightsengineering/r.pkg.template/.github/workflows/linter.yaml@main
roxygen:
name: Roxygen 🅾
uses: insightsengineering/r.pkg.template/.github/workflows/roxygen.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
with:
auto-update: true
gitleaks:
name: gitleaks 💧
uses: insightsengineering/r.pkg.template/.github/workflows/gitleaks.yaml@main
spelling:
name: Spell Check 🆎
uses: insightsengineering/r.pkg.template/.github/workflows/spelling.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
links:
if: github.event_name != 'push'
name: Check URLs 🌐
uses: insightsengineering/r.pkg.template/.github/workflows/links.yaml@main
vbump:
name: Version Bump 🤜🤛
if: github.event_name == 'push'
uses: insightsengineering/r.pkg.template/.github/workflows/version-bump.yaml@main
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
version:
name: Version Check 🏁
uses: insightsengineering/r.pkg.template/.github/workflows/version.yaml@main
licenses:
name: License Check 🃏
uses: insightsengineering/r.pkg.template/.github/workflows/licenses.yaml@main
style:
if: github.event_name != 'push'
name: Style Check 👗
uses: insightsengineering/r.pkg.template/.github/workflows/style.yaml@main
with:
auto-update: true
secrets:
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
grammar:
if: github.event_name != 'push'
name: Grammar Check 🔤
uses: insightsengineering/r.pkg.template/.github/workflows/grammar.yaml@main
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Type: Package
Package: teal.modules.general
Title: General Modules for 'teal' Applications
Version: 0.3.0.9029
Date: 2024-04-29
Date: 2024-05-15
Authors@R: c(
person("Dawid", "Kaledkowski", , "dawid.kaledkowski@roche.com", role = c("aut", "cre")),
person("Pawel", "Rucki", , "pawel.rucki@roche.com", role = "aut"),
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/helper-testing-depth.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ get_testing_depth <- function() {
#' By default `depth` argument lower or equal to 3 will not be skipped because by default `TESTING_DEPTH`
#' is equal to 3. To skip <= 3 depth tests then the environment variable has to be lower than 3 respectively.
skip_if_too_deep <- function(depth) { # nolintr
checkmate::assert_numeric(depth, len = 1, lower = 0, upper = 5)
checkmate::assert_numeric(depth, len = 1, lower = 0, upper = 6)
testing_depth <- get_testing_depth() # by default 3 if there are no env variable
if (testing_depth < depth) {
testthat::skip(paste("testing depth", testing_depth, "is below current testing specification", depth))
Expand Down
13 changes: 7 additions & 6 deletions tests/testthat/test-shinytest2-tm_front_page.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
app_driver_tm_front_page <- function() {
data <- simple_cdisc_data()
data <- within(data, {
attr(ADSL, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data")
data <- within(teal_data(), {
mtcars = mtcars
IRIS = iris
attr(IRIS, "metadata") <- list("Author" = "NEST team", "data_source" = "synthetic data")
})

init_teal_app_driver(
Expand All @@ -22,7 +23,7 @@ app_driver_tm_front_page <- function() {
}

test_that("e2e - tm_front_page: Initializes without errors and check html elements", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_front_page()

app_driver$expect_no_shiny_error()
Expand All @@ -46,7 +47,7 @@ test_that("e2e - tm_front_page: Initializes without errors and check html elemen
})

test_that("e2e - tm_front_page: Verify the module displays tables", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_front_page()
# tables
testthat::expect_match(app_driver$get_active_module_output("table_1"), "MTCARS")
Expand All @@ -58,7 +59,7 @@ test_that("e2e - tm_front_page: Verify the module displays tables", {
})

test_that("e2e - tm_front_page: Verify the module displays metadata", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_front_page()

# show metadata
Expand Down
18 changes: 10 additions & 8 deletions tests/testthat/test-shinytest2-tm_misssing_data.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
app_driver_tm_missing_data <- function() {
data <- within(simple_teal_data(), {

data <- within(teal_data(), {
mtcars = mtcars
IRIS = iris
set.seed(123)
require(nestcolor)

add_nas <- function(x) {
x[sample(seq_along(x), floor(length(x) * runif(1, .05, .17)))] <- NA
Expand Down Expand Up @@ -37,7 +39,7 @@ app_driver_tm_missing_data <- function() {
}

test_that("e2e - tm_missing_data: Initializes without errors", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_missing_data()

app_driver$expect_no_shiny_error()
Expand All @@ -58,14 +60,14 @@ test_that("e2e - tm_missing_data: Initializes without errors", {
})

test_that("e2e - tm_missing_data: Default settings and visibility of the summary graph", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_missing_data()
# default summary tab
testthat::expect_equal(
app_driver$get_active_module_input("iris-summary_type"),
"Summary"
)

cat("iris-variables_select:", app_driver$get_active_module_input("iris-variables_select"), "\n")
testthat::expect_setequal(
app_driver$get_active_module_input("iris-variables_select"),
c("Petal.Length", "Sepal.Length", "Petal.Width", "Species", "Sepal.Width")
Expand All @@ -87,7 +89,7 @@ test_that("e2e - tm_missing_data: Default settings and visibility of the summary
})

test_that("e2e - tm_missing_data: Check default settings and visibility of the combinations graph and encodings", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_missing_data()

app_driver$expect_no_shiny_error()
Expand Down Expand Up @@ -118,7 +120,7 @@ test_that("e2e - tm_missing_data: Check default settings and visibility of the c
})

test_that("e2e - tm_missing_data: Validate functionality and UI response for 'By Variable Levels'", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_missing_data()
# By variable levels
app_driver$set_active_module_input("iris-summary_type", "By Variable Levels")
Expand Down Expand Up @@ -148,7 +150,7 @@ test_that("e2e - tm_missing_data: Validate functionality and UI response for 'By
})

test_that("e2e - tm_missing_data: Validate 'By Variable Levels' table values", {
skip_if_too_deep(5)
skip_if_too_deep(4)
app_driver <- app_driver_tm_missing_data()

app_driver$set_active_module_input("iris-summary_type", "By Variable Levels")
Expand Down
Loading