Skip to content

Commit b93ff5b

Browse files
roelzkie15Roel Delos Reyes
andauthored
chore(pytest-xdist): Install pytest-xdist to enable parallel testing. (#776)
Co-authored-by: Roel Delos Reyes <[email protected]>
1 parent aaae003 commit b93ff5b

File tree

5 files changed

+99
-3
lines changed

5 files changed

+99
-3
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100
- name: Install Django ${{ matrix.django-version }}
101101
run: poetry run pip install "django==${{ matrix.django-version }}"
102102
- name: Test with pytest
103-
run: poetry run pytest --showlocals -vvv --cov-report=xml
103+
run: poetry run pytest -n auto --showlocals -vvv --cov-report=xml
104104
- name: Upload coverage to Codecov
105105
uses: codecov/codecov-action@v5
106106
env:

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY : install test lint
1+
.PHONY : install test test-dist lint
22

33
POETRY := $(shell command -v poetry 2> /dev/null)
44

@@ -9,3 +9,6 @@ install:
99

1010
test:
1111
${POETRY} run pytest
12+
13+
test-dist:
14+
${POETRY} run pytest -n auto

README.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,39 @@ type Query {
137137
fruits: [Fruit!]!
138138
}
139139
```
140+
141+
## Contributing
142+
143+
We use [poetry](https://github.com/sdispater/poetry) to manage dependencies, to
144+
get started follow these steps:
145+
146+
```shell
147+
$ git clone https://github.com/strawberry-graphql/strawberry-django
148+
$ cd strawberry-django
149+
$ python -m pip install poetry
150+
$ make install
151+
```
152+
153+
### Running tests
154+
155+
Using [make](Makefile) to run the tests:
156+
157+
```shell
158+
$ make test
159+
```
160+
161+
To run tests in parallel:
162+
163+
```shell
164+
$ make test-dist
165+
```
166+
167+
### Pre commit
168+
169+
We have a configuration for
170+
[pre-commit](https://github.com/pre-commit/pre-commit), to add the hook run the
171+
following command:
172+
173+
```shell
174+
pre-commit install
175+
```

poetry.lock

Lines changed: 57 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ pytest-django = "^4.1.0"
5555
pytest-mock = "^3.5.1"
5656
pytest-snapshot = "^0.9.0"
5757
pytest-watch = "^4.2.0"
58+
pytest-xdist = "^3.8.0"
5859
ruff = "^0.12.1"
5960
django-polymorphic = "^3.1.0"
6061
setuptools = "^80.1.0"

0 commit comments

Comments
 (0)