Skip to content

Commit

Permalink
Merge branch 'benchmark' into feature/simplify_update_snapshot
Browse files Browse the repository at this point in the history
  • Loading branch information
RasmusSkytte committed Mar 12, 2024
2 parents 2d3addb + d5efb8c commit f0894e5
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions data-raw/benchmark_update_snapshot.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ withr::local_options("odbc.batch_rows" = 1000)
# Load the connection helper
source("tests/testthat/helper-setup.R")

# Install all needed package versions
for (version in c("CRAN", "main", "branch")) {
branch <- system("git symbolic-ref --short HEAD", intern = TRUE)
if (version == "branch" && branch == "main") {
Expand All @@ -16,6 +17,21 @@ for (version in c("CRAN", "main", "branch")) {
)

pak::pkg_install(source, lib = glue::glue("SCDB_installation/{source}"))
}

# Then loop over each and benchmark the update_snapshot function
for (version in c("CRAN", "main", "branch")) {
branch <- system("git symbolic-ref --short HEAD", intern = TRUE)
if (version == "branch" && branch == "main") {
next
}

source <- dplyr::case_when(
version == "CRAN" ~ "SCDB",
version == "main" ~ "ssi-dk/SCDB",
version == "branch" ~ glue::glue("ssi-dk/SCDB@{branch}")
)

library("SCDB", lib.loc = glue::glue("SCDB_installation/{source}"))

try({
Expand Down

0 comments on commit f0894e5

Please sign in to comment.