team-ljyzipelo

공개

실행기 자체 검사의 플랫폼 의존성을 수정

작성자
코노모리 카논
작성 시각
커밋
82a751cdfb91ded9651d74618afb550c2c928ffa
부모
159d51a
이 시점의 파일 보기

변경된 파일 1개

+17-14
수정tests/ci/test_runner.py+17-14
@@ -1,9 +1,10 @@
11from contextlib import redirect_stdout
22from io import StringIO
33import json
4삭제: from pathlib import Path
4추가: from pathlib import Path, PurePosixPath, PureWindowsPath
55import tempfile
66import subprocess
7추가: import sys
78import unittest
89from unittest.mock import patch
910
@@ -122,6 +123,7 @@ class RunnerTests(unittest.TestCase):
122123 self.assertFalse(failed["windows_runtime_tested"])
123124 execute.assert_called_once()
124125
126추가: @unittest.skipUnless(sys.platform == "linux", "Linux MinGW 실행 파일 탐색 시험임")
125127 def test_linked_worktree_finds_setup_tools_without_path_export(self):
126128 with tempfile.TemporaryDirectory(dir=run_rust.ROOT / "tests/ci") as directory:
127129 base = Path(directory)
@@ -148,18 +150,19 @@ class RunnerTests(unittest.TestCase):
148150 )
149151
150152 def test_local_bootstraps_missing_cross_tools_and_reloads_paths(self):
151삭제: root = Path("/repo")
152삭제: with (
153삭제: patch.object(run_rust, "prepare_cross_build", side_effect=[ValueError("missing"), None]) as detect,
154삭제: patch.object(run_rust.subprocess, "run") as setup,
155삭제: patch.object(run_rust, "prepare_tools") as reload,
156삭제: ):
157삭제: run_rust.prepare_local_tools(root)
158삭제: setup.assert_called_once_with(
159삭제: ["bash", "/repo/tests/ci/setup_windows.sh"], cwd=root, check=True,
160삭제: )
161삭제: reload.assert_called_once_with(root)
162삭제: self.assertEqual(detect.call_count, 2)
153추가: for root in (Path("/repo"), PurePosixPath("/repo"), PureWindowsPath("C:/repo")):
154추가: with self.subTest(root=root):
155추가: with (
156추가: patch.object(run_rust, "prepare_cross_build", side_effect=[ValueError("missing"), None]) as detect,
157추가: patch.object(run_rust.subprocess, "run") as setup,
158추가: patch.object(run_rust, "prepare_tools") as reload,
159추가: ):
160추가: run_rust.prepare_local_tools(root)
161추가: setup.assert_called_once_with(
162추가: ["bash", str(root / "tests/ci/setup_windows.sh")], cwd=root, check=True,
163추가: )
164추가: reload.assert_called_once_with(root)
165추가: self.assertEqual(detect.call_count, 2)
163166
164167 def test_existing_cross_tools_do_not_trigger_downloads(self):
165168 with (
@@ -179,6 +182,7 @@ class RunnerTests(unittest.TestCase):
179182 with self.assertRaisesRegex(ValueError, "setup_windows.sh"):
180183 run_rust.prepare_cross_build()
181184
185추가: @unittest.skipUnless(sys.platform == "linux", "Linux 파일시스템과 소유권 검사 시험임")
182186 def test_filesystem_skip_is_limited_to_publication_test_crates(self):
183187 with tempfile.TemporaryDirectory(dir=run_rust.ROOT / "tests/ci") as directory:
184188 root = Path(directory)
@@ -191,7 +195,6 @@ class RunnerTests(unittest.TestCase):
191195 root / "experiments/rust-file-publication/Cargo.toml",
192196 ]
193197 with (
194삭제: patch.object(run_rust.sys, "platform", "linux"),
195198 patch.object(run_rust, "manifests", return_value=paths),
196199 patch.object(run_rust.subprocess, "check_output", return_value="1021994\n"),
197200 patch.object(run_rust.subprocess, "run", return_value=subprocess.CompletedProcess([], 0)) as cargo,