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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: audit.connect
Title: Posit Connect Health Check
Version: 0.8.6
Version: 0.8.7
Authors@R:
person("Jumping", "Rivers", , "info@jumpingrivers.com", role = c("aut", "cre"))
Description: Posit Connect Health Check. Deploys various content types to
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# audit.connect 0.8.7

## Bug fixes and minor improvements

* The tests that deploy to `CONNECT_SERVER` only run when `AUDIT_CONNECT_LIVE` is `true`, so `devtools::test()` no longer deploys to whichever server is set (#68).

# audit.connect 0.8.6

## Bug fixes and minor improvements
Expand Down
10 changes: 10 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,13 @@ example_test = function() {
return(TRUE)
}
```

## Running the tests

`test-check.R` and `test-sanitise.R` deploy test content to the server in `CONNECT_SERVER`, so they
are skipped unless `AUDIT_CONNECT_LIVE` is `true`:

```r
Sys.setenv(AUDIT_CONNECT_LIVE = "true")
devtools::test()
```
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@ example_test = function() {
return(TRUE)
}
```

## Running the tests

`test-check.R` and `test-sanitise.R` deploy test content to the server in `CONNECT_SERVER`, so they
are skipped unless `AUDIT_CONNECT_LIVE` is `true`:

```r
Sys.setenv(AUDIT_CONNECT_LIVE = "true")
devtools::test()
```
7 changes: 7 additions & 0 deletions tests/testthat/helper-live.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# These tests deploy to CONNECT_SERVER, so they only run when asked
skip_if_not_live = function() {
testthat::skip_if_not(
identical(Sys.getenv("AUDIT_CONNECT_LIVE"), "true"),
"set AUDIT_CONNECT_LIVE=true to deploy to CONNECT_SERVER"
)
}
9 changes: 5 additions & 4 deletions tests/testthat/test-check.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
test_that("High level test", {
testthat::skip_on_ci()
create_config(default = TRUE)
expect_error(check(server = "aaa.bbb"))
skip_if_not_live()
dir = withr::local_tempdir()
create_config(dir = dir, default = TRUE)
expect_error(check(server = "aaa.bbb", dir = dir))
# Run standard check
rtn = suppressMessages(check())
rtn = suppressMessages(check(dir = dir))

expect_true(is.list(rtn))
check_names = c(
Expand Down
7 changes: 4 additions & 3 deletions tests/testthat/test-sanitise.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
describe("Checking sanitize function", {
testthat::skip_on_ci()
skip_if_not_live()
dir = withr::local_tempdir()
# Skip report checks for speed
create_config(default = FALSE, type = "force")
rtn = suppressMessages(check())
create_config(dir = dir, default = FALSE, type = "force")
rtn = suppressMessages(check(dir = dir))
sanitize_rtn = sanitise(rtn)

it(
Expand Down
Loading