Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions taskcluster/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ treeherder:
'doc': 'Documentation tasks'
'unit': 'Unit test tasks'
'unit-multithread': 'Unit test tasks with multithreading enabled'
'unit-serial': 'Unit test tasks with serial enabled'
'integration': 'Integration test tasks'

index:
Expand Down
20 changes: 20 additions & 0 deletions taskcluster/kinds/test/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ unit-multithread:
command: >-
uv run coverage run --data-file /builds/worker/artifacts/coverage --context=py{matrix[python]} -m pytest -vv

unit-serial:
description: "Run unit tests with py{matrix[python]} on Linux in serial mode"
matrix:
set-name: "unit-serial-py{matrix[python]}"
substitution-fields: [description, run.command, treeherder, worker, attributes]
python: ["314"]
worker:
docker-image: {in-tree: python}
env:
TASKGRAPH_SERIAL: "1"
artifacts:
- type: file
path: "/builds/worker/artifacts/coverage"
name: "public/coverage.py{matrix[python]}"
treeherder:
symbol: unit-serial(py{matrix[python]})
run:
command: >-
uv run coverage run --data-file /builds/worker/artifacts/coverage --context=py{matrix[python]} -m pytest -vv

integration:
description: "Run unit tests with py{matrix[python]} on Linux with resolution {matrix[resolution]}"
attributes:
Expand Down
8 changes: 5 additions & 3 deletions test/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@
from taskgraph.util.schema import SchemaValidationError

linuxonly = pytest.mark.skipif(
platform.system() != "Linux" or os.environ.get("TASKGRAPH_USE_THREADS"),
reason="requires Linux and 'fork' multiprocessing support",
platform.system() != "Linux"
or os.environ.get("TASKGRAPH_USE_THREADS")
or os.environ.get("TASKGRAPH_SERIAL"),
reason="requires Linux multiprocessing support",
)
threadsonly = pytest.mark.skipif(
not os.environ.get("TASKGRAPH_USE_THREADS"),
not os.environ.get("TASKGRAPH_USE_THREADS") or os.environ.get("TASKGRAPH_SERIAL"),
reason="requires multithreading to be enabled",
)

Expand Down
Loading