STAR
Cal STAR — firmware, DAQ server, and engine design
Loading...
Searching...
No Matches
conftest.py
Go to the documentation of this file.
1"""CI quarantine for stale EngineDesign tests (non-control).
2
3These tests fail on the current ``main`` for reasons unrelated to any change
4under review — they were written against an older API / different default
5constants and were never updated. A test that is already red on a clean tree
6cannot act as a regression guard, so per the project's CI philosophy (gate on
7guards that catch *new* breakage, not on pre-existing drift) they are skipped
8here rather than blocking the gate.
9
10Each entry records *why* it is quarantined and how to revive it. The intent is
11for this list to shrink to empty: fix the test (or delete it if truly dead) and
12remove its entry. Nothing here deletes a test — the code stays visible.
13
14The robust-DDP controller suite has its own, larger quarantine in
15``tests/control/robust_ddp/conftest.py``.
16"""
17
18import pytest
19
20# Whole files quarantined.
21_QUARANTINE_FILES = {
22 "test_layer1_bounds_fix.py": (
23 "DEAD: imports `Layer1OptimizerConfig` from "
24 "engine.optimizer.layers.layer1_static_optimization, which no longer "
25 "exists anywhere in the codebase. The file cannot import. "
26 "Fix: update to the current optimizer-config API or delete."
27 ),
28}
29
30# Individual tests quarantined, keyed by "<file>::<Class>::<method>".
31# (2026-11-02: the Bernoulli-closure self-consistency check and the Layer 1
32# stability-margin default were revived -- both pass on this tree, and the
33# quarantine was hiding two working regression guards.)
34_QUARANTINE_TESTS = {
35 # Mock-based unit test: layer1 now deepcopies the config, and a MagicMock's
36 # deepcopy does not preserve `injector.type = "pintle"` as a string, so the
37 # injector-type validation rejects it.
38 "test_layer1_pressures.py::TestLayer1Pressures::test_pressures_in_config": (
39 "stale mock: layer1 now deepcopies config; the MagicMock loses "
40 "injector.type='pintle' through deepcopy and trips type validation — "
41 "rebuild on a real/typed config"
42 ),
43}
44
45
46def pytest_collection_modifyitems(config, items):
47 for item in items:
48 filename = item.path.name
49 if filename in _QUARANTINE_FILES:
50 item.add_marker(pytest.mark.skip(reason=_QUARANTINE_FILES[filename]))
51 continue
52 for suffix, reason in _QUARANTINE_TESTS.items():
53 if item.nodeid.endswith(suffix):
54 item.add_marker(pytest.mark.skip(reason=reason))
55 break
None pytest_collection_modifyitems(list[pytest.Item] items)
Definition conftest.py:31