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

run tests in parallel #81

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

run tests in parallel #81

wants to merge 3 commits into from

Conversation

smark-1
Copy link
Contributor

@smark-1 smark-1 commented Nov 22, 2024

when I run docker compose exec -w /code/wagtail web python runtests.py --parallel the tests run significantly faster then when I run docker compose exec -w /code/wagtail web python runtests.py without --parallel.

CPU, Memory, and Disk usage appear to be approximately the same. So adding this to the make file would be a big win for me.

Makefile Outdated
Comment on lines 43 to 44
test: ## Run all wagtail tests or pass in a file with `make test file=wagtail.admin.tests.test_name`
docker compose exec -w /code/wagtail web python runtests.py $(file) $(FILE)
docker compose exec -w /code/wagtail web python runtests.py $(file) $(FILE) --parallel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably add a separate command for this (or make it possible to pass additional arguments to make test to be passed on to runtests.py). Running tests in parallel is definitely much faster, but sometimes Django/unittest cannot produce a helpful traceback due to some pickling issues, in which case you'd still want to run it in serial.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could perhaps just add a separate command that runs in parallel for time being? E.g. have both make test and make test-parallel in the Makefile. @smark-1 could you change the PR so that we have these two commands?

Unless @laymonage has a goto solution for passing arguments from the make command, which to me seems like a slightly bigger task.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the solution and yep it is quite a task in itself, so I just put it in parentheses in case we do want to figure that one out 😆

But yes, I'm happy with just a separate command!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saevarom I updated the PR. I am not sure what the best way to document this is.

  1. test-parallel be a new subsection in the docs?
  2. Or should be mentioned as an comment above each make test ... option?
  3. Or a paragraph somewhere saying your can replace make test with make test-parallel to run faster but it sometimes cannot produce a helpful traceback?
  4. other?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants