team-ljyzipelo

공개
526줄25 KB
1from contextlib import redirect_stdout
2from io import StringIO
3import json
4import os
5from pathlib import Path, PurePosixPath, PureWindowsPath
6import tempfile
7import subprocess
8import sys
9import unittest
10from unittest.mock import ANY, patch
11
12import run_rust
13
14
15TEST_WORK = run_rust.work_directory(
16 run_rust.ROOT, os.environ.get("ZIPELO_CI_JOB", "rust-local")
17)
18
19
20class RunnerTests(unittest.TestCase):
21 def test_job_directory_is_restricted_to_one_work_child(self):
22 for name in ("../escape", "other/job", "", ".hidden", "bad name"):
23 with self.subTest(name=name), self.assertRaises(ValueError):
24 run_rust.work_directory(run_rust.ROOT, name)
25 self.assertEqual(run_rust.work_directory(
26 run_rust.ROOT, os.environ.get("ZIPELO_CI_JOB", "rust-local")
27 ), TEST_WORK)
28
29 def test_work_directory_rejects_symlinked_parents_before_creation(self):
30 for link_name in ("tests", "tests/work"):
31 with self.subTest(link_name=link_name), tempfile.TemporaryDirectory(
32 dir=TEST_WORK
33 ) as directory:
34 base = Path(directory)
35 project = base / "project"
36 project.mkdir()
37 outside = base / "outside"
38 outside.mkdir()
39 link = project / link_name
40 link.parent.mkdir(parents=True, exist_ok=True)
41 link.symlink_to(outside, target_is_directory=True)
42 with patch.object(
43 run_rust.subprocess, "check_output", return_value=str(project / ".git")
44 ):
45 with self.assertRaisesRegex(ValueError, "안전한 작업 디렉터리"):
46 run_rust.work_directory(project, "task")
47 self.assertFalse((outside / "task").exists())
48 self.assertFalse((outside / "work").exists())
49
50 def test_fixture_parent_symlink_is_rejected_before_creating_children(self):
51 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
52 base = Path(directory)
53 work = base / "work"
54 work.mkdir()
55 outside = base / "outside"
56 outside.mkdir()
57 (work / "fixtures").symlink_to(outside, target_is_directory=True)
58 with (
59 patch.object(run_rust, "test_work_directory", return_value=work),
60 self.assertRaisesRegex(ValueError, "작업 폴더 밖"),
61 ):
62 run_rust.prepare_fixtures(run_rust.ROOT)
63 self.assertEqual(list(outside.iterdir()), [])
64
65 def test_windows_setup_rejects_symlinked_parent_before_creating_tools(self):
66 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
67 base = Path(directory)
68 project = base / "project"
69 ci = project / "tests/ci"
70 ci.mkdir(parents=True)
71 work = project / "tests/work/task"
72 work.mkdir(parents=True)
73 script = ci / "setup_windows.sh"
74 script.write_bytes((run_rust.ROOT / "tests/ci/setup_windows.sh").read_bytes())
75 commands = base / "bin"
76 commands.mkdir()
77 git = commands / "git"
78 git.write_text('#!/bin/sh\nprintf "%s\n" "$FAKE_GIT_COMMON"\n')
79 git.chmod(0o700)
80 outside = base / "outside"
81 outside.mkdir()
82 (work / "linked").symlink_to(outside, target_is_directory=True)
83 environment = {
84 **os.environ,
85 "PATH": str(commands) + os.pathsep + os.environ["PATH"],
86 "FAKE_GIT_COMMON": str(project / ".git"),
87 "ZIPELO_CI_JOB": "task",
88 "ZIPELO_CI_TOOLS": str(work / "linked/tools"),
89 }
90 result = subprocess.run(["bash", str(script)], env=environment,
91 capture_output=True, text=True)
92 self.assertNotEqual(result.returncode, 0)
93 self.assertIn("작업 폴더 밖", result.stderr)
94 self.assertEqual(list(outside.iterdir()), [])
95
96 def test_windows_setup_rejects_external_rustup_before_install(self):
97 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
98 base = Path(directory)
99 project = base / "project"
100 ci = project / "tests/ci"
101 ci.mkdir(parents=True)
102 work = project / "tests/work/task"
103 tools = work / "tools"
104 tools.mkdir(parents=True)
105 script = ci / "setup_windows.sh"
106 script.write_bytes((run_rust.ROOT / "tests/ci/setup_windows.sh").read_bytes())
107 commands = base / "bin"
108 commands.mkdir()
109 git = commands / "git"
110 git.write_text('#!/bin/sh\nprintf "%s\n" "$FAKE_GIT_COMMON"\n')
111 git.chmod(0o700)
112 for name in ("apt-get", "dpkg-deb"):
113 command = commands / name
114 command.write_text("#!/bin/sh\nexit 0\n")
115 command.chmod(0o700)
116 rustup = commands / "rustup"
117 rustup.write_text(
118 '#!/bin/sh\nmkdir -p "$RUSTUP_HOME"\nprintf marker > "$RUSTUP_HOME/marker"\n'
119 )
120 rustup.chmod(0o700)
121 outside = base / "outside"
122 outside.mkdir()
123 environment = {
124 **os.environ,
125 "PATH": str(commands) + os.pathsep + os.environ["PATH"],
126 "FAKE_GIT_COMMON": str(project / ".git"),
127 "ZIPELO_CI_JOB": "task",
128 "ZIPELO_CI_TOOLS": str(tools),
129 }
130 for name in ("rustup", "cargo", "downloads/nested"):
131 with self.subTest(name=name):
132 link = tools / name
133 link.parent.mkdir(parents=True, exist_ok=True)
134 link.symlink_to(outside, target_is_directory=True)
135 result = subprocess.run(
136 ["bash", str(script)], env=environment,
137 capture_output=True, text=True,
138 )
139 self.assertNotEqual(result.returncode, 0)
140 self.assertIn("작업 폴더 밖", result.stderr)
141 self.assertEqual(list(outside.iterdir()), [])
142 link.unlink()
143
144 def test_output_paths_reject_symlinks_outside_job(self):
145 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
146 work = Path(directory)
147 outside = TEST_WORK / "outside"
148 for name in ("tmp", "target"):
149 with self.subTest(name=name):
150 link = work / name
151 link.symlink_to(outside, target_is_directory=True)
152 with self.assertRaisesRegex(ValueError, "작업 폴더 밖"):
153 run_rust.output_directory(work, name, create=True)
154 self.assertFalse(outside.exists())
155 link.unlink()
156
157 def test_output_paths_allow_symlinks_within_job(self):
158 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
159 work = Path(directory)
160 inner = work / "inner"
161 inner.mkdir()
162 link = work / "tmp"
163 link.symlink_to(inner, target_is_directory=True)
164 self.assertEqual(run_rust.output_directory(work, "tmp", create=True), link)
165
166 def test_cargo_and_temp_paths_are_kept_in_job_directory(self):
167 if "ZIPELO_TEST_WORK_DIR" not in os.environ:
168 self.skipTest("러너가 설정한 작업 경로에서 검사함")
169 for key in ("CARGO_TARGET_DIR", "CARGO_HOME", "TMPDIR", "TMP", "TEMP",
170 "ZIPELO_TEST_WORK_DIR"):
171 with self.subTest(key=key):
172 self.assertTrue(Path(os.environ[key]).resolve().is_relative_to(TEST_WORK))
173
174 def test_cargo_home_rejects_external_symlink(self):
175 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
176 work = Path(directory)
177 tools = work / "tools"
178 tools.mkdir()
179 outside = TEST_WORK / "outside"
180 (tools / "cargo").symlink_to(outside, target_is_directory=True)
181 with self.assertRaisesRegex(ValueError, "작업 폴더 밖"):
182 run_rust.output_directory(tools, "cargo", create=True)
183 self.assertFalse(outside.exists())
184
185 def test_changed_crates_include_reverse_dependencies(self):
186 paths = run_rust.manifests(run_rust.ROOT)
187 by_name = {path.parent.name: path for path in paths}
188 self.assertEqual(
189 run_rust.select_manifests(
190 run_rust.ROOT, paths, {"README.md", "docs/ui-scenario-guide.md"}
191 ),
192 [],
193 )
194 selected = set(run_rust.select_manifests(
195 run_rust.ROOT, paths, {"experiments/rust-archive-worker/src/zip_recovery.rs"}
196 ))
197 for name in ("rust-archive-worker", "rust-ui-memory-app",
198 "rust-app-real-worker", "rust-large-archive-fixtures",
199 "rust-zip64-compat"):
200 self.assertIn(by_name[name], selected)
201 self.assertNotIn(by_name["rust-memory-gzip-reader"], selected)
202 self.assertEqual(
203 run_rust.select_manifests(run_rust.ROOT, paths, {"tests/ci/run_rust.py"}),
204 paths,
205 )
206
207 def test_changed_file_list_includes_worktree_and_untracked_files(self):
208 with patch.object(run_rust.subprocess, "check_output", side_effect=[
209 "base\n",
210 b"experiments/rust-archive-worker/src/lib.rs\0",
211 b"tests/rust-app-ui/new_case.rs\0",
212 ]) as git:
213 changes = run_rust.changed_files(run_rust.ROOT)
214 self.assertEqual(changes, {
215 "experiments/rust-archive-worker/src/lib.rs",
216 "tests/rust-app-ui/new_case.rs",
217 })
218 self.assertEqual(git.call_count, 3)
219
220 def test_changed_file_list_ignores_runner_outputs_in_job_worktree(self):
221 with (
222 patch.dict(run_rust.os.environ, {"ZIPELO_TEST_WORK_DIR": str(run_rust.ROOT)}),
223 patch.object(run_rust.subprocess, "check_output", side_effect=[
224 "base\n",
225 b"README.md\0",
226 b"target/debug/app\0tools/cargo/config.toml\0"
227 b"tmp/result\0fixtures/data\0local-results.json\0",
228 ]),
229 ):
230 self.assertEqual(run_rust.changed_files(run_rust.ROOT), {"README.md"})
231
232 def test_empty_selection_does_not_require_cross_tools(self):
233 with patch.object(run_rust, "prepare_cross_build",
234 side_effect=AssertionError("도구를 준비하면 안 됨")):
235 self.assertEqual(
236 run_rust.execute_phases(run_rust.ROOT, ["build", "test", "cross-build"], []),
237 [],
238 )
239
240 def test_runner_sets_cargo_home_in_job_before_execution(self):
241 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
242 work = Path(directory)
243 with (
244 patch.object(run_rust, "work_directory", return_value=work),
245 patch.object(run_rust, "prepare_tools"),
246 patch.object(run_rust.sys, "argv", ["run_rust.py", "build"]),
247 patch.object(run_rust.subprocess, "run",
248 return_value=subprocess.CompletedProcess([], 0)),
249 patch.object(run_rust.subprocess, "check_output",
250 return_value="tested-head\n"),
251 patch.object(run_rust, "execute_phases", return_value=[]) as execute,
252 patch.dict(run_rust.os.environ, {"GITHUB_STEP_SUMMARY": ""}),
253 redirect_stdout(StringIO()),
254 ):
255 self.assertEqual(run_rust.main(), 0)
256 self.assertEqual(
257 run_rust.os.environ["CARGO_HOME"], str(work / "tools/cargo")
258 )
259 self.assertTrue((work / "tools/cargo").is_dir())
260 execute.assert_called_once()
261
262 def test_all_manifests_have_locks(self):
263 paths = run_rust.manifests(run_rust.ROOT)
264 expected = set(run_rust.ROOT.glob("experiments/*/Cargo.toml"))
265 expected |= set(run_rust.ROOT.glob("tests/*/Cargo.toml"))
266 self.assertEqual(set(paths), expected)
267
268 def test_failure_does_not_hide_later_crates(self):
269 paths = [
270 Path("/repo/experiments/a/Cargo.toml"),
271 Path("/repo/experiments/b/Cargo.toml"),
272 ]
273 with (
274 patch.object(run_rust, "manifests", return_value=paths),
275 patch.object(run_rust.subprocess, "run", side_effect=[
276 subprocess.CompletedProcess([], 7),
277 subprocess.CompletedProcess([], 0),
278 ]),
279 ):
280 results = run_rust.run(Path("/repo"), "build")
281 self.assertEqual([row["status"] for row in results], ["failed", "passed"])
282 self.assertEqual(results[0]["exit_code"], 7)
283
284 def test_windows_exclusion_is_explicit_and_only_for_linux_tests(self):
285 paths = [
286 Path("/repo/tests/rust-file-publication/Cargo.toml"),
287 Path("/repo/experiments/rust-file-publication/Cargo.toml"),
288 ]
289 with (
290 patch.object(run_rust, "manifests", return_value=paths),
291 patch.object(run_rust.sys, "platform", "win32"),
292 patch.object(
293 run_rust.subprocess, "run",
294 return_value=subprocess.CompletedProcess([], 0),
295 ) as execute,
296 ):
297 results = run_rust.run(Path("/repo"), "test")
298 self.assertEqual(
299 [row["status"] for row in results], ["not-applicable", "passed"]
300 )
301 self.assertEqual(execute.call_count, 1)
302
303 def test_fixture_bytes_match_git_blobs(self):
304 names = subprocess.check_output(
305 ["git", "ls-files", "-z", "tests/**/fixtures/*"], cwd=run_rust.ROOT
306 ).decode("utf-8").split("\0")
307 names = [name for name in names if name]
308 self.assertTrue(names, "검증할 fixture가 없음")
309 for name in names:
310 with self.subTest(path=name):
311 expected = subprocess.check_output(
312 ["git", "show", f"HEAD:{name}"], cwd=run_rust.ROOT
313 )
314 self.assertEqual((run_rust.ROOT / name).read_bytes(), expected)
315
316 def test_cross_build_never_executes_tests(self):
317 args = run_rust.command(Path("tests/example/Cargo.toml"), "cross-build")
318 self.assertEqual(args[2], "build")
319 self.assertIn(run_rust.WINDOWS_TARGET, args)
320 self.assertNotIn("--test-threads=1", args)
321
322 def test_preflight_failure_is_reported_without_hiding_other_phase(self):
323 with (
324 patch.object(run_rust, "prepare_cross_build", side_effect=ValueError("missing linker")),
325 patch.object(run_rust, "run", return_value=[{"manifest": "sample", "status": "passed"}]),
326 ):
327 results = run_rust.execute_phases(Path("/repo"), ["build", "cross-build"])
328 self.assertEqual([row["status"] for row in results], ["passed", "failed"])
329 self.assertEqual(results[1]["reason"], "missing linker")
330
331 def test_self_check_failure_replaces_previous_success_report(self):
332 for phase, platform in (("local", "linux"), ("test", "win32")):
333 with self.subTest(phase=phase), tempfile.TemporaryDirectory(
334 dir=TEST_WORK
335 ) as directory:
336 root = Path(directory)
337 (root / "work/tmp").mkdir(parents=True)
338 report_path = root / f"work/{phase}-results.json"
339 with (
340 patch.object(run_rust, "ROOT", root),
341 patch.object(run_rust, "work_directory", return_value=root / "work"),
342 patch.object(run_rust, "prepare_tools"),
343 patch.object(run_rust, "prepare_local_tools"),
344 patch.object(run_rust.sys, "argv", ["run_rust.py", phase]),
345 patch.object(run_rust.sys, "platform", platform),
346 patch.dict(run_rust.os.environ, {"GITHUB_STEP_SUMMARY": ""}),
347 patch.object(run_rust.subprocess, "run", side_effect=[
348 subprocess.CompletedProcess([], 0),
349 subprocess.CompletedProcess([], 7),
350 ]),
351 patch.object(run_rust.subprocess, "check_output", side_effect=[
352 "successful-head\n", "failed-head\n",
353 ]),
354 patch.object(run_rust, "execute_phases", return_value=[
355 {"phase": "test", "manifest": "sample", "status": "passed"},
356 ]) as execute,
357 redirect_stdout(StringIO()),
358 ):
359 self.assertEqual(run_rust.main(), 0)
360 successful = json.loads(report_path.read_text(encoding="utf-8"))
361 self.assertEqual(successful["results"][0]["status"], "passed")
362 self.assertEqual(run_rust.main(), 7)
363 failed = json.loads(report_path.read_text(encoding="utf-8"))
364 self.assertEqual(failed["head"], "failed-head")
365 self.assertEqual(failed["results"], [{
366 "phase": "self-check",
367 "manifest": "tests/ci",
368 "status": "failed",
369 "exit_code": 7,
370 }])
371 self.assertFalse(failed["windows_runtime_tested"])
372 execute.assert_called_once()
373
374 @unittest.skipUnless(sys.platform == "linux", "Linux MinGW 실행 파일 탐색 시험임")
375 def test_linked_worktree_finds_setup_tools_without_path_export(self):
376 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
377 base = Path(directory)
378 root = base / "linked"
379 tools = base / "tests/ci/tools"
380 binaries = tools / "mingw/usr/bin"
381 binaries.mkdir(parents=True)
382 for name in ("gcc", "g++"):
383 executable = binaries / f"x86_64-w64-mingw32-{name}-posix"
384 executable.write_text("#!/bin/sh\nexit 0\n")
385 executable.chmod(0o700)
386 rustup = tools / "rustup"
387 (rustup / "toolchains/1.99.1-x86_64-unknown-linux-gnu").mkdir(parents=True)
388 with (
389 patch.dict(run_rust.os.environ, {"PATH": ""}, clear=True),
390 patch.object(run_rust.subprocess, "check_output", return_value=str(base / ".git")),
391 ):
392 run_rust.prepare_tools(root)
393 run_rust.prepare_cross_build()
394 self.assertEqual(run_rust.os.environ["RUSTUP_HOME"], str(rustup))
395 self.assertEqual(
396 run_rust.os.environ["CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER"],
397 str(binaries / "x86_64-w64-mingw32-gcc-posix"),
398 )
399
400 @unittest.skipUnless(sys.platform == "linux", "Linux MinGW 실행 파일 탐색 시험임")
401 def test_default_checkout_reuses_existing_setup_tools(self):
402 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
403 root = Path(directory)
404 tools = root / "tests/ci/tools"
405 binaries = tools / "mingw/usr/bin"
406 binaries.mkdir(parents=True)
407 executable = binaries / "x86_64-w64-mingw32-gcc-posix"
408 executable.write_text("#!/bin/sh\nexit 0\n")
409 executable.chmod(0o700)
410 rustup = tools / "rustup"
411 (rustup / "toolchains/1.99.1-x86_64-unknown-linux-gnu").mkdir(parents=True)
412 with (
413 patch.dict(run_rust.os.environ, {"PATH": ""}, clear=True),
414 patch.object(run_rust.subprocess, "check_output", return_value=str(root / ".git")),
415 ):
416 run_rust.prepare_tools(root)
417 self.assertEqual(run_rust.os.environ["RUSTUP_HOME"], str(rustup))
418 self.assertTrue(run_rust.os.environ["PATH"].startswith(str(binaries)))
419 self.assertEqual(run_rust.shutil.which("x86_64-w64-mingw32-gcc-posix"),
420 str(executable))
421
422 def test_unconfigured_work_directory_uses_common_project(self):
423 with patch.dict(os.environ), patch.object(
424 run_rust, "work_directory", return_value=TEST_WORK
425 ) as directory:
426 os.environ.pop("ZIPELO_TEST_WORK_DIR", None)
427 os.environ.pop("ZIPELO_CI_JOB", None)
428 self.assertEqual(run_rust.test_work_directory(run_rust.ROOT), TEST_WORK)
429 directory.assert_called_once_with(run_rust.ROOT, "rust-local")
430
431 def test_local_bootstraps_missing_cross_tools_and_reloads_paths(self):
432 for root in (Path("/repo"), PurePosixPath("/repo"), PureWindowsPath("C:/repo")):
433 with self.subTest(root=root):
434 with (
435 patch.object(run_rust, "prepare_cross_build", side_effect=[ValueError("missing"), None]) as detect,
436 patch.object(run_rust.subprocess, "run") as setup,
437 patch.object(run_rust, "prepare_tools") as reload,
438 patch.object(run_rust, "test_work_directory", return_value=root / "tests/work/rust-local"),
439 ):
440 run_rust.prepare_local_tools(root)
441 setup.assert_called_once_with(
442 ["bash", str(root / "tests/ci/setup_windows.sh")], cwd=root, env=ANY, check=True,
443 )
444 reload.assert_called_once_with(root)
445 self.assertEqual(detect.call_count, 2)
446
447 def test_existing_cross_tools_do_not_trigger_downloads(self):
448 with (
449 patch.object(run_rust, "prepare_cross_build"),
450 patch.object(run_rust.subprocess, "run") as setup,
451 ):
452 run_rust.prepare_local_tools(Path("/repo"))
453 setup.assert_not_called()
454
455 def test_explicit_tools_directory_does_not_fall_back_to_other_worktree(self):
456 with (
457 patch.dict(run_rust.os.environ, {"PATH": "", "ZIPELO_CI_TOOLS": "/missing"}, clear=True),
458 patch.object(run_rust.subprocess, "check_output") as git,
459 ):
460 run_rust.prepare_tools(Path("/repo"))
461 git.assert_not_called()
462 with self.assertRaisesRegex(ValueError, "setup_windows.sh"):
463 run_rust.prepare_cross_build()
464
465 @unittest.skipUnless(sys.platform == "linux", "Linux 파일시스템과 소유권 검사 시험임")
466 def test_filesystem_skip_is_limited_to_publication_test_crates(self):
467 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
468 root = Path(directory)
469 work = root / "work"
470 work.mkdir()
471 paths = [
472 root / "tests/rust-file-publication/Cargo.toml",
473 root / "tests/rust-gzip-file-job/Cargo.toml",
474 root / "tests/rust-file-snapshot/Cargo.toml",
475 root / "experiments/rust-file-publication/Cargo.toml",
476 ]
477 with (
478 patch.object(run_rust, "manifests", return_value=paths),
479 patch.dict(run_rust.os.environ, {"ZIPELO_TEST_WORK_DIR": str(work)}),
480 patch.object(run_rust.subprocess, "check_output", return_value="1021994\n"),
481 patch.object(run_rust.subprocess, "run", return_value=subprocess.CompletedProcess([], 0)) as cargo,
482 ):
483 results = run_rust.run(root, "test")
484 self.assertEqual([row["status"] for row in results], [
485 "not-applicable", "not-applicable", "passed", "passed",
486 ])
487 self.assertIn("0x1021994", results[0]["reason"])
488 self.assertEqual(cargo.call_count, 2)
489 cargo.reset_mock()
490 results = run_rust.run(root, "cross-build")
491 self.assertTrue(all(row["status"] == "passed" for row in results))
492 self.assertEqual(cargo.call_count, 4)
493
494 @unittest.skipUnless(sys.platform == "linux", "Linux 소켓 경로 회귀 시험임")
495 def test_long_checkout_does_not_block_file_fixtures(self):
496 with tempfile.TemporaryDirectory(dir=TEST_WORK) as directory:
497 root = Path(directory) / ("long-checkout-" * 10)
498 work = Path(directory) / "work"
499 socket = root / "tests/rust-file-publication/runs/case-1-1/parent/output"
500 self.assertGreaterEqual(len(run_rust.os.fsencode(socket)), 108)
501 with (
502 patch.dict(run_rust.os.environ, {"ZIPELO_TEST_WORK_DIR": str(work)}),
503 patch.object(run_rust.subprocess, "check_output", return_value="ef53\n"),
504 ):
505 self.assertEqual(run_rust.prepare_fixtures(root), {})
506 for name in run_rust.FILE_FIXTURES:
507 self.assertEqual(list((work / "fixtures" / name).iterdir()), [])
508 self.assertFalse((root / "tests" / name / "runs").exists())
509
510 def test_unknown_filesystem_probe_error_is_failure(self):
511 with (
512 patch.object(run_rust, "prepare_fixtures", side_effect=subprocess.CalledProcessError(1, "stat")),
513 patch.object(run_rust.sys, "platform", "linux"),
514 ):
515 results = run_rust.execute_phases(run_rust.ROOT, ["test"])
516 self.assertEqual(results[0]["status"], "failed")
517
518 def test_cargo_contract(self):
519 args = run_rust.command(Path("tests/example/Cargo.toml"), "test")
520 self.assertIn("--locked", args)
521 self.assertIn("--all-features", args)
522 self.assertEqual(args[-2:], ["--", "--test-threads=1"])
523
524
525if __name__ == "__main__":
526 unittest.main()