diff --git a/taskcluster/config.yml b/taskcluster/config.yml index fd6eeedaa..60d32c40c 100644 --- a/taskcluster/config.yml +++ b/taskcluster/config.yml @@ -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: diff --git a/taskcluster/kinds/test/linux.yml b/taskcluster/kinds/test/linux.yml index c0b3b8280..94f73ba58 100644 --- a/taskcluster/kinds/test/linux.yml +++ b/taskcluster/kinds/test/linux.yml @@ -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: diff --git a/test/test_generator.py b/test/test_generator.py index 2024f6178..8a31c186a 100644 --- a/test/test_generator.py +++ b/test/test_generator.py @@ -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", )