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

Reduce dependence of unit tests on external sites #606

Open
sbliven opened this issue Nov 24, 2016 · 6 comments
Open

Reduce dependence of unit tests on external sites #606

sbliven opened this issue Nov 24, 2016 · 6 comments

Comments

@sbliven
Copy link
Member

@sbliven sbliven commented Nov 24, 2016

This has been discussed numerous times, but I didn't see an issue devoted to it.

The unit tests currently depend heavily on external resources, e.g. for downloading structures or genbank files. This means that tests cannot be run offline, and that temporary outages cause the build to fail. I suggest

  1. Wherever possible, include test resources directly in the repository rather than downloading. Large files (e.g. SCOP files) should be truncated into manageable subsets where possible.
  2. Unit tests that legitimately test connections to external resources should be moved to biojava-integrationtest. They should also test connections using junit assume statements (although travis also fails for failed assumptions).
  3. All modules except integrationtest should pass when offline
@sbliven sbliven added this to the BioJava 5.0.1 milestone Nov 24, 2016
@phidias51
Copy link

@phidias51 phidias51 commented Nov 27, 2016

@phidias51
Copy link

@phidias51 phidias51 commented Nov 27, 2016

@sbliven
Copy link
Member Author

@sbliven sbliven commented Nov 28, 2016

Switching between local and remote test modes sounds like it would just require testing everything twice to assure complete coverage.

Caching can speed up the tests when run locally, but it since Travis starts with a clean environment it doesn't reduce the dependence on remote resources.

I think the main task should be separating the local and remote tests so that the cause of travis failures is clearer. I would feel fine merging a PR if I knew the only error was that SCOPe is down, as long as the PR wasn't modifying the RemoteSCOPInstalllation class.

I've moved the integration tests to run last, so that we can see if all the non-integration tests pass successfully.

sbliven referenced this issue Nov 28, 2016
This should cause it to run last during tests
@sbliven
Copy link
Member Author

@sbliven sbliven commented Mar 23, 2017

The recent test failure (fixed by @valasatava in e38a0f5) highlights that this is important for reproducability, not just performance. Basically, one of the PDB entries was remediated in a way that broke our tests. This is now fixed in master, but it means that any commit prior to the fix will now fail the tests, as will any branch from previous versions.

@josemduarte
Copy link
Contributor

@josemduarte josemduarte commented Mar 10, 2018

For the last week or two travis is having problems downloading external resources, so this issue has become higher priority. We'll need to work towards reducing downloads as much as possible.

It seems that downloading large files is what travis can't/won't do anymore. Some tests to look at:

  • SiftsChainToUniprotMappingTest: consistently fails with a connection timeout... The file to download is a few MB.
  • SCOP tests: review if they are still enabled and still download large files or not
@phidias51
Copy link

@phidias51 phidias51 commented Mar 10, 2018

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.