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

Mockhttptest #119

Merged
merged 12 commits into from
Jun 17, 2019
Merged

Mockhttptest #119

merged 12 commits into from
Jun 17, 2019

Conversation

SridharJagannathan
Copy link
Collaborator

@greg: I have made preliminary implementation for a single file test-annotation.R, please check and give me your overall comments.
Added preliminary testcases for test-annotation.R using the httptest package.
Step 1) Run the file configure_httptest.R
Step 2)Rename the folder structure as mentioned in step 5 of the file configure_httptest.r
Step 3) Run the test-annotation.R offline to check if the caching works

@jefferis
Copy link
Collaborator

Hi Sri, That's looking promising. There are a few additional considerations though.

  1. I'd like to retain tests against a live server as well as tests against mocked data
  2. but for the former, the tests could be relaxed to check structure rather than detailed response values
  3. The saved mocked test result will be visible in the GitHub repository. Therefore only publicly available data should be used (we could make an exception for less sensitive stuff like annotation or user lists, but definitely no skeleton / connectivity information).
  4. The easiest thing would be to run as many tests as possible against https://l1em.catmaid.virtualflybrain.org either live or using mocked/cached data.
  5. For mocked tests, where possible try to avoid very test results since they will inflate the package size

@SridharJagannathan
Copy link
Collaborator Author

@jefferis I have added support for testing against a public live server using the following env var
Sys.setenv(MOCK_BYPASS = "true") #"true" (public live server) , "capture" (mock server)
We can possibly put this env var in a config file or on travis env?

@jefferis
Copy link
Collaborator

@jefferis I have added support for testing against a public live server using the following env var
Sys.setenv(MOCK_BYPASS = "true") #"true" (public live server) , "capture" (mock server)
We can possibly put this env var in a config file or on travis env?

I was hoping to have both tests, with different kinds of expectations, rather than switching between one or the other.

@SridharJagannathan
Copy link
Collaborator Author

I have made preliminary implementations for both mock and public live server, can you please check. Once this design is Ok, then I will add detailed test cases for mock and just structure for live server

@SridharJagannathan
Copy link
Collaborator Author

Hi @jefferis, I'm surprised by this in my mac I have removed all the environmental variables and re run the tests and only 2 of them get skipped, please see the attached screenshot
Screenshot 2019-06-17 at 09 44 52

@jefferis
Copy link
Collaborator

@SridharJagannathan My apologies – all working perfectly. Somehow managed not to update to latest version of your code. Will merge now.

@jefferis jefferis merged commit 96c4582 into master Jun 17, 2019
@jefferis jefferis deleted the mockhttptest branch June 17, 2019 08:54
@jefferis jefferis mentioned this pull request Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants