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-taZ2rTqtXd4PihGAqTBAKa&#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="taZ2rTqtXd4PihGAqTBAKa">(function(){window._cf_chl_opt = {cFPWv: 'g',cH: '01brp_xN.HTGWJFmT3GdWkMvI07i4k8bIT7SJXVIdVU-1781583847-1.2.1.1-I8pcyUVWLhZ0D2Z8CKaExoFaL9sP_Uk5o75MDj0pWVweqZugqGGXXA52EeSvQneV',cITimeS: '1781583847',cN: 'taZ2rTqtXd4PihGAqTBAKa',cRay: 'a0c70b060f27f816',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=slrDy3Qwxh30_Qngpb7b4Xt1fpVK.vhMdbIdGl.tzII-1781583847-1.0.1.1-aGXHPzDgyXIRxGVDzCuYNhmWgSPqCwNl3RFcZ_hAWOQ",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=slrDy3Qwxh30_Qngpb7b4Xt1fpVK.vhMdbIdGl.tzII-1781583847-1.0.1.1-aGXHPzDgyXIRxGVDzCuYNhmWgSPqCwNl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NHBIAw3v2dr.h_i1cL1p20u.Mw84_3c3ujYLJifNDbuaQEQAuc4BMPhFLTIQVeNfBjH_Q8Z.6ej_GIsjvBcl2nS4URv6dqnebHyHWuWEhNT0HWA6TzRTdIO0jUKOr5OckpbFnT3SOBgh4Ukk2.6dJ5rRtYbt8djuhWlIrYOhQw',mdrd: '_b3VE1ubPCta04J20jujIMPQK0S3Ld8W_2S.n3TOVKc-1781583847-1.2.1.1-I5zINeb4zk2wGB50d.ywM5t4_9ZzuB0VXMI1iUjFEr299fKU4RxBxL82Yk6dMlnDKMwcOdLqHJLlVwT9a7FLiW2_rFtRMvzoc8zbqbRLBED6Db91kyjM6JzGjQQ9PTdK_yasZP1HDdP_wBVDhXiEpw5FTSIVBSUYgr.0xq8twbrgVg1dA2gllAhfkhfnHqpx7tNiAfoOswKHE8Dk_d2fZyAOXc6WMlV2CaqmAZy4Oxirohorfv8fuZnuYZPxqCIesfGCJnOIUEJ7Lh5Bo4gisA',};var a = document.createElement('script');a.nonce = 'taZ2rTqtXd4PihGAqTBAKa';a.src = '/cdn-cgi/challenge-platform/h/g/orchestrate/chl_page/v1?ray=a0c70b060f27f816';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=slrDy3Qwxh30_Qngpb7b4Xt1fpVK.vhMdbIdGl.tzII-1781583847-1.0.1.1-aGXHPzDgyXIRxGVDzCuYNhmWgSPqCwNl3RFcZ_hAWOQ"+ 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