Running ‘testthat.R’ [1s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(kofdata)
  Loading required package: jsonlite
  Loading required package: httr
  > 
  > test_check("kofdata")
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test_get_dataset.R:4:3): get_dataset works ─────────────────────────
  `get_dataset("some_nonexistent_set")` threw an error with unexpected message.
  Expected match: "The API responded"
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
       █
    1. ├─testthat::expect_error(get_dataset("some_nonexistent_set"), "The API responded") test_get_dataset.R:4:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_dataset("some_nonexistent_set")
    7.   └─jsonlite::fromJSON(content(response, as = "text"))
    8.     └─jsonlite:::parse_and_simplify(...)
    9.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   10.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Failure (test_get_dataset.R:5:3): get_dataset works ─────────────────────────
  `get_dataset("set_doesnt_matter", "GandalfTheGray")` threw an error with unexpected message.
  Expected match: "Could not authenticate."
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_get_dataset.R:5:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_dataset("set_doesnt_matter", "GandalfTheGray")
    7.   └─jsonlite::fromJSON(content(response, as = "text"))
    8.     └─jsonlite:::parse_and_simplify(...)
    9.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   10.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error (test_get_dataset.R:7:3): get_dataset works ───────────────────────────
  Error: lexical error: invalid char in json text.
                                         <html>  <head><title>502 Bad Ga
                       (right here) ------^
  
  Backtrace:
      █
   1. └─kofdata::get_dataset("baro_vintages_monthly") test_get_dataset.R:7:2
   2.   └─jsonlite::fromJSON(content(response, as = "text"))
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error (test_get_metadata.R:4:3): get_metadata works ─────────────────────────
  Error: lexical error: invalid char in json text.
                                         <html>  <head><title>502 Bad Ga
                       (right here) ------^
  
  Backtrace:
      █
   1. ├─testthat::expect_true(is.na(get_metadata("nokey")[["nokey"]])) test_get_metadata.R:4:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─kofdata::get_metadata("nokey")
   5.   └─jsonlite::fromJSON(content(response, as = "text"))
   6.     └─jsonlite:::parse_and_simplify(...)
   7.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   8.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Failure (test_get_time_series.R:4:3): get_time_series works ─────────────────
  `get_time_series("some_nonexistent_key", show_progress = F)` threw an error with unexpected message.
  Expected match: "The API responded"
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_get_time_series.R:4:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_time_series("some_nonexistent_key", show_progress = F)
    7.   └─jsonlite::fromJSON(content(response, as = "text"))
    8.     └─jsonlite:::parse_and_simplify(...)
    9.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   10.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Failure (test_get_time_series.R:5:3): get_time_series works ─────────────────
  `get_time_series("key_doesnt_matter", "GandalfTheGray", show_progress = F)` threw an error with unexpected message.
  Expected match: "Could not authenticate."
  Actual message: "lexical error: invalid char in json text.\n                                       <html>  <head><title>502 Bad Ga\n                     (right here) ------^\n"
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_get_time_series.R:5:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─kofdata::get_time_series(...)
    7.   └─jsonlite::fromJSON(content(response, as = "text"))
    8.     └─jsonlite:::parse_and_simplify(...)
    9.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   10.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error (test_get_time_series.R:7:3): get_time_series works ───────────────────
  Error: lexical error: invalid char in json text.
                                         <html>  <head><title>502 Bad Ga
                       (right here) ------^
  
  Backtrace:
      █
   1. └─kofdata::get_time_series("kofbarometer", show_progress = F) test_get_time_series.R:7:2
   2.   └─jsonlite::fromJSON(content(response, as = "text"))
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_string(txt, bigint_as_char)
  ── Error (test_list_keys.R:5:3): list_keys_in_set works ────────────────────────
  Error: An error occurred when calling the api:
  Status: 502
  Content:<html>
  <head><title>502 Bad Gateway</title></head>
  <body bgcolor="white">
  <center><h1>502 Bad Gateway</h1></center>
  <hr><center>nginx/1.12.2</center>
  </body>
  </html>
  
  Backtrace:
      █
   1. └─kofdata::list_available_sets() test_list_keys.R:5:2
  ── Error (test_list_sets.R:5:3): list_available_sets works ─────────────────────
  Error: An error occurred when calling the api:
  Status: 502
  Content:<html>
  <head><title>502 Bad Gateway</title></head>
  <body bgcolor="white">
  <center><h1>502 Bad Gateway</h1></center>
  <hr><center>nginx/1.12.2</center>
  </body>
  </html>
  
  Backtrace:
      █
   1. └─kofdata::list_available_sets() test_list_sets.R:5:2
  
  [ FAIL 9 | WARN 0 | SKIP 0 | PASS 1 ]
  Error: Test failures
  Execution halted