openverse-api icon indicating copy to clipboard operation
openverse-api copied to clipboard

Tests are highly interdependent

Open dhruvkb opened this issue 3 years ago • 0 comments

Description

One of the widely accepted rules of testing is that tests should be as independent as possible, mocking and stubbing all of their ties with other modules. This is not the case in this repo's tests.

  • The API tests depend on the ingestion server working properly
  • The API tests write data to the real database.
  • The analytics tests use the same database to generate reports and depend on API tests passing to pass.

Expectation

Tests should pass or fail based on their own problems, not issues from other tests that they depend on. Databases should not be shared between tests, all DB needs should be stubbed by factories, fixtures or mocks.

Resolution

  • [ ] 🙋 I would be interested in resolving this bug.

dhruvkb avatar Dec 21 '21 09:12 dhruvkb