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
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ migrate: ## Migrate the wagtail bakery site migrations
docker compose exec web python manage.py migrate

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?


format-wagtail: ## Format Wagtail repo
docker compose exec -w /code/wagtail web make format-server
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ make test
or

```sh
docker compose exec -w /code/wagtail web python runtests.py
docker compose exec -w /code/wagtail web python runtests.py --parallel
```

### Run tests for a specific file
Expand Down
Loading