Skip to content
Closed
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
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@
will consider reintroduction of log streaming via rsconnect in Connect Cloud.
(#1292)

* Updated non-streaming log retrieval to maintain compatibility with updates to
shinyapps.io's API. (#1294)

# rsconnect 1.7.0

* Added support for deploying from `manifest.json` files created by
Expand Down
2 changes: 1 addition & 1 deletion R/client-shinyapps.R
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ shinyAppsClient <- function(service, authInfo) {

getLogs = function(applicationId, entries = 50, format = NULL) {
path <- paste0("/applications/", applicationId, "/logs")
query <- paste0("count=", entries, "&tail=0")
query <- paste0("count=", entries)
if (!is.null(format)) {
# format=json returns a structured response.
query <- paste0(query, "&format=", format)
Expand Down
25 changes: 25 additions & 0 deletions tests/testthat/test-client.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,31 @@ test_that("connect cloud accounts create connect cloud clients", {
expect_equal(client$service(), "connect.posit.cloud")
})

test_that("shinyapps getLogs does not include tail in query", {
captured_query <- NULL
local_mocked_bindings(
GET = function(service, authInfo, path, query = NULL, ...) {
captured_query <<- query
"fake log output"
}
)

client <- shinyAppsClient(service = list(), authInfo = list())
client$getLogs("12345")
cat(captured_query)
expect_no_match(captured_query, "tail")
expect_match(captured_query, "count=50")

client$getLogs("12345", entries = 100)
expect_no_match(captured_query, "tail")
expect_match(captured_query, "count=100")

client$getLogs("12345", format = "json")
expect_no_match(captured_query, "tail")
expect_match(captured_query, "count=50")
expect_match(captured_query, "format=json")
})

test_that("connect accounts create connect clients", {
local_temp_config()

Expand Down
Loading