Running ‘testthat.R’ [4s/59s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(norgeo)
  norgeo version 2.1.6
  > 
  > test_check("norgeo")
  Start casting geo codes from API ..Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [data.ssb.no] Failed to connect to data.ssb.no port 80 after 10001 ms: Timeout was reached
  Request failed [ERROR]. Retrying in 1.9 seconds...
  Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [data.ssb.no] Failed to connect to data.ssb.no port 80 after 10000 ms: Timeout was reached
  Request failed [ERROR]. Retrying in 1 seconds...
  Error in curl::curl_fetch_memory(url, handle = handle): Timeout was reached: [data.ssb.no] Failed to connect to data.ssb.no port 80 after 10001 ms: Timeout was reached
  Request failed [ERROR]. Retrying in 1.5 seconds...
  No encoding supplied: defaulting to UTF-8.
  *** Change table for grunnkrets doesn't exist. From 1999-01-01 to 2000-01-02 *** 
  No encoding supplied: defaulting to UTF-8.
  *** Change table for grunnkrets doesn't exist. From 2000-01-01 to 2001-01-02 *** 
  No encoding supplied: defaulting to UTF-8.
  *** Change table for grunnkrets doesn't exist. From 2001-01-01 to 2002-01-02 *** 
  No encoding supplied: defaulting to UTF-8.
  *** Change table for grunnkrets doesn't exist. From 2002-01-01 to 2003-01-02 *** 
  
  Grunnkrets codes change before 2002 are from the dataset `GrunnkretsBefore2002`
  No code changes from 2018-01-01 to 2019-01-02 or not available via API
  
  No encoding supplied: defaulting to UTF-8.
  No encoding supplied: defaulting to UTF-8.
  *** Change table for fylke doesn't exist. From 2017-01-01 to 2018-01-02 *** 
  
  No encoding supplied: defaulting to UTF-8.
  *** Change table for kommune doesn't exist. From 2018-01-01 to 2019-01-02 *** 
  No encoding supplied: defaulting to UTF-8.
  *** Change table for kommune doesn't exist. From 2019-01-01 to 2020-01-02 *** 
  
  No encoding supplied: defaulting to UTF-8.
  *** Change table for kommune doesn't exist. From 2016-01-01 to 2017-01-02 *** 
  No encoding supplied: defaulting to UTF-8.
  *** Change table for kommune doesn't exist. From 2017-01-01 to 2018-01-02 *** 
  
  [ FAIL 6 | WARN 0 | SKIP 0 | PASS 7 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-cast-geo.R:5:3'): Cast geo ─────────────────────────────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [data.ssb.no] Failed to connect to data.ssb.no port 80 after 10001 ms: Timeout was reached
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(cast_geo(2010, names = FALSE), dt) at test-cast-geo.R:5:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─norgeo::cast_geo(2010, names = FALSE)
   5.   └─norgeo::get_code(geos[i], from = year)
   6.     └─norgeo:::set_url(...)
   7.       └─httr::RETRY("GET", url = endUrl, query = codeQry)
  ── Failure ('test-get-change.R:5:3'): Grunnkrets from before 2002 ──────────────
  get_change("g", 1999, 2003, names = F) (`actual`) not equal to `dtOut` (`expected`).
  
        attr(actual, 'row.names') | attr(expected, 'row.names')               
  [271] 271                       | 271                         [271]         
  [272] 272                       | 272                         [272]         
  [273] 273                       | 273                         [273]         
                                  - 274                         [274]         
                                  - 275                         [275]         
                                  - 276                         [276]         
                                  - 277                         [277]         
                                  - 278                         [278]         
                                  - 279                         [279]         
                                  - 280                         [280]         
    ... ...                         ...                         and 5 more ...
  
        actual$oldCode | expected$oldCode               
  [271] "12140206"     | "12140206"       [271]         
  [272] "15140101"     | "15140101"       [272]         
  [273] "15140102"     | "15140102"       [273]         
                       - "01010105"       [274]         
                       - "01010104"       [275]         
                       - "01010102"       [276]         
                       - "01010101"       [277]         
                       - "01010101"       [278]         
                       - "01010201"       [279]         
                       - "01010104"       [280]         
    ... ...              ...              and 5 more ...
  
        actual$newCode | expected$newCode               
  [271] "11590206"     | "11590206"       [271]         
  [272] "15110301"     | "15110301"       [272]         
  [273] "15110302"     | "15110302"       [273]         
                       - "01010103"       [274]         
                       - "01010105"       [275]         
                       - "01010107"       [276]         
                       - "01010109"       [277]         
                       - "01010110"       [278]         
                       - "01010202"       [279]         
                       - "01010206"       [280]         
    ... ...              ...              and 5 more ...
  
  `actual$changeOccurred` is a double vector (1999, 1999, 1999, 1999, 1999, ...)
  `expected$changeOccurred` is a character vector ('1999', '1999', '1999', '1999', '1999', ...)
  ── Error ('test-get-code.R:3:3'): get code at ──────────────────────────────────
  Error: lexical error: invalid char in json text.
                                         <!doctype html> <html> <head>  
                       (right here) ------^
  
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(get_code(type = "fylke", 2018), dtOut) at test-get-code.R:3:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─norgeo::get_code(type = "fylke", 2018)
   5.   └─norgeo:::set_url(...)
   6.     └─jsonlite::fromJSON(koTxt)
   7.       └─jsonlite:::parse_and_simplify(...)
   8.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   9.           └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error ('test-track-change.R:5:3'): Track change ─────────────────────────────
  Error in `track_change("fylke", 2017, 2018, names = F)`: No code change has occurred for the selected time range
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-track-change.R:5:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─norgeo::track_change("fylke", 2017, 2018, names = F)
  ── Error ('test-track-change.R:11:3'): Track split ─────────────────────────────
  Error in `track_change(type, from, to)`: No code change has occurred for the selected time range
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-track-change.R:11:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─norgeo::track_split("k", 2018, 2020, names = FALSE)
   5.   └─norgeo::track_change(type, from, to)
  ── Error ('test-track-change.R:16:3'): Track merge ─────────────────────────────
  Error in `track_change(type, from, to)`: No code change has occurred for the selected time range
  Backtrace:
      ▆
   1. ├─testthat::expect_equal(...) at test-track-change.R:16:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─norgeo::track_merge("k", 2016, 2018, names = F)
   5.   └─norgeo::track_change(type, from, to)
  
  [ FAIL 6 | WARN 0 | SKIP 0 | PASS 7 ]
  Error: Test failures
  Execution halted