From 1ea5261d858c11b6bdfee10c4309a3c76a4a09b4 Mon Sep 17 00:00:00 2001 From: Rich Bielby Date: Tue, 12 Nov 2024 16:56:30 +0000 Subject: [PATCH] Removing GITHUB_PAT check test as GitHub actions won't return the environment variable to the test script --- R/diagnostic_test.R | 14 +++++--------- tests/testthat/test-diagnostic_test.R | 10 ---------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/R/diagnostic_test.R b/R/diagnostic_test.R index 5d11dfb..18bd405 100644 --- a/R/diagnostic_test.R +++ b/R/diagnostic_test.R @@ -92,16 +92,13 @@ check_proxy_settings <- function( #' #' @examples #' check_github_pat() -check_github_pat <- function(clean = FALSE, - verbose = FALSE) { - github_pat <- Sys.getenv("GITHUB_PAT", unset = NA) |> - stringr::str_replace_all(stringr::regex("\\W+"), "") +check_github_pat <- function( + clean = FALSE, + verbose = FALSE + ) { + github_pat <- Sys.getenv("GITHUB_PAT") # Replace above to remove non alphanumeric characters when run on GitHub # Actions - print(Sys.info()) - print(github_pat) - print(pillar::type_sum(github_pat)) - print(typeof(github_pat)) cat("==================================") if (!is.na(github_pat)) { message( @@ -120,7 +117,6 @@ check_github_pat <- function(clean = FALSE, } } else { message("PASS: The GITHUB_PAT system variable is clear.") - github_pat <- "" } return(list(GITHUB_PAT = github_pat)) } diff --git a/tests/testthat/test-diagnostic_test.R b/tests/testthat/test-diagnostic_test.R index fc0323c..2e3dbc5 100644 --- a/tests/testthat/test-diagnostic_test.R +++ b/tests/testthat/test-diagnostic_test.R @@ -31,16 +31,6 @@ test_that("Check proxy settings identifies and removes proxy setting", { ) }) -test_that("Test GITHUB_PAT diagnostic check", { - # Check that check_proxy_settings identifies the rogue entry - expect_equal( - check_github_pat( - clean = FALSE - ), - list(GITHUB_PAT = "") - ) -}) - test_that("Check RENV_DOWNLOAD_METHOD", { # Check that check_proxy_settings identifies the rogue entry expect_equal(