R Under development (unstable) (2024-01-23 r85822 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # 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/tests.html > # * https://testthat.r-lib.org/reference/test_package.html#special-files > > library(testthat) > library(metricminer) > > test_check("metricminer") Using user-supplied cached token using authorize("calendly") Using user-supplied cached token using authorize("github") Using user-supplied cached token using authorize("github") Using user-supplied cached token using authorize("github") Trying GET /repos/{owner}/{repo}/activity for fhdsl/metricminer i Running gh query i Running gh query, got 100 records i Running gh query, got 200 records i Running gh query, got 300 records Trying GET /repos/{owner}/{repo}/stargazers for fhdsl/metricminer Trying GET /repos/{owner}/{repo}/forks for fhdsl/metricminer Trying GET /repos/{owner}/{repo}/contributors for fhdsl/metricminer Trying GET /repos/{owner}/{repo}/community/profile for fhdsl/metricminer Using user-supplied cached token using authorize("github") Trying GET /repos/{owner}/{repo}/traffic/clones for fhdsl/metricminer Using user-supplied cached token using authorize("google") Auto-refreshing stale OAuth token. Using user-supplied cached token using authorize("google") Auto-refreshing stale OAuth token. Using user-supplied cached token using authorize("google") Retrieving all properties underneath this account Using user-supplied cached token using authorize("google") Auto-refreshing stale OAuth token. Using user-supplied cached token using authorize("google") Trying to grab form: 1Neyj7wwNpn8wC7NzQND8kQ30cnbbETSpT0lKhX7uaQY Auto-refreshing stale OAuth token. Using user-supplied cached token using authorize("google") Trying to grab form: 1Neyj7wwNpn8wC7NzQND8kQ30cnbbETSpT0lKhX7uaQY Auto-refreshing stale OAuth token. You chose to cache your credentials, if you change your mind, run metricminer::delete_creds(). Be careful not to push .httr-oauth or RDS files to GitHub or share it anywhere. Using user-supplied cached token using authorize("google") Trying to grab form: 1pbFfgUPYH2w9zEoCDjCa4HFOxzEhGOseufw28Xxmd-o Auto-refreshing stale OAuth token. Using user-supplied cached token using authorize("google") [ FAIL 9 | WARN 6 | SKIP 0 | PASS 3 ] ══ Failed tests ════════════════════════════════════════════════════════════════ ── Error ('test-calendly.R:6:3'): Calendly: Events ───────────────────────────── Error in `calendly_get(url = "https://api.calendly.com/users/me", token = token)`: Unauthorized (HTTP 401). Backtrace: ▆ 1. └─metricminer::get_calendly_user() at test-calendly.R:6:3 2. └─metricminer::calendly_get(...) 3. └─httr::stop_for_status(result) ── Error ('test-github.R:29:3'): GitHub: Repo metrics ────────────────────────── Error in `purrr::map(api_calls, gh_repo_wrapper_fn)`: i In index: 1. i With name: clones. Caused by error in `gh::gh()`: ! GitHub API error (403): Must have push access to repository i Read more at ── Error ('test-google-analytics.R:10:3'): Google Analytics: Properties ──────── Error in `request_ga(token = token, url = "https://analytics.googleapis.com/analytics/v3/management/accountSummaries", request_type = request_type)`: API request failed:{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "errors": [ { "message": "Login Required.", "domain": "global", "reason": "required", "location": "Authorization", "locationType": "header" } ], "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "service": "analytics.googleapis.com", "method": "analytics.gaapi.v3.AnalyticsManagementAccountSummaries.List" } } ] } } Backtrace: ▆ 1. └─metricminer::get_ga_user() at test-google-analytics.R:10:3 2. └─metricminer::request_ga(...) ── Error ('test-google-analytics.R:30:3'): Google Analytics: Stats ───────────── Error in `request_ga(token = token, url = "https://analyticsadmin.googleapis.com/v1alpha/properties", query = list(filter = paste0("parent:accounts/", account_id)), request_type = "GET")`: API request failed:{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "method": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties", "service": "analyticsadmin.googleapis.com" } } ] } } Backtrace: ▆ 1. └─metricminer::get_ga_properties(account_id = 209776907) at test-google-analytics.R:30:3 2. └─metricminer::request_ga(...) ── Error ('test-google-analytics.R:55:3'): Google Analytics: All Stats ───────── Error in `request_ga(token = token, url = "https://analyticsadmin.googleapis.com/v1alpha/properties", query = list(filter = paste0("parent:accounts/", account_id)), request_type = "GET")`: API request failed:{ "error": { "code": 401, "message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.", "status": "UNAUTHENTICATED", "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "CREDENTIALS_MISSING", "domain": "googleapis.com", "metadata": { "service": "analyticsadmin.googleapis.com", "method": "google.analytics.admin.v1alpha.AnalyticsAdminService.ListProperties" } } ] } } Backtrace: ▆ 1. └─metricminer::get_all_ga_metrics(account_id = 209776907) at test-google-analytics.R:55:3 2. └─metricminer::get_ga_properties(account_id = account_id) 3. └─metricminer::request_ga(...) ── Error ('test-google-forms.R:9:3'): Google Forms: Get form ─────────────────── Error in `request_google_forms(url = form_info_url, token = token)`: Unauthorized (HTTP 401). Backtrace: ▆ 1. └─metricminer:::get_google_form("https://docs.google.com/forms/d/1Neyj7wwNpn8wC7NzQND8kQ30cnbbETSpT0lKhX7uaQY/edit") at test-google-forms.R:9:3 2. └─metricminer::request_google_forms(url = form_info_url, token = token) 3. └─httr::stop_for_status(result) ── Error ('test-google-forms.R:28:3'): Google Forms: Get multiple forms ──────── Error in `request_google_forms(url = form_info_url, token = token)`: Unauthorized (HTTP 401). Backtrace: ▆ 1. └─metricminer:::get_multiple_forms(form_ids = form_ids) at test-google-forms.R:28:3 2. └─base::sapply(...) 3. └─base::lapply(X = X, FUN = FUN, ...) 4. └─metricminer (local) FUN(X[[i]], ...) 5. └─metricminer:::get_google_form(form_id = form_id, token = token) 6. └─metricminer::request_google_forms(url = form_info_url, token = token) 7. └─httr::stop_for_status(result) ── Error ('test-write_data.R:10:3'): Writing gsheets ─────────────────────────── Error in `request_google_forms(url = form_info_url, token = token)`: Unauthorized (HTTP 401). Backtrace: ▆ 1. └─metricminer:::get_google_form("https://docs.google.com/forms/d/1pbFfgUPYH2w9zEoCDjCa4HFOxzEhGOseufw28Xxmd-o/edit") at test-write_data.R:10:3 2. └─metricminer::request_google_forms(url = form_info_url, token = token) 3. └─httr::stop_for_status(result) ── Error ('test-youtube.R:10:3'): Youtube ────────────────────────────────────── Error in `get_youtube_channel_stats("UCr73I9ZEPbn-3_1CBM57QgQ")`: Forbidden (HTTP 403). Backtrace: ▆ 1. └─metricminer::get_youtube_channel_stats("UCr73I9ZEPbn-3_1CBM57QgQ") at test-youtube.R:10:3 2. └─httr::stop_for_status(result) [ FAIL 9 | WARN 6 | SKIP 0 | PASS 3 ] Error: Test failures Execution halted