Skip to content

[Task]: Improve addons-server CI speed #16061

@diox

Description

@diox

Description

addons-server's test_main (x) CI jobs are slow. Those jobs run our Python tests through pytest, and the following things are slowing them down:

  • Starting full services. Those jobs start a full local development environment, but really we only need a few services. We should avoid starting:
    • addons-frontend (no frontend necessary)
    • worker (all celery tasks from unit tests should run in eager mode directly on the same container)
    • rabbitmq (see above)
    • elasticsearch (tests that need elasticsearch are already separate and not part of test_main` jobs)
    • nginx (no HTTP server necessary)
  • Reinstalling prod dependencies. Installing dev dependencies on top of the production container is needed, but we should skip re-installing prod ones: they are already there.
  • Recompiling locales. This is already done by building the web container. Furthermore, tests that need locales are already separate and not part of test_main jobs.
  • Doing a full initialize of the web container. This is completely useless, those jobs won't use the main database.

The total cost for all of these things can add up to a couple minutes, sometimes more.

In addition, we can look into increasing the number of jobs, which has been hardcoded at 14 since mozilla/addons-server#22318 but hasn't been updated as the number of tests rose. We've got over 8k tests now, so we likely want to hardcode 15 or 16 jobs if we're not going to have automated logic around that.

Finally, there are a number of optimizations to make in tests themselves, but outside of easy quick wins, that should be a separate ticket.

Acceptance Criteria

  • Our CI completes faster

┆Issue is synchronized with this Jira Task

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions