Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # This file is part of the standard setup for testthat.
  > # It is recommended that you do not modify it.
  > #
  > # Where should you do additional test configuration?
  > # Learn more about the roles of various files in:
  > # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
  > # * https://testthat.r-lib.org/articles/special-files.html
  > 
  > library(testthat)
  > library(finna)
  > 
  > test_check("finna")
  Saving _problems/test-fetch_finna-4.R
  Saving _problems/test-fetch_finna-20.R
  Saving _problems/test-fetch_finna-27.R
  Saving _problems/test-get_finna_records-7.R
  Saving _problems/test-search_publisher-4.R
  Saving _problems/test-search_publisher-5.R
  Saving _problems/test_search_finna-4.R
  Saving _problems/test_search_finna-5.R
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 31 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-fetch_finna.R:4:3'): fetch_finna performs a basic fetch correctly ──
  Error in `fetch_finna(query = "record_format:ead", limit = 10)`: API request failed. Status code: 403
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-fetch_finna.R:4:3
   2. │ └─base::withCallingHandlers(...)
   3. └─finna::fetch_finna(query = "record_format:ead", limit = 10)
  ── Error ('test-fetch_finna.R:20:3'): fetch_finna handles empty facet data ─────
  Error in `fetch_finna(query = "nonexistent_query")`: API request failed. Status code: 403
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(fetch_finna(query = "nonexistent_query")) at test-fetch_finna.R:20:3
   2. │ └─base::withCallingHandlers(...)
   3. └─finna::fetch_finna(query = "nonexistent_query")
  ── Error ('test-fetch_finna.R:27:3'): fetch_finna handles parameters correctly ──
  Error in `fetch_finna(query = "record_format:ead", limit = 5)`: API request failed. Status code: 403
  Backtrace:
      ▆
   1. ├─base::suppressWarnings(...) at test-fetch_finna.R:27:3
   2. │ └─base::withCallingHandlers(...)
   3. └─finna::fetch_finna(query = "record_format:ead", limit = 5)
  ── Error ('test-get_finna_records.R:7:3'): get_finna_records function handles various cases correctly ──
  Error in `get_finna_records(record_id)`: Failed to retrieve the records. Status code:403- Response:<!DOCTYPE html><html lang="en-US"><head><title>Just a moment...</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=Edge"><meta name="robots" content="noindex,nofollow"><meta name="viewport" content="width=device-width,initial-scale=1"><meta http-equiv="content-security-policy" content="default-src &#39;none&#39;; script-src &#39;nonce-DljcnsFDzyOJojNMfBEFRh&#39; &#39;unsafe-eval&#39; https://challenges.cloudflare.com; script-src-attr &#39;none&#39;; style-src &#39;unsafe-inline&#39;; img-src &#39;self&#39; https://challenges.cloudflare.com; connect-src &#39;self&#39; https://challenges.cloudflare.com; frame-src &#39;self&#39; https://challenges.cloudflare.com blob:; child-src &#39;self&#39; https://challenges.cloudflare.com blob:; worker-src blob:; form-action http: https:; base-uri &#39;self&#39;"><style>*{box-sizing:border-box;margin:0;padding:0}html{line-height:1.15;-webkit-text-size-adjust:100%;color:#313131;font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}body{display:flex;flex-direction:column;height:100vh;min-height:100vh}.main-content{margin:8rem auto;padding-left:1.5rem;max-width:60rem}@media (width <= 720px){.main-content{margin-top:4rem}}#challenge-error-text{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0IyMEYwMyIgZD0iTTE2IDNhMTMgMTMgMCAxIDAgMTMgMTNBMTMuMDE1IDEzLjAxNSAwIDAgMCAxNiAzbTAgMjRhMTEgMTEgMCAxIDEgMTEtMTEgMTEuMDEgMTEuMDEgMCAwIDEtMTEgMTEiLz48cGF0aCBmaWxsPSIjQjIwRjAzIiBkPSJNMTcuMDM4IDE4LjYxNUgxNC44N0wxNC41NjMgOS41aDIuNzgzem0tMS4wODQgMS40MjdxLjY2IDAgMS4wNTcuMzg4LjQwNy4zODkuNDA3Ljk5NCAwIC41OTYtLjQwNy45ODQtLjM5Ny4zOS0xLjA1Ny4zODktLjY1IDAtMS4wNTYtLjM4OS0uMzk4LS4zODktLjM5OC0uOTg0IDAtLjU5Ny4zOTgtLjk4NS40MDYtLjM5NyAxLjA1Ni0uMzk3Ii8+PC9zdmc+");background-repeat:no-repeat;background-size:contain;padding-left:34px}</style><meta http-equiv="refresh" content="360"></head><body><div class="main-wrapper" role="main"><div class="main-content"><noscript><div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div></noscript></div></div><script nonce="DljcnsFDzyOJojNMfBEFRh">(function(){window._cf_chl_opt = {cFPWv: 'g',cH: 'p6ZHGm1WLf__jdchB6Rw5y_WDi8lDDNk5dpUDu468eU-1781583805-1.2.1.1-.tZVdNH9WP5ef2TvxUy8lNhQ9Pg3Sm5Tw5A80vSN21qDCGSDM.YTgOr1.foEdERt',cITimeS: '1781583805',cN: 'DljcnsFDzyOJojNMfBEFRh',cRay: 'a0c709fe5e6cde06',cTplB: '0',cTplC:0,cTplO:0,cTplV:5,cType: 'managed',cUPMDTk:"/v1/record?prettyPrint=FALSE\u0026lng=fi\u0026page=1\u0026limit=100\u0026id%5B%5D=fikka.3405646\u0026__cf_chl_tk=HAUi.nfPMQXHGq9mO.DZHZEsxqraX1AVfibuN0VnoDw-1781583805-1.0.1.1-gtsxyp8CJjVN54fjr.WgGfqQ1fJdRpb70f0h00Emq08",cvId: '3',cZone: 'api.finna.fi',fa:"/v1/record?prettyPrint=FALSE\u0026lng=fi\u0026page=1\u0026limit=100\u0026id%5B%5D=fikka.3405646\u0026__cf_chl_f_tk=HAUi.nfPMQXHGq9mO.DZHZEsxqraX1AVfibuN0VnoDw-1781583805-1.0.1.1-gtsxyp8CJjVN54fjr.WgGfqQ1fJdRpb70f0h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t1Sl1I37g.1nzsT9xAS59m3Iqlaa1EA8voqh0rbvNyRGXzm_u5tR4_B4iyMrwhVlXRg9i4c56g2HgaXXSwfQdO3IZD55H7kxSa3x9s4YsaDTspnpO8FPW6NICtpy_DXz7saztKLDrOlP8Ai0fsRwg5lUvFCVsegitGxs5lx0o45uffk8fA',mdrd: 'ijCCvNDhTMtajTGuMcPAIj0eYYzgFXrv8buvgS9QTic-1781583805-1.2.1.1-7SgjsaokfB0BACDQ.1iYQbhmwYta9zVStFY.aBCMow_xlD5bh6rtlkEeP6IRohV_ZzpgQWCxBs4KKZu666jWt4gKcZEme1PMOWhsD9Hqk8rO4BXQksSJe8cr3033uPDOb4E7QGD5OnP45u9utbUT1fKmcpuGf6tZNS9E8ALg9K4QVGvJJfl_.Yxx8.jekBYtvz4P9LUt8EV.lHx9xa_DaHCV4UzrrcASmJss2eSWa3k.smg8cClGYLZe_INDvB622o20KygZKWMOPQm4q2vroQ',};var a = document.createElement('script');a.nonce = 'DljcnsFDzyOJojNMfBEFRh';a.src = '/cdn-cgi/challenge-platform/h/g/orchestrate/chl_page/v1?ray=a0c709fe5e6cde06';window._cf_chl_opt.cOgUHash = location.hash === '' && location.href.indexOf('#') !== -1 ? '#' : location.hash;window._cf_chl_opt.cOgUQuery = location.search === '' && location.href.slice(0, location.href.length - window._cf_chl_opt.cOgUHash.length).indexOf('?') !== -1 ? '?' : location.search;if (window.history && window.history.replaceState) {var ogU = location.pathname + window._cf_chl_opt.cOgUQuery + window._cf_chl_opt.cOgUHash;history.replaceState(null, null,"/v1/record?prettyPrint=FALSE\u0026lng=fi\u0026page=1\u0026limit=100\u0026id%5B%5D=fikka.3405646\u0026__cf_chl_rt_tk=HAUi.nfPMQXHGq9mO.DZHZEsxqraX1AVfibuN0VnoDw-1781583805-1.0.1.1-gtsxyp8CJjVN54fjr.WgGfqQ1fJdRpb70f0h00Emq08"+ window._cf_chl_opt.cOgUHash);a.onload = function() {history.replaceState(null, null, ogU);}}document.getElementsByTagName('head')[0].appendChild(a);}());</script></body></html>
  Backtrace:
      ▆
   1. └─finna::get_finna_records(record_id) at test-get_finna_records.R:7:3
  ── Failure ('test-search_publisher.R:4:3'): search_publisher performs a basic search correctly ──
  Expected `is.data.frame(search_results)` to be TRUE.
  Differences:
  `actual`:   FALSE
  `expected`: TRUE 
  
  ── Error ('test-search_publisher.R:5:3'): search_publisher performs a basic search correctly ──
  Error in `expect_gt(nrow(search_results), 0)`: Result of comparison must be `TRUE`, `FALSE`, or `NA`
  Backtrace:
      ▆
   1. └─testthat::expect_gt(nrow(search_results), 0) at test-search_publisher.R:5:3
   2.   └─testthat:::expect_compare_(">", act, exp)
   3.     └─cli::cli_abort(...)
   4.       └─rlang::abort(...)
  ── Failure ('test_search_finna.R:4:3'): search_finna performs a basic search correctly ──
  Expected `is.data.frame(search_results)` to be TRUE.
  Differences:
  `actual`:   FALSE
  `expected`: TRUE 
  
  The result should be a data frame.
  ── Error ('test_search_finna.R:5:3'): search_finna performs a basic search correctly ──
  Error in `expect_gt(nrow(search_results), 0, "The number of rows should be greater than 0.")`: Result of comparison must be `TRUE`, `FALSE`, or `NA`
  Backtrace:
      ▆
   1. └─testthat::expect_gt(nrow(search_results), 0, "The number of rows should be greater than 0.") at test_search_finna.R:5:3
   2.   └─testthat:::expect_compare_(">", act, exp)
   3.     └─cli::cli_abort(...)
   4.       └─rlang::abort(...)
  
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 31 ]
  Error:
  ! Test failures.
  Execution halted