ropensci / neotoma

Programmatic R interface to the Neotoma Paleoecological Database.
https://docs.ropensci.org/neotoma
Other
30 stars 16 forks source link

Failing tests #176

Closed gavinsimpson closed 9 years ago

gavinsimpson commented 9 years ago

I turned on all the tests in in tests/test_neotoma.R and the situation is not great. Lots of tests failing for variety of reasons. I append the full failure log below.

Note that this was without the new test @SimonGoring added that has a syntax error in it

We need to fix these before uploading to CRAN...

R version 3.2.0 Patched (2015-05-01 r68289) -- "Full of Ingredients"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-unknown-linux-gnu (64-bit)

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.

> #  Code as used in rOpenSci package rfigshare
> #  author: Carl Boettiger
> #  file: https://github.com/ropensci/rfigshare/commit/4f479b6e34f2ab5e89b3aa3da2355156ae659950#diff-aec6d055aaf98780cdcb2bb54dd3631c
> #  minor modification by : S. Goring
> 
> if (packageVersion("testthat") >= "0.7.1.99") {
+   library("testthat")
+   test_check("neotoma")
+ } 
Loading required package: neotoma
Run Neotoma examples only when not on CRAN : S
get_site works as expected : The API call was successful, you have returned  7160 records.
..
get_contact work as expected : ......1
get_downloads works as expected : ...2
get_dataset works as expected : ........The API call was successful, you have returned 0 record.

3.......The API call was successful, you have returned 0 record.

.The API call was successful, you have returned 0 record.

4
Crossing sites, datasets and downloads, using the API: : API call was successful. Returned record for Site 30 (Swainunpublished)
.API call was successful. Returned record for Site 30 (Swainunpublished)
.The API call was successful, you have returned  2 records.
.API call was successful. Returned record for Little Lake (US:Oregon)
Warning: 
Modifiers are absent from the lab objects Lycopodium tablets, Lycopodium spike, Sample quantity. 
get_download will use uniqueidentifiers to resolve the problem.
API call was successful. Returned record for Marion Lake (CA:BritishColumbia)
API call was successful. Returned record for Mosquito Lake Bog
Warning: 
Modifiers are absent from the lab objects Eucalyptus suspension, Eucalyptus spike, Sample quantity. 
get_download will use uniqueidentifiers to resolve the problem.
.API call was successful. Returned record for Site 30 (Swainunpublished)
.API call was successful. Returned record for Site 30 (Swainunpublished)
.The API call was successful, you have returned 0 record.

.The API call was successful, you have returned 0 record.

5
Compiling objects and returning what is expected: : API call was successful. Returned record for Site 30 (Swainunpublished)
API call was successful. Returned record for Site 31 (Swainunpublished)
API call was successful. Returned record for Site 32 (Swainunpublished)
API call was successful. Returned record for Site 33 (Swainunpublished)
.API call was successful. Returned record for Chimney Rock Animal Trap
Warning: 
Modifiers seem absent from the taxon Martes americana. 
get_download will sum at depths with multiple entries to resolve the problem.
API call was successful. Returned record for Lindenmeier [5LR13]
Warning: 
Modifiers seem absent from the taxons Antilocapra americana, Camelops sp..redeposited, Canis latrans, Vulpes vulpes, Canis lupus, Lepus townsendii, cf. Bison antiquus, Odocoileus virginianus, Cynomys ludovicianus.intrusive, Lepus americanus, Vulpes velox. 
get_download will sum at depths with multiple entries to resolve the problem.
API call was successful. Returned record for Jones-Miller
API call was successful. Returned record for Selby
API call was successful. Returned record for Lamb Springs [5DA201]
API call was successful. Returned record for Blackwater Draw Loc. 1
.API call was successful. Returned record for Site 30 (Swainunpublished)
.API call was successful. Returned record for Site 30 (Swainunpublished)
.
get_contact work as expected : The API call was successful, you have returned  1 records.
.The API call was successful, you have returned  1 records.
.The API call was successful, you have returned  1 records.
The API call was successful, you have returned  1 records.
6

1. Error: get_contact accepts and returns the right data types -----------------
Server returned an error message:
 The remote server returned an error: (500) Internal Server Error.
Stack Trace:
   at System.Net.HttpWebRequest.GetResponse()
   at SpatialIT.CEI.Neotoma.Facade.FacadeRequestHandler.ProcessRequest(HttpContext context) in C:\Users\mikea\Documents\Visual Studio 2012\Projects\CEI\Neotoma\APIs\Facade\FacadeRequestHandler.vb:line 111
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls)
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: expect_message(get_contact(contactname = "*Smith*"), "The API call") at test_neotoma.R:27
5: expect_that(object, shows_message(regexp, ...), info = info, label = label)
6: condition(object)
7: evaluate_promise(expr)
8: with_sink(temp, withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler))
9: withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler)
10: withVisible(code)
11: get_contact(contactname = "*Smith*")
12: stop(paste("Server returned an error message:\n", aa[[2]]), call. = FALSE)

2. Error: get_download accepts numeric values and returns values as expected ---
Server returned an error message:
 The remote server returned an error: (500) Internal Server Error.
Stack Trace:
   at System.Net.HttpWebRequest.GetResponse()
   at SpatialIT.CEI.Neotoma.Facade.FacadeRequestHandler.ProcessRequest(HttpContext context) in C:\Users\mikea\Documents\Visual Studio 2012\Projects\CEI\Neotoma\APIs\Facade\FacadeRequestHandler.vb:line 111
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls)
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: expect_message(get_download(1), "API call was successful") at test_neotoma.R:50
5: expect_that(object, shows_message(regexp, ...), info = info, label = label)
6: condition(object)
7: evaluate_promise(expr)
8: with_sink(temp, withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler))
9: withCallingHandlers(withVisible(code), warning = wHandler, message = mHandler)
10: withVisible(code)
11: get_download(1)
12: get_download.default(1)
13: lapply(x, get.sample)
14: FUN(X[[i]], ...)
15: stop(paste("Server returned an error message:\n", aa[[2]]), call. = FALSE)

3. Failure(@test_neotoma.R#70): is get_dataset working? ------------------------
get_dataset(gpid = 10) code did not generate an error

4. Error: is get_dataset working? ----------------------------------------------
subscript out of bounds
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls)
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: expect_is(get_dataset(x = 1)[[1]], "dataset") at test_neotoma.R:79
5: expect_that(object, is_a(class), info, label)
6: condition(object)
7: paste0(class(x), collapse = ", ")

5. Error: Crossing APIs --------------------------------------------------------
subscript out of bounds
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls)
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: expect_is(get_site(get_dataset(x = 100)[[1]]), "site") at test_neotoma.R:95
5: expect_that(object, is_a(class), info, label)
6: condition(object)
7: paste0(class(x), collapse = ", ")
8: get_site(get_dataset(x = 100)[[1]])

6. Error: some of the functions in the paper still work ------------------------
The dataset id (x) must be numeric.
1: withCallingHandlers(eval(code, new_test_environment), error = capture_calls)
2: eval(code, new_test_environment)
3: eval(expr, envir, enclos)
4: expect_is(block_one(), "download_list") at test_simple_paper.R:22
5: expect_that(object, is_a(class), info, label)
6: condition(object)
7: paste0(class(x), collapse = ", ")
8: block_one()
9: get_download(western.data) at test_simple_paper.R:14
10: get_download.dataset_list(western.data)
11: get_download(datasetid, verbose = verbose)
12: get_download.default(datasetid, verbose = verbose)
13: stop("The dataset id (x) must be numeric.")

Error: Test failures
In addition: Warning messages:
1: In getForm(base.uri, .params = cl) : No inputs passed to form
2: In FUN(X[[i]], ...) : 
The following taxa could not be found in the existing conversion table:
Amaranthaceae
The following taxa could not be found in the existing conversion table:
Polygonaceae
The following taxa could not be found in the existing conversion table:
Angiospermae undiff. (herbs)
3: In aggregate.counts(object) : 
The following taxa could not be found in the existing conversion table:
Amaranthaceae
The following taxa could not be found in the existing conversion table:
Polygonaceae
The following taxa could not be found in the existing conversion table:
Angiospermae undiff. (herbs)
Execution halted
SimonGoring commented 9 years ago

I have no idea what's going on then. Everything worked for me yesterday. I'll have to dig in and check. . .

Those server errors are neotoma API errors presumably, and that might be because they've been fixing some things on their end today, so the API might have been up and down . . . but I'm not sure.

gavinsimpson commented 9 years ago

@SimonGoring Unless you uncommented all the commented tests in test_neotom.R and re-ran R CMD check you wouldn't see any of this. I'm going to push my changes that activate these tests so that you see what I see and we'll see what Travis and Appveyor make of it too.

Once I've done the PR, can you merge in and check out the test you added which (as indicated elsewhere) has a syntax error in it. Would be good to have that running but it wasn't immediately clear from the code/commit what your intention was.

As for the server issues, we should probably make neotoma robust to that at some point...

SimonGoring commented 9 years ago

Okay, working this out now.

On Fri, May 1, 2015 at 12:46 PM, Gavin Simpson notifications@github.com wrote:

@SimonGoring https://github.com/SimonGoring Unless you uncommented all the commented tests in test_neotom.R and re-ran R CMD check you wouldn't see any of this. I'm going to push my changes that activate these tests so that you see what I see and we'll see what Travis and Appveyor make of it too.

Once I've done the PR, can you merge in and check out the test you added which (as indicated elsewhere) has a syntax error in it. Would be good to have that running but it wasn't immediately clear from the code/commit what your intention was.

As for the server issues, we should probably make neotoma robust to that at some point...

— Reply to this email directly or view it on GitHub https://github.com/ropensci/neotoma/issues/176#issuecomment-98185987.

SimonGoring commented 9 years ago

So it looks like everything is resolved ad that the tests were failing on the server side, not the package side. I've added some tests into test-neotoma to explicitly test the API results outside of the package. I'm marking this as resolved.