unit check: run the whole tests/ tree, not just tests/unit
The check took ../tests/unit alone, so the broker's, the pointer driver's and the sessions suites were collected by no check at all -- 432 of 551 tests ran only when someone happened to enter the dev shell. It now takes ../tests, which surfaced two real defects in the harness rather than in the code: - tests/sessions/integration/test_lifecycle.py locates the repository by looking upward for a pyproject.toml, which a build has no reason to contain; it raised at import and took the whole run down as a collection error. The check now copies the marker in, which is what the test documents it needs. - That file also REPLACED PYTHONPATH for the daemon it spawns instead of prepending to it. In a checkout src/ is the package, so it worked; under a build it discarded the package under test, and 'python -m hhstreamd' died at startup with an ImportError -- reported as a daemon failure on every test in the file. Prepending is the fix, and the right behaviour anywhere. pywayland joins the test environment because the pointer driver imports it. unit: 551 collected, 550 passed, 1 skipped (a deliberate skip).
This commit is contained in:
1 parent
e8b3855a05
commit
20b2aee109
2 files changed
+32
-5
No files matched your search
@@ -52,7 +52,17 @@ def _repo_root() -> Path:
|
||||
|
||||
REPO_ROOT = _repo_root()
|
||||
#: The package lives under `src/` here. Keep the root too, so a flat checkout works.
|
||||
IMPORT_PATH = os.pathsep.join([str(REPO_ROOT / "src"), str(REPO_ROOT)])
|
||||
#:
|
||||
#: These are PREPENDED to whatever PYTHONPATH we inherited rather than replacing
|
||||
#: it. Clobbering it works in a checkout, where `src/` is the package, but under
|
||||
#: a build (checks/unit.nix) the package under test is what the inherited path
|
||||
#: points at -- so replacing it made `python -m hhstreamd` die at startup with an
|
||||
#: ImportError, and every test in this file error out in its setup, which reads
|
||||
#: as a daemon bug rather than a harness one.
|
||||
_CHECKOUT_PATH = os.pathsep.join([str(REPO_ROOT / "src"), str(REPO_ROOT)])
|
||||
IMPORT_PATH = os.pathsep.join(
|
||||
p for p in (_CHECKOUT_PATH, os.environ.get("PYTHONPATH", "")) if p
|
||||
)
|
||||
|
||||
# The brief's dummy app, verbatim.
|
||||
SLEEP_600 = "import time; time.sleep(600)"
|
||||
|
||||
Reference in new issue
Block a user