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

Speed up unit test suite #1125

Closed
mssalvatore opened this issue Apr 26, 2021 · 0 comments · Fixed by #1336
Closed

Speed up unit test suite #1125

mssalvatore opened this issue Apr 26, 2021 · 0 comments · Fixed by #1336
Labels
Spike A small chunk of work with the objective of gathering information.

Comments

@mssalvatore
Copy link
Collaborator

mssalvatore commented Apr 26, 2021

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.
@mssalvatore mssalvatore added the Spike A small chunk of work with the objective of gathering information. label Apr 26, 2021
@mssalvatore mssalvatore mentioned this issue Jul 19, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Spike A small chunk of work with the objective of gathering information.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant