team-ljyzipelo

공개

Windows CI에서 시험 fixture 원본 바이트 보존

작성자
코노모리 카논
작성 시각
커밋
8d88b0145646e1796acb158ddab347af24fbe16d
부모
97aca6f
이 시점의 파일 보기

변경된 파일 3개

+18-0
수정.github/workflows/rust.yml+4-0
@@ -29,6 +29,10 @@ jobs:
2929 RUST_BACKTRACE: 1
3030 steps:
3131 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
32추가: env:
33추가: GIT_CONFIG_COUNT: 1
34추가: GIT_CONFIG_KEY_0: core.autocrlf
35추가: GIT_CONFIG_VALUE_0: false
3236 with:
3337 persist-credentials: false
3438 - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1
수정tests/ci/README.md+1-0
@@ -9,6 +9,7 @@ python tests/ci/run_rust.py test
99```
1010
1111- `experiments/*/Cargo.toml`과 `tests/*/Cargo.toml`을 자동 발견합니다. 새 crate도 같은 구조와 Cargo.lock을 사용하면 포함됩니다.
12추가: - checkout 단계의 Git 프로세스에만 core.autocrlf=false를 적용해 fixture 원본 바이트를 보존합니다. 빌드 전에 추적된 fixture 33개를 Git blob과 대조하며, OS에 따라 기대값을 바꾸지 않습니다.
1213- 모든 target과 feature를 빌드합니다. 시험은 Cargo에 등록된 루트 tests/의 Rust 회귀와 crate의 단위시험을 실행합니다. 시험 스레드는 1개입니다.
1314- Linux 전용 publication, snapshot, file-job, system-font 시험은 Windows에서 `not-applicable`로 표시합니다. 해당 crate의 Windows 빌드는 확인합니다.
1415- Linux 파일 시험에는 새 소유 `runs` 디렉터리를 0700으로 생성합니다. 기존 디렉터리의 권한은 변경하지 않으며 비어 있지 않으면 중단합니다. 글꼴 시험에는 `fonts-noto-cjk`가 필요합니다.
수정tests/ci/test_runner.py+13-0
@@ -48,6 +48,19 @@ class RunnerTests(unittest.TestCase):
4848 )
4949 self.assertEqual(execute.call_count, 1)
5050
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추가:
5164 def test_cargo_contract(self):
5265 args = run_rust.command(Path("tests/example/Cargo.toml"), "test")
5366 self.assertIn("--locked", args)