-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure tests to handle different environments
Tests should now run when: * OSF_SERVER is not "test" * a PAT is not registered
- Loading branch information
1 parent
704696d
commit 81cfe71
Showing
8 changed files
with
224 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# for tests that must be executed on test.osf.io | ||
on_test_server <- function() { | ||
Sys.getenv("OSF_SERVER") == "test" | ||
} | ||
|
||
skip_on_production_server <- function() { | ||
testthat::skip_if_not( | ||
on_test_server(), | ||
"OSF_SERVER not set to 'test'." | ||
) | ||
} | ||
|
||
|
||
# for tests that require authenticated access | ||
has_pat <- function() nzchar(Sys.getenv("OSF_PAT")) | ||
|
||
skip_if_no_pat <- function() { | ||
testthat::skip_if_not(has_pat(), "No PAT detected.") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.