From 77b937c0825809a2da8ecb9deb66136c571b9865 Mon Sep 17 00:00:00 2001 From: Hasnain Ibrar Date: Mon, 7 Sep 2026 17:33:32 +0300 Subject: [PATCH] test: compare resolved paths where the product resolves Two assertions compared a product-returned path against an unresolved temporary-directory path. The product resolves deliberately at both boundaries, so the comparisons hold only when no path component is rewritten during resolution: - `verified_local_path` in `artifact_delivery.py` calls `path.resolve(strict=True)` before an artifact path reaches the caller. - `_validated_marketplace_root` in `codex_plugin.py` calls `.expanduser().resolve()` before the Codex marketplace root is used. On Windows, `TMP` commonly holds an 8.3 short component when the user profile name contains a space. Resolution expands it, and both assertions fail on the short-versus-long form of the same path: AssertionError: WindowsPath('C:/Users/Hasnain Ibrar Butt/AppData/ Local/Temp/tmpzyyjwosm/clip.mp4') != WindowsPath('C:/Users/ HASNAI~1/AppData/Local/Temp/tmpzyyjwosm/clip.mp4') AssertionError: assert 'C:\Users\HASNAI~1\...\marketplace.json' == 'C:\Users\Hasnain Ibrar Butt\...\marketplace.json' Compare the resolved form on both sides, which is what each boundary documents and returns. CI does not reach either assertion. The full suite runs on ubuntu-latest, and the windows-2025 provider job runs only `test_models.py` and `test_indexing.py`. `test_codex_plugin.py` is additionally never collected by CI at all, because it defines module-level pytest functions and CI discovers tests with `python -m unittest discover -s tests`. Internal-only, test scope. No product behavior changes: both delivered paths were already correct and are still asserted, now in the form the boundaries actually return. Co-Authored-By: Claude Opus 5 (1M context) --- tests/test_codex_plugin.py | 2 +- tests/test_mcp.py | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_codex_plugin.py b/tests/test_codex_plugin.py index 674f6458..36c5389b 100644 --- a/tests/test_codex_plugin.py +++ b/tests/test_codex_plugin.py @@ -52,7 +52,7 @@ def test_export_codex_plugin_materializes_the_canonical_skill_bundle() -> None: "installation": "AVAILABLE", "authentication": "ON_INSTALL", } - assert exported.marketplace_path == str(marketplace_path) + assert Path(exported.marketplace_path) == marketplace_path.resolve() assert not (root / "marketplace.json").exists() diff --git a/tests/test_mcp.py b/tests/test_mcp.py index b5a06ae1..b05268f4 100644 --- a/tests/test_mcp.py +++ b/tests/test_mcp.py @@ -2353,7 +2353,10 @@ async def test_clip_submission_and_lazy_artifact_download(self): self.assertEqual(linked.structured_content["etag"], f'"{"1" * 64}"') self.assertEqual(linked.structured_content["state"], "ready") self.assertEqual(linked.structured_content["delivery_mode"], "local_file") - self.assertEqual(Path(linked.structured_content["local_path"]), clip) + self.assertEqual( + Path(linked.structured_content["local_path"]), + clip.resolve(), + ) self.assertIsNone(linked.structured_content["download_url"]) self.assertEqual(downloaded.contents[0].blob, "Y2xpcC1jb250ZW50")