Windows CI에서 시험 fixture 원본 바이트 보존
- 작성자
- 코노모리 카논
- 작성 시각
- 커밋
8d88b0145646e1796acb158ddab347af24fbe16d- 부모
- 97aca6f
변경된 파일 3개
+18-0| @@ -29,6 +29,10 @@ jobs: | ||
| 29 | 29 | RUST_BACKTRACE: 1 |
| 30 | 30 | steps: |
| 31 | 31 | - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 |
| 32 | 추가: env: | |
| 33 | 추가: GIT_CONFIG_COUNT: 1 | |
| 34 | 추가: GIT_CONFIG_KEY_0: core.autocrlf | |
| 35 | 추가: GIT_CONFIG_VALUE_0: false | |
| 32 | 36 | with: |
| 33 | 37 | persist-credentials: false |
| 34 | 38 | - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 |
| @@ -9,6 +9,7 @@ python tests/ci/run_rust.py test | ||
| 9 | 9 | ``` |
| 10 | 10 | |
| 11 | 11 | - `experiments/*/Cargo.toml`과 `tests/*/Cargo.toml`을 자동 발견합니다. 새 crate도 같은 구조와 Cargo.lock을 사용하면 포함됩니다. |
| 12 | 추가: - checkout 단계의 Git 프로세스에만 core.autocrlf=false를 적용해 fixture 원본 바이트를 보존합니다. 빌드 전에 추적된 fixture 33개를 Git blob과 대조하며, OS에 따라 기대값을 바꾸지 않습니다. | |
| 12 | 13 | - 모든 target과 feature를 빌드합니다. 시험은 Cargo에 등록된 루트 tests/의 Rust 회귀와 crate의 단위시험을 실행합니다. 시험 스레드는 1개입니다. |
| 13 | 14 | - Linux 전용 publication, snapshot, file-job, system-font 시험은 Windows에서 `not-applicable`로 표시합니다. 해당 crate의 Windows 빌드는 확인합니다. |
| 14 | 15 | - Linux 파일 시험에는 새 소유 `runs` 디렉터리를 0700으로 생성합니다. 기존 디렉터리의 권한은 변경하지 않으며 비어 있지 않으면 중단합니다. 글꼴 시험에는 `fonts-noto-cjk`가 필요합니다. |
| @@ -48,6 +48,19 @@ class RunnerTests(unittest.TestCase): | ||
| 48 | 48 | ) |
| 49 | 49 | self.assertEqual(execute.call_count, 1) |
| 50 | 50 | |
| 51 | 추가: def test_fixture_bytes_match_git_blobs(self): | |
| 52 | 추가: names = subprocess.check_output( | |
| 53 | 추가: ["git", "ls-files", "-z", "tests/**/fixtures/*"], cwd=run_rust.ROOT | |
| 54 | 추가: ).decode("utf-8").split("\0") | |
| 55 | 추가: names = [name for name in names if name] | |
| 56 | 추가: self.assertTrue(names, "검증할 fixture가 없음") | |
| 57 | 추가: for name in names: | |
| 58 | 추가: with self.subTest(path=name): | |
| 59 | 추가: expected = subprocess.check_output( | |
| 60 | 추가: ["git", "show", f"HEAD:{name}"], cwd=run_rust.ROOT | |
| 61 | 추가: ) | |
| 62 | 추가: self.assertEqual((run_rust.ROOT / name).read_bytes(), expected) | |
| 63 | 추가: | |
| 51 | 64 | def test_cargo_contract(self): |
| 52 | 65 | args = run_rust.command(Path("tests/example/Cargo.toml"), "test") |
| 53 | 66 | self.assertIn("--locked", args) |