-
Notifications
You must be signed in to change notification settings - Fork 8
Description
What's needed?
We need tests to be fast.
Proposed solution
Don't use nox anymore. Instead run each tool individually or ship our own tool to run all the linting and tests if necessary (for example: frequenz-repo-config lint and frequenz-repo-config test)
Use cases
All projects, but specially this one, that in integration tests need to run nox for 5 different generated projects on top of running nox for itself. All of that is also done twice, once for the minimum supported dependencies and one for the currently available dependencies. So it adds up.
Alternatives and workarounds
pre-commit might be an alternative to have a standarized way to invoke the tools and which tools should be used to test changes before creating a PR. We don't necessarily need to plug the pre-commit hook, pre-commit can also be invoked manually, but we take advantage of the well-known and adopted tool.
Additional context
Tests for all repos are very slow with nox, because it needs to create a new virtual environment for each session and inside of it, install all dependencies over and over again. Right now we have 5 sessions and we need to add more (pyupgrade, protolint, etc.).
Also nox for our use case brings practically zero advantages. nox is supposed to be useful to test with multiple Python or libraries versions, where having a separate virtual environment is really needed, but we don't use that and we rely on the CI to test with different Python versions and we have a separate session for the min/max dependencies with tests.
Also for the CI, there is absolutely no need to create a venv at all, as it starts with a clean environment where we can pip install directly, adding more unnecessary extra time to the mix.
The test for this repository are currently taking ~50 minutes to complete 🐢