Skip to content

Commit

Permalink
Merge pull request #25 from conbench/fix-ci
Browse files Browse the repository at this point in the history
determine which line
  • Loading branch information
boshek authored Dec 12, 2023
2 parents 84c2f70 + 3c8eb98 commit 3afd01b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/not-logged-in/localhost/api/users.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
structure(list(method = "GET", url = "https://conbench.ursa.dev:443/api/users/",
structure(list(method = "GET", url = "https://conbench.ursa.dev:443/api/ping/",
status_code = 401L, headers = structure(list(date = "Fri, 18 Feb 2022 23:11:54 GMT",
`content-type` = "application/json", `content-length` = "37",
server = "gunicorn"), class = "httr2_headers"), body = charToRaw("{\"code\": 401, \"name\": \"Unauthorized\"}")), class = "httr2_response")
8 changes: 3 additions & 5 deletions tests/testthat/test-session.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ test_that("get_config errors when it has no environment variables",{

with_mock_dir(test_path("not-logged-in"), {
test_that("Can log in", {
testthat::skip_if_not(Sys.getenv("GITHUB_ACTIONS") == "true")
expect_null(.conbench_session$cookie)
resp <- request("http://localhost/api") |>
expect_error(resp <- request("http://localhost/api") |>
req_url_path_append("users") |>
conbench_perform()
# This is still a 401 becuase httptest2 only has one possible response for users
expect_identical(resp_status(resp), 401L)
expect_identical(.conbench_session$cookie, "REDACTED")
conbench_perform())
})
})

Expand Down

0 comments on commit 3afd01b

Please sign in to comment.