Skip to content

Commit ee15252

Browse files
change base image to inwt/r-shiny:4.3.2 (#10)
* change base image to inwt/r-shiny:4.3.2 * fix RCMD Check - add || to namespace * fix RCMD Check - add rlang to DESCRIPTION * test only shorter error message * fix test --------- Co-authored-by: Antonia Runge <antonia.runge@inwt-statistics.de>
1 parent fc2366e commit ee15252

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Imports:
1717
data.table,
1818
futile.logger,
1919
httr2,
20+
rlang,
2021
shiny,
2122
shinyAce,
2223
shinyjs,
@@ -29,6 +30,6 @@ Suggests:
2930
rmarkdown
3031
Remotes:
3132
ollamar=hauselin/ollama-r@v1.2.2
32-
RoxygenNote: 7.3.1
33+
RoxygenNote: 7.3.2
3334
VignetteBuilder: knitr
3435
URL: https://pandora-isomemo.github.io/llmModule/

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM ghcr.io/pandora-isomemo/base-image:latest
1+
FROM inwt/r-shiny:4.3.2
2+
3+
RUN echo "options(repos = c(getOption('repos'), PANDORA = 'https://Pandora-IsoMemo.github.io/drat/'))" >> /usr/local/lib/R/etc/Rprofile.site
24

35
ADD . .
46

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ importFrom(httr2,req_perform)
3636
importFrom(httr2,req_timeout)
3737
importFrom(httr2,request)
3838
importFrom(httr2,resp_body_json)
39+
importFrom(rlang,"%||%")
3940
importFrom(shinyAce,aceEditor)
4041
importFrom(shinyAce,updateAceEditor)
4142
importFrom(shinyTools,shinyTryCatch)

R/00-Namespace.R

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#'
33
#' @importFrom data.table data.table rbindlist
44
#' @importFrom httr2 req_body_json req_headers req_perform req_timeout request resp_body_json
5+
#' @importFrom rlang %||%
56
#' @importFrom shinyAce aceEditor updateAceEditor
67
#' @importFrom shinyjs disable enable
78
#' @importFrom shinyTools shinyTryCatch

tests/testthat/test-llm_api_server.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ testthat::test_that("Test llm_api_server with too short OpenAI key", {
1919
row.names = c(NA, -1L)
2020
)
2121
)
22-
testthat::expect_equal(api(), structure(list(), error = "API key appears too short."))
22+
testthat::expect_length(api(), 0)
23+
testthat::expect_equal(attr(api(), "error"), "API key appears too short.")
2324
})
2425
})
2526

@@ -28,7 +29,7 @@ testthat::test_that("Test llm_api_server with OpenAI key", {
2829
args = list(no_internet = NULL, exclude_pattern = ""),
2930
{
3031
# Arrange
31-
print("test llm_api_server: OpenAI provider with valid key file")
32+
print("test llm_api_server: OpenAI provider with invalid key file")
3233

3334
# Act
3435
session$setInputs(
@@ -45,9 +46,10 @@ testthat::test_that("Test llm_api_server with OpenAI key", {
4546
)
4647
)
4748

49+
testthat::expect_length(api(), 0)
4850
testthat::expect_equal(
49-
api(),
50-
structure(list(), error = "API request failed: Unauthorized: API key is invalid or expired.\n• OAuth error\n• realm: OpenAI API")
51+
substr(attr(api(), "error"), 1, 64),
52+
"API request failed: Unauthorized: API key is invalid or expired."
5153
)
5254
})
5355
})

0 commit comments

Comments
 (0)