Skip to content
Merged
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
8 changes: 5 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ License: MIT
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
Depends:
R (>= 4.3.0)
Imports:
S7,
httr2,
S7 (>= 0.2.0),
httr2 (>= 1.2.0),
askpass,
purrr,
cli,
dplyr,
rlang,
curl,
curl (>= 7.0.0),
tibble
Collate:
'api-helpers.R'
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/helper-integration.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ skip_if_not_e2e <- function() {
}

# Require key
if (!nzchar(Sys.getenv("ZHAPIR_API_KEY"))) {
if (!nzchar(Sys.getenv("MDV_DEV_API_TOKEN_TEST"))) {
testthat::skip("ZHAPIR_API_KEY missing; cannot run end-to-end tests.")
}
}


skip_if_no_api_key <- function() {
if (nzchar(Sys.getenv("ZHAPIR_API_KEY")) == FALSE)
if (nzchar(Sys.getenv("MDV_DEV_API_TOKEN_TEST")) == FALSE)
skip("no ZHAPIR_API_KEY; skipping integration tests")
}
9 changes: 9 additions & 0 deletions tests/testthat/test-e2e-user-flows.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
testthat::local_mocked_bindings(
get_api_key = function(key = NULL) {
tok <- base::Sys.getenv("MDV_DEV_API_TOKEN_TEST")
if (!base::nzchar(tok)) base::stop("MDV_DEV_API_TOKEN_TEST not set")
tok
},
.package = "zhapir"
)

test_that("E2E: distribution cannot exceed dataset status", {
skip_if_not_e2e()

Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/test-integration-api.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
testthat::local_mocked_bindings(
get_api_key = function(key = NULL) {
tok <- base::Sys.getenv("MDV_DEV_API_TOKEN_TEST")
if (!base::nzchar(tok)) base::stop("MDV_DEV_API_TOKEN_TEST not set")
tok
},
.package = "zhapir"
)

test_that("convert_keywords_to_id actually finds known keywords", {
skip_if_not_e2e()
# This will do a real GET /keywords
Expand Down