Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve failing tests #148

Closed
tomschenkjr opened this issue Dec 4, 2017 · 4 comments
Closed

Resolve failing tests #148

tomschenkjr opened this issue Dec 4, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@tomschenkjr
Copy link
Contributor

Received an email from the CRAN support team, noting that some RSocrata tests are failing on a regular basis. Below is an excerpt of the failing tests as of 2017-12-04:

Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
Not Found (HTTP 404).
1: read.socrata("https://data.cityofboston.gov/resource/awu8-dc52.csv?$where=case_enquiry_id< 101000295717") at testthat/test-all.R:239
2: getResponse(validUrl, email, password)
3: httr::stop_for_status(response)

2017-12-03 18:22:49.492 getResponse: Error in httr GET: 400 https://soda.demo.socrata.com/resource/4334-bgaj.csv?%24app_token=ew2rEMuESuzWPqMkyPfOSGJgE&$order=:id
2017-12-03 18:22:50.056 getResponse: Error in httr GET: 400 https://soda.demo.socrata.com/resource/4334-bgaj.csv?%24app_token=ew2rEMuESuzWPqMkyPfOSGJgE&$order=:id
2017-12-03 18:22:51.723 getResponse: Error in httr GET: 403 https://soda.demo.socrata.com/resource/a9g2-feh2.csv?$order=:id
2017-12-03 18:22:52.356 getResponse: Error in httr GET: 403 https://soda.demo.socrata.com/resource/a9g2-feh2.json?$order=:id
testthat results ================================================================
OK: 155 SKIPPED: 0 FAILED: 1

  1. Error: Read data with missing dates (@test-all.R#239)

The error pertains to #137 that we now need to resolve.

The 400 and 403 errors are more mysterious. Below is the output of https://soda.demo.socrata.com/resource/4334-bgaj.csv?%24app_token=ew2rEMuESuzWPqMkyPfOSGJgE&$order=:id

{
  "error" : true,
  "message" : "Unrecognized arguments [$app_token]"
}

I will email Socrata to determine the source of the error.

Fixes will need to be submitted by 2017-12-17.

@tomschenkjr
Copy link
Contributor Author

Just a quick bit of research, appears that Socrata has changed the parameter from $app_token to $$app_token.

@tomschenkjr tomschenkjr added this to the 1.7.4 milestone Dec 4, 2017
@tomschenkjr tomschenkjr self-assigned this Dec 4, 2017
@tomschenkjr
Copy link
Contributor Author

While looking at the errors, it appears another problem is the resource a9g2-feh2 used to test reading from private data sets is no longer accessible with the provided login credentials.

The test dataset lives on Socrata, so I've opened a ticket, 24165, with them to resolve this.

Oddly, those credentials do seem to work with the test dataset for writing data.

@tomschenkjr
Copy link
Contributor Author

The authentication problem with a9g2-feh2 has been resolved by Socrata.

However, this test expects an error because it only uses $app_token instead of the correct $$app_token. While we use testthat::expect_error(), httr will still return an error:

getResponse: Error in httr GET: 400  https://soda.demo.socrata.com/resource/4334-bgaj.csv?%24app_token=ew2rEMuESuzWPqMkyPfOSGJgE&$order=:id

It's unclear why an error is being returned while an error is expect. Unclear whether this is an issue with testthat or httr. @geneorama indicated he may have a fix for this, so waiting on his input on a work-around.

@tomschenkjr
Copy link
Contributor Author

The 400 errors are a consequence of #137. When encountering the latter errors, R will dump out messages generated by RSocrata's getResponse() function and will print alongside the 404 error (or any other error). By resolving #137, it also resolved this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant