Skip to content

Commit

Permalink
Properly handles lack of host or token
Browse files Browse the repository at this point in the history
  • Loading branch information
edgararuiz committed Sep 30, 2024
1 parent c5bfbcc commit 47de59a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
10 changes: 8 additions & 2 deletions R/board-databricks.R
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,14 @@ board_databricks <- function(
}

board_databricks_test <- function(prefix = NULL) {
testthat::skip_if(is.null(db_get_token()), message = "No Databricks credentials found")
testthat::skip_if(is.null(db_get_host()), message = "No Databricks host defined")
testthat::skip_if(
db_get_token(fail = FALSE) == "",
message = "No Databricks credentials found"
)
testthat::skip_if(
db_get_host(fail = FALSE) == "",
message = "No Databricks host defined"
)
skip_if_missing_envvars(
tests = "board_databricks()",
envvars = c("PINS_DATABRICKS_FOLDER_URL")
Expand Down
14 changes: 0 additions & 14 deletions tests/testthat/_snaps/board-databricks.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,3 @@
Pin board <pins_board_databricks>
Cache size: 0

# can find board required pkgs

Code
required_pkgs(board)
Output
[1] "httr2"

---

Code
required_pkgs(board)
Output
[1] "httr2"

0 comments on commit 47de59a

Please sign in to comment.