From 68ec463175e7c5d3864b923e9245fb4191a1779e Mon Sep 17 00:00:00 2001 From: M0-kii Date: Sat, 7 Nov 2026 15:35:53 +0330 Subject: [PATCH] Run launcher binary tests in the Windows PR checker Keep --bins in the Windows launcher test command so binary-owned tests are checked alongside the library, matching the planned validation. Fixes #11747 --- tests/test_pr_ready.py | 20 ++++++++++++++++++++ tools/pr_ready.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/test_pr_ready.py b/tests/test_pr_ready.py index d626342d1d..3e26f6ca9e 100644 --- a/tests/test_pr_ready.py +++ b/tests/test_pr_ready.py @@ -199,6 +199,26 @@ class PrReadyTests(unittest.TestCase): for name in ("launcher rustfmt", "launcher clippy", "launcher tests"): self.assertIsNone(by_name[name].skip) + @unittest.skipUnless(shutil.which("cargo"), "needs cargo") + def test_windows_launcher_checks_include_binary_tests(self): + with tempfile.TemporaryDirectory() as temp: + root = Path(temp) + launcher = root / "launcher" + (launcher / "src").mkdir(parents=True) + (launcher / "Cargo.toml").write_text( + '[package]\nname = "launcher-check-fixture"\nversion = "0.1.0"\nedition = "2021"\n[workspace]\n') + (launcher / "src/lib.rs").write_text('#[test]\nfn library_passes() {}\n') + (launcher / "src/main.rs").write_text( + 'fn main() {}\n#[test]\nfn binary_fails() { panic!("launcher binary test ran"); }\n') + with mock.patch.object(pr_ready, "ROOT", root), \ + mock.patch.dict(os.environ, {"CARGO_TARGET_DIR": str(root / "target")}): + subprocess.run(["cargo", "generate-lockfile", "--offline"], cwd=launcher, check=True, + capture_output=True) + step = pr_ready.Step("launcher tests", "cargo test --locked --lib --bins") + pr_ready.run_windows([step], verbose=False) + self.assertEqual(step.status, "fail") + self.assertIn("launcher binary test ran", step.output) + @unittest.skipUnless(POSIX_BASH, "needs a bash that is not WSL's") def test_the_launcher_fallback_asks_for_a_feature_the_launcher_has(self): """The macOS fallback must name gpui_platform/runtime_shaders: gpui_platform is launcher/Cargo.toml's diff --git a/tools/pr_ready.py b/tools/pr_ready.py index d7c940ce4b..7021f4f9fe 100755 --- a/tools/pr_ready.py +++ b/tools/pr_ready.py @@ -488,7 +488,7 @@ def run_windows(steps, verbose): command = ["cargo", "clippy", "--all-targets", "--locked", "--", "-D", "warnings"] cwd = ROOT / "launcher" elif step.name == "launcher tests": - command = ["cargo", "test", "--locked", "--lib"] + command = ["cargo", "test", "--locked", "--lib", "--bins"] cwd = ROOT / "launcher" elif step.name == "Parity": command = shlex.split(step.command)