R Under development (unstable) (2026-01-23 r89325 ucrt) -- "Unsuffered Consequences" Copyright (C) 2026 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library("testthat") > library("elastic") > > port <- Sys.getenv("CI_ES_PORT", "9200") > Sys.setenv(TEST_ES_PORT = port) > > x <- elastic::connect(port = Sys.getenv("TEST_ES_PORT")) > try_conn <- tryCatch(x$ping(), error = function(e) e) > > if (inherits(try_conn, "error")) { + + cat("Elasticsearch not available, skipping tests") + + } else { + + if (x$es_ver() < 600) { + + shakespeare <- system.file("examples", "shakespeare_data.json", package = "elastic") + + } else { + + shakespeare <- system.file("examples", "shakespeare_data_.json", package = "elastic") + + } + + # clean up any remnants + unlink(list.files(tempdir(), pattern = "elastic__", full.names = TRUE), force = TRUE) + + invisible(elastic::docs_bulk(x, shakespeare)) + + plos <- system.file("examples", "plos_data.json", package = "elastic") + invisible(elastic::docs_bulk(x, plos)) + + omdb <- system.file("examples", "omdb.json", package = "elastic") + invisible(elastic::docs_bulk(x, omdb)) + + test_check("elastic") + } Elasticsearch not available, skipping tests> > proc.time() user system elapsed 0.53 0.18 2.73