Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(googleCloudStorageR)
  Setting scopes to https://www.googleapis.com/auth/devstorage.full_control
  If you need additional scopes set do so via options(googleAuthR.scopes.selected = c('scope1', 'scope2')) before loading library and include one required scope.
  > library(bigQueryR)
  Setting scopes to https://www.googleapis.com/auth/cloud-platform
  If you need additional scopes set do so via options(googleAuthR.scopes.selected = c('scope1', 'scope2')) before loading library and include one required scope.
  > 
  > 
  > test_check("bigQueryR")
  1. Error: Can authenticate (@test_query.R#8) -----------------------------------
  Unauthorized (HTTP 401).
  1: bqr_auth() at testthat/test_query.R:8
  2: googleAuthR::gar_auto_auth(required_scopes, new_user = new_user, no_auto = no_auto, 
         environment_var = "BQ_AUTH_FILE", travis_environment_var = "TRAVIS_BQ_AUTH_FILE")
  3: gar_auth_service(auth_file)
  4: httr::oauth_service_token(endpoint, secrets, scope)
  5: TokenServiceAccount$new(endpoint = endpoint, secrets = secrets, params = list(scope = scope))
  6: .subset2(public_bind_env, "initialize")(...)
  7: self$refresh()
  8: init_oauth_service_account(self$secrets, self$params$scope)
  9: stop_for_status(res)
  
  2. Error: Can upload test set (@test_query.R#39) -------------------------------
  Invalid Token
  1: bqr_upload_data(tableId = "test2", upload_data = test_data) at testthat/test_query.R:39
  2: bqr_do_upload(upload_data = upload_data, projectId = projectId, datasetId = datasetId, 
         tableId = tableId, create = create, user_schema = schema, sourceFormat = sourceFormat, 
         wait = wait, autodetect = autodetect)
  3: bqr_do_upload.data.frame(upload_data = upload_data, projectId = projectId, datasetId = datasetId, 
         tableId = tableId, create = create, user_schema = schema, sourceFormat = sourceFormat, 
         wait = wait, autodetect = autodetect)
  4: l(path_arguments = list(projects = projectId, datasets = datasetId, tableId = tableId), 
         the_body = mp_body)
  5: stop("Invalid Token")
  
  3. Error: Can upload via Google Cloud Storage (@test_query.R#56) ---------------
  Invalid Token
  1: gcs_upload(mtcars, name = "mtcars_test3.csv", object_function = f) at testthat/test_query.R:56
  2: up(path_arguments = list(b = bucket), pars_arguments = list(name = name), the_body = bb)
  3: stop("Invalid Token")
  
  4. Error: Can list tables (@test_query.R#70) -----------------------------------
  Invalid Token
  1: bqr_list_tables() at testthat/test_query.R:70
  2: l()
  3: stop("Invalid Token")
  
  Error in q(the_body = body, path_arguments = list(projects = projectId)) : 
    Invalid Token
  5. Failure: Can query test set (@test_query.R#81) ------------------------------
  result$Name not equal to test_data$Name.
  target is NULL, current is character
  
  
  6. Error: Can query test set (@test_query.R#82) --------------------------------
  do not know how to convert 'result$Date' to class "Date"
  1: expect_equal(as.Date(result$Date), test_data$Date) at testthat/test_query.R:82
  2: compare(object, expected, ...)
  3: as.Date(result$Date)
  4: as.Date.default(result$Date)
  5: stop(gettextf("do not know how to convert '%s' to class %s", deparse(substitute(x)), 
         dQuote("Date")), domain = NA)
  
  Error in q(the_body = body, path_arguments = list(projects = projectId)) : 
    Invalid Token
  7. Failure: Single query bug (@test_query.R#92) --------------------------------
  nrow(result) not equal to 10.
  1/1 mismatches
  [1] 1 - 10 == -9
  
  
  8. Error: Async query (@test_query.R#98) ---------------------------------------
  Invalid Token
  1: bqr_query_asynch(query = "SELECT * FROM test1", destinationTableId = "test3", writeDisposition = "WRITE_TRUNCATE") at testthat/test_query.R:98
  2: job(path_arguments = list(projects = projectId), the_body = config)
  3: stop("Invalid Token")
  
  9. Error: Extract data to Google Cloud Storage, and download (@test_query.R#115) 
  Invalid Token
  1: bqr_extract_data(tableId = "test3", cloudStorageBucket = gcs_get_global_bucket()) at testthat/test_query.R:115
  2: job(path_arguments = list(projects = projectId), the_body = config)
  3: stop("Invalid Token")
  
  10. Error: Create a table (@test_query.R#140) ----------------------------------
  Invalid Token
  1: bqr_create_table(tableId = "created_table", template_data = mtcars) at testthat/test_query.R:140
  2: stop(error.message(req))
  
  11. Error: Get meta data of table (@test_query.R#148) --------------------------
  Invalid Token
  1: bqr_table_meta(tableId = "created_table") at testthat/test_query.R:148
  2: l(path_arguments = list(projects = projectId, datasets = datasetId, tables = tableId))
  3: stop("Invalid Token")
  
  12. Error: Get data of table (@test_query.R#156) -------------------------------
  Invalid Token
  1: bqr_table_data(tableId = "created_table") at testthat/test_query.R:156
  2: l(path_arguments = list(projects = projectId, datasets = datasetId, tables = tableId), 
         pars_arguments = list(maxResults = maxResults))
  3: stop("Invalid Token")
  
  13. Error: Delete a table (@test_query.R#164) ----------------------------------
  Invalid Token
  1: bqr_delete_table(tableId = "created_table") at testthat/test_query.R:164
  2: stop(error.message(req))
  
  testthat results ================================================================
  OK: 19 SKIPPED: 0 FAILED: 13
  1. Error: Can authenticate (@test_query.R#8) 
  2. Error: Can upload test set (@test_query.R#39) 
  3. Error: Can upload via Google Cloud Storage (@test_query.R#56) 
  4. Error: Can list tables (@test_query.R#70) 
  5. Failure: Can query test set (@test_query.R#81) 
  6. Error: Can query test set (@test_query.R#82) 
  7. Failure: Single query bug (@test_query.R#92) 
  8. Error: Async query (@test_query.R#98) 
  9. Error: Extract data to Google Cloud Storage, and download (@test_query.R#115) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted