Skip to content

Commit

Permalink
Merge pull request #44 from usa-npn/test-prod
Browse files Browse the repository at this point in the history
Update tests
  • Loading branch information
Aariq authored Nov 20, 2024
2 parents c2a1059 + 55a6ffb commit 0490188
Show file tree
Hide file tree
Showing 47 changed files with 11,269 additions and 3,910 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches: [main, master]
pull_request:
branches: [main, master]
schedule:
- cron: '0 0 * * 0'
# schedule:
# - cron: '0 0 * * 0'

name: R-CMD-check

Expand Down
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ Suggests:
markdown,
rmarkdown,
RColorBrewer,
vcr
RoxygenNote: 7.2.3
vcr,
withr
RoxygenNote: 7.3.2
Encoding: UTF-8
VignetteBuilder: knitr
URL: https://github.com/usa-npn/rnpn
Expand Down
3 changes: 1 addition & 2 deletions R/rnpn-package.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#' @importFrom utils URLencode download.file object.size write.table
#' @name rnpn-package
#' @aliases rnpn
#' @docType package
#' @keywords package
NULL
"_PACKAGE"

4 changes: 2 additions & 2 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ get_skip_long_tests <- function(){
#'
#'
check_service <- function() {
npn_set_env(get_test_env())
# npn_set_env(get_test_env())
url <- paste0(base(), 'species/getSpeciesById.json')
args <- list(species_id = 3)
res <- NULL
Expand All @@ -51,7 +51,7 @@ check_service <- function() {
}

check_data_service <- function() {
npn_set_env(get_test_env())
# npn_set_env(get_test_env())
url <- paste0(base_data_domain(), 'web-services/geo.html')
res <- NULL
tryCatch({
Expand Down
25 changes: 25 additions & 0 deletions man/rnpn-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions tests/fixtures/npn_abundance_categories_1.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://services-staging.usanpn.org/npn_portal/phenophases/getAbundanceCategories.json
uri: https://services.usanpn.org/npn_portal/phenophases/getAbundanceCategories.json
body:
encoding: ''
string: ''
Expand All @@ -14,9 +14,9 @@ http_interactions:
reason: OK
message: 'Success: (200) OK'
headers:
date: Tue, 23 Jan 2024 19:53:27 GMT
date: Wed, 13 Nov 2024 00:26:33 GMT
content-type: application/json; charset=utf-8
server: Apache/2.4.58 () PHP/5.5.38
server: Apache/2.4.62 () PHP/5.5.38
x-powered-by: PHP/5.5.38
pragma: no-cache
cache-control: no-store, no-cache, max-age=0, must-revalidate
Expand Down Expand Up @@ -314,5 +314,5 @@ http_interactions:
calls"},{"value_id":21,"value_description":"Calls of individuals can be distinguished
but there is some overlapping of calls.","value_name":"Overlapping calls"},{"value_id":22,"value_description":"Calls
are constant and overlapping.","value_name":"Full chorus"}]},{"category_id":77,"category_name":"","category_description":"","category_values":[]}]'
recorded_at: 2024-01-23 19:53:27 GMT
recorded_with: vcr/1.2.2, webmockr/0.9.0
recorded_at: 2024-11-13 00:26:33 GMT
recorded_with: vcr/1.6.0, webmockr/1.0.0
10 changes: 5 additions & 5 deletions tests/fixtures/npn_datasets_1.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
http_interactions:
- request:
method: get
uri: https://services-staging.usanpn.org/npn_portal/observations/getDatasetDetails.json
uri: https://services.usanpn.org/npn_portal/observations/getDatasetDetails.json
body:
encoding: ''
string: ''
Expand All @@ -14,10 +14,10 @@ http_interactions:
reason: OK
message: 'Success: (200) OK'
headers:
date: Tue, 23 Jan 2024 19:48:44 GMT
date: Wed, 13 Nov 2024 00:52:12 GMT
content-type: application/json; charset=utf-8
content-length: '6339'
server: Apache/2.4.58 () PHP/5.5.38
server: Apache/2.4.62 () PHP/5.5.38
x-powered-by: PHP/5.5.38
pragma: no-cache
cache-control: no-store, no-cache, max-age=0, must-revalidate
Expand Down Expand Up @@ -74,5 +74,5 @@ http_interactions:
NWR 2012-2019","dataset_description":"Patuxent National Wildlife Refuge phenology
using Project Budburst protocols, 2012-2019","contact_name":"Ken Lavish","contact_institution":"Patuxent
National Wildlife Refuge ","contact_email":"[email protected]","contact_phone":null,"contact_address":null,"dataset_comments":null,"dataset_documentation_url":"https:\/\/docs.google.com\/document\/d\/e\/2PACX-1vTJlxNy5k8x3gzKBksCa0NpFQ88SC7qwMlmmjcD4MVnzMPLSQpp5_hm56BOeIOq1hJAdzfq7UmFtWZe\/pub"}]'
recorded_at: 2024-01-23 19:48:45 GMT
recorded_with: vcr/1.2.2, webmockr/0.9.0
recorded_at: 2024-11-13 00:52:12 GMT
recorded_with: vcr/1.6.0, webmockr/1.0.0
8 changes: 4 additions & 4 deletions tests/fixtures/npn_get_custom_agdd_time_series_1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ http_interactions:
reason: OK
message: 'Success: (200) OK'
headers:
date: Tue, 23 Jan 2024 20:18:16 GMT
date: Tue, 12 Nov 2024 22:53:31 GMT
content-type: application/json; charset=utf-8
content-length: '1270'
server: Apache/2.4.58 () PHP/5.5.38
server: Apache/2.4.62 () PHP/5.5.38
x-powered-by: Express
access-control-allow-origin: '*'
etag: W/"4f6-iENhcemtQDFtyveRWrznb04iMBw"
Expand All @@ -27,5 +27,5 @@ http_interactions:
encoding: ''
file: no
string: '{"climateProvider":"NCEP","temperatureUnit":"fahrenheit","startDate":"2019-01-01","endDate":"2019-01-15","lowerThreshold":25,"upperThreshold":90,"latitude":39.7,"longitude":-107.5,"timeSeries":[{"date":"2019-01-01","doy":1,"gdd":0,"agdd":0},{"date":"2019-01-02","doy":2,"gdd":0,"agdd":0},{"date":"2019-01-03","doy":3,"gdd":0,"agdd":0},{"date":"2019-01-04","doy":4,"gdd":1.4647688638263072,"agdd":1.4647688638263072},{"date":"2019-01-05","doy":5,"gdd":4.74998735182138,"agdd":6.214756215647688},{"date":"2019-01-06","doy":6,"gdd":5.734634929646188,"agdd":11.949391145293877},{"date":"2019-01-07","doy":7,"gdd":1.251783633619752,"agdd":13.201174778913629},{"date":"2019-01-08","doy":8,"gdd":0,"agdd":13.201174778913629},{"date":"2019-01-09","doy":9,"gdd":3.313115389868103,"agdd":16.51429016878173},{"date":"2019-01-10","doy":10,"gdd":7.208651577051687,"agdd":23.722941745833417},{"date":"2019-01-11","doy":11,"gdd":6.276859476468096,"agdd":29.999801222301514},{"date":"2019-01-12","doy":12,"gdd":0,"agdd":29.999801222301514},{"date":"2019-01-13","doy":13,"gdd":1.0264293746547666,"agdd":31.02623059695628},{"date":"2019-01-14","doy":14,"gdd":0.7390871207214376,"agdd":31.765317717677718},{"date":"2019-01-15","doy":15,"gdd":2.1301579207567185,"agdd":33.895475638434434}]}'
recorded_at: 2024-01-23 20:18:16 GMT
recorded_with: vcr/1.2.2, webmockr/0.9.0
recorded_at: 2024-11-12 22:53:31 GMT
recorded_with: vcr/1.6.0, webmockr/1.0.0
Loading

0 comments on commit 0490188

Please sign in to comment.