mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 11:06:11 -10:00
Merge pull request #11749 from M0-kii/fix/windows-launcher-bin-tests
Run launcher binary tests in the Windows PR checker
This commit is contained in:
2 files changed
+21
-1
No files matched your search
@@ -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
|
||||
|
||||
+1
-1
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user