Skip to content

Speed up unit test suite #1125

@mssalvatore

Description

@mssalvatore

Spike

Objective

The unit test suite currently takes about 2.5 seconds to run on my machine. Shave as much time off as possible.

Scope

Time boxed to 1 day. @mssalvatore (0.25d)

Output

A set of code changes that result in a faster unit test execution time.

Areas of investigation

  • Collection currently takes .84 seconds
    • Perhaps translating some tests from unittest to pytest will improve collection time.
  • The test_is_dead() test has a 1 second sleep in it.
    • For starters, this looks like 3 tests: alive monkey, mia monkey, and dead monkey.
    • Is there a better way to test this functionality that doesn't require a sleep?
      • Maybe we can mock out time instead of actually waiting in real time.
      • Maybe we can inject different data into the database using mongomock.
  • Investigate using pytest-xdist to run tests in parallel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SpikeA small chunk of work with the objective of gathering information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions