Running ‘testthat.R’ [1s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Note that you would never run this file directly. This is used by tools::testInstallPackages()
  > # and other packages like covr.
  > # To actually run the tests, you need to set the working directory then run
  > # devtools::test('r-pkg/uptasticsearch')
  > 
  > # This line ensures that R CMD check can run tests.
  > # See https://github.com/hadley/testthat/issues/144
  > Sys.setenv("R_TESTS" = "")
  > 
  > library(uptasticsearch)
  > 
  > testthat::test_check('uptasticsearch')
  1. Error: chomp_aggs should work from an R string with one grouping variable (@test-elasticsearch_parsers.R#145) 
  invalid argument type
  1: expect_identical(chomp_aggs(aggs_json = oneVarJSON), data.table::data.table(some_variable = c("level1", 
         "level2", "level3"), doc_count = c(62159L, 21576L, 10575L))) at testthat/test-elasticsearch_parsers.R:145
  2: identical(object, expected)
  3: chomp_aggs(aggs_json = oneVarJSON)
  4: outDT[, !badCols, with = FALSE]
  5: `[.data.table`(outDT, , !badCols, with = FALSE)
  6: eval(jsub, parent.frame(), parent.frame())
  7: eval(jsub, parent.frame(), parent.frame())
  
  2. Error: chomp_aggs should work from a file with one grouping variable (@test-elasticsearch_parsers.R#153) 
  invalid argument type
  1: expect_identical(chomp_aggs(aggs_json = test_json), data.table::data.table(some_variable = c("level1", 
         "level2", "level3"), doc_count = c(62159L, 21576L, 10575L))) at testthat/test-elasticsearch_parsers.R:153
  2: identical(object, expected)
  3: chomp_aggs(aggs_json = test_json)
  4: outDT[, !badCols, with = FALSE]
  5: `[.data.table`(outDT, , !badCols, with = FALSE)
  6: eval(jsub, parent.frame(), parent.frame())
  7: eval(jsub, parent.frame(), parent.frame())
  
  3. Error: chomp_aggs should work from an R string with multiple grouping variables (@test-elasticsearch_parsers.R#161) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = oneVarJSON) at testthat/test-elasticsearch_parsers.R:161
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  4. Error: chomp_aggs should work from a file with multiple grouping variables (@test-elasticsearch_parsers.R#178) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: expect_identical(chomp_aggs(aggs_json = test_json), data.table::data.table(a_grouping_var = c(rep(0L, 
         6), rep(2L, 6), rep(1L, 6)), another_one = c(2915L, 2915L, 3952L, 3952L, 2632L, 
         2632L, 2349L, 2349L, 2201L, 2201L, 2247L, 2247L, 2126L, 2126L, 777L, 777L, 663L, 
         663L), yet_another_one = c(rep(c("lupe_fiasco", "tech_n9ne"), 3), rep(c("childish_gambino", 
         "tech_n9ne"), 3), rep(c("lupe_fiasco", "tech_n9ne"), 3)), doc_count = c(168098L, 
         20531L, 145484L, 873L, 121318L, 5877L, 485820L, 56762L, 470503L, 34884L, 188375L, 
         17877L, 405476L, 28259L, 241894L, 35493L, 193540L, 3668L))) at testthat/test-elasticsearch_parsers.R:178
  2: identical(object, expected)
  3: chomp_aggs(aggs_json = test_json)
  4: unpack_nested_data(outDT, aggNames[length(aggNames)])
  5: stop(msg)
  
  5. Error: chomp_aggs should work from a multi-element character vector (@test-elasticsearch_parsers.R#195) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = jsonVec) at testthat/test-elasticsearch_parsers.R:195
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  6. Error: chomp_aggs should work for a one-level 'date_histogram' aggregation (@test-elasticsearch_parsers.R#239) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:239
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  7. Error: chomp_aggs should work for a 'date_histogram' - 'cardinality' aggregation (@test-elasticsearch_parsers.R#252) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:252
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  8. Error: chomp_aggs should work for a 'date_histogram' - 'extended_stats' aggregation (@test-elasticsearch_parsers.R#266) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:266
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  9. Error: chomp_aggs should work for a 'date_histogram' - 'histogram' aggregation (@test-elasticsearch_parsers.R#286) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:286
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  10. Error: chomp_aggs should work for a 'date_histogram' - 'percentiles' aggregation (@test-elasticsearch_parsers.R#300) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:300
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  11. Error: chomp_aggs should work for a 'date_histogram' - 'significant_terms' aggregation (@test-elasticsearch_parsers.R#319) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:319
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  12. Error: chomp_aggs should work for a 'date_histogram' - 'stats' aggregation (@test-elasticsearch_parsers.R#338) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:338
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  13. Error: chomp_aggs should work for a 'date_histogram' - 'terms' aggregation (@test-elasticsearch_parsers.R#354) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:354
  2: outDT[, !"key", with = FALSE]
  3: `[.data.table`(outDT, , !"key", with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  14. Error: chomp_aggs should work for a one-level 'terms' aggregation (@test-elasticsearch_parsers.R#461) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:461
  2: outDT[, !badCols, with = FALSE]
  3: `[.data.table`(outDT, , !badCols, with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  15. Error: chomp_aggs should work for a 'terms' - 'cardinality' nested aggregation (@test-elasticsearch_parsers.R#473) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:473
  2: outDT[, !badCols, with = FALSE]
  3: `[.data.table`(outDT, , !badCols, with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  16. Error: chomp_aggs should work for a 'terms' - 'date_histogram' nested aggregation (@test-elasticsearch_parsers.R#486) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:486
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  17. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'cardinality' nested aggregation (@test-elasticsearch_parsers.R#501) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:501
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  18. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'extended_stats' nested aggregation (@test-elasticsearch_parsers.R#516) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:516
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  19. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'percentiles' nested aggregation (@test-elasticsearch_parsers.R#540) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:540
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  20. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'significant_terms' nested aggregation (@test-elasticsearch_parsers.R#566) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:566
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  21. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'stats' nested aggregation (@test-elasticsearch_parsers.R#586) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:586
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  22. Error: chomp_aggs should work for a 'terms' - 'date_histogram' - 'terms' nested aggregation (@test-elasticsearch_parsers.R#608) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:608
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  23. Error: chomp_aggs should work for a 'terms' - 'extended_stats' nested aggregation (@test-elasticsearch_parsers.R#626) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:626
  2: outDT[, !badCols, with = FALSE]
  3: `[.data.table`(outDT, , !badCols, with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  24. Error: chomp_aggs should work for a 'terms' - 'histogram' nested aggregation (@test-elasticsearch_parsers.R#646) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:646
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  25. Error: chomp_aggs should work for a 'terms' - 'percentiles' nested aggregation (@test-elasticsearch_parsers.R#659) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:659
  2: outDT[, !badCols, with = FALSE]
  3: `[.data.table`(outDT, , !badCols, with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  26. Error: chomp_aggs should work for a 'terms' - 'significant_terms' nested aggregation (@test-elasticsearch_parsers.R#675) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:675
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  27. Error: chomp_aggs should work for a 'terms' - 'stats' nested aggregation (@test-elasticsearch_parsers.R#689) 
  invalid argument type
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:689
  2: outDT[, !badCols, with = FALSE]
  3: `[.data.table`(outDT, , !badCols, with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  28. Error: chomp_aggs should work for a two-level 'terms' aggregation (@test-elasticsearch_parsers.R#704) 
  For unpack_nested_data, col_to_unpack must be one of the column names
  1: chomp_aggs(aggs_json = result) at testthat/test-elasticsearch_parsers.R:704
  2: unpack_nested_data(outDT, aggNames[length(aggNames)])
  3: stop(msg)
  
  29. Error: chomp_hits should warn and delete if the resulting data is nested with keep_nested_data_cols = FALSE (@test-elasticsearch_parsers.R#824) 
  invalid argument type
  1: expect_warning({
         chomped <- chomp_hits(hits_json = "[{\"test1\":[{\"a\":1}],\"test2\":2}]", keep_nested_data_cols = FALSE)
     }, regexp = "Deleting the following nested data columns:") at testthat/test-elasticsearch_parsers.R:824
  2: capture_warnings(object)
  3: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  4: chomp_hits(hits_json = "[{\"test1\":[{\"a\":1}],\"test2\":2}]", keep_nested_data_cols = FALSE) at testthat/test-elasticsearch_parsers.R:824
  5: batchDT[, !names(colTypes[colTypes == "list"]), with = FALSE]
  6: `[.data.table`(batchDT, , !names(colTypes[colTypes == "list"]), with = FALSE)
  7: eval(jsub, parent.frame(), parent.frame())
  8: eval(jsub, parent.frame(), parent.frame())
  
  30. Error: unpack_nested_data should work with the result of chomp_hits (@test-elasticsearch_parsers.R#844) 
  invalid argument type
  1: unpack_nested_data(chomped_df = sampleChompedDT, col_to_unpack = "details.appData") at testthat/test-elasticsearch_parsers.R:844
  2: outDT[, !c(".id", col_to_unpack), with = FALSE]
  3: `[.data.table`(outDT, , !c(".id", col_to_unpack), with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  31. Error: unpack_nested_data should work if the array is a simple array (@test-elasticsearch_parsers.R#867) 
  invalid argument type
  1: unpack_nested_data(chomped_df = sampleChompedDT, col_to_unpack = "details.minutes") at testthat/test-elasticsearch_parsers.R:867
  2: outDT[, !c(".id", col_to_unpack), with = FALSE]
  3: `[.data.table`(outDT, , !c(".id", col_to_unpack), with = FALSE)
  4: eval(jsub, parent.frame(), parent.frame())
  5: eval(jsub, parent.frame(), parent.frame())
  
  testthat results ================================================================
  OK: 102 SKIPPED: 1 FAILED: 31
  1. Error: chomp_aggs should work from an R string with one grouping variable (@test-elasticsearch_parsers.R#145) 
  2. Error: chomp_aggs should work from a file with one grouping variable (@test-elasticsearch_parsers.R#153) 
  3. Error: chomp_aggs should work from an R string with multiple grouping variables (@test-elasticsearch_parsers.R#161) 
  4. Error: chomp_aggs should work from a file with multiple grouping variables (@test-elasticsearch_parsers.R#178) 
  5. Error: chomp_aggs should work from a multi-element character vector (@test-elasticsearch_parsers.R#195) 
  6. Error: chomp_aggs should work for a one-level 'date_histogram' aggregation (@test-elasticsearch_parsers.R#239) 
  7. Error: chomp_aggs should work for a 'date_histogram' - 'cardinality' aggregation (@test-elasticsearch_parsers.R#252) 
  8. Error: chomp_aggs should work for a 'date_histogram' - 'extended_stats' aggregation (@test-elasticsearch_parsers.R#266) 
  9. Error: chomp_aggs should work for a 'date_histogram' - 'histogram' aggregation (@test-elasticsearch_parsers.R#286) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted