Skip to content

Reduce dependence of unit tests on external sites #606

Open

Description

@sbliven

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

Activity

  1. added
    enhancement
    on Nov 24, 2016
  2. added this to the milestone on Nov 24, 2016
  3. phidias51 commented on Nov 27, 2016

    @phidias51
  4. phidias51 commented on Nov 27, 2016

    @phidias51
  5. sbliven commented on Nov 28, 2016

    @sbliven
    MemberAuthor

    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.

  6. sbliven commented on Mar 23, 2017

    @sbliven
    MemberAuthor

    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.

  7. josemduarte commented on Mar 10, 2018

    @josemduarte
    Contributor

    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
  8. phidias51 commented on Mar 10, 2018

    @phidias51
  9. added
    testing
    on Mar 11, 2018
  10. removed this from the BioJava 5.3.1 milestone on Mar 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlow prioritytesting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions