8000 Fix v0.11 release evidence environment binding by DaoyuanLi2816 · Pull Request #103 · DaoyuanLi2816/mini-verl · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
2 changes: 1 addition & 1 deletion scripts/release_gate.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def gate_plan(
python = sys.executable
source_commit = source_commit or _git_head()
known_good_sha256 = known_good_sha256 or _sha256(
ROOT / "environments/known-good-rtx4080-cu130.json"
ROOT / "environments/known-good-rtx4080-wsl2-cu130.json"
)
return [
Gate("release_state", (python, "scripts/release_state.py", "--check")),
Expand Down
22 changes: 22 additions & 0 deletions tests/unit/test_release_gate.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
from __future__ import annotations

import hashlib
import json
import shutil
import subprocess
import sys
from pathlib import Path

from scripts import release_gate


def test_release_gate_lists_the_product_checks_without_publishing(tmp_path: Path) -> None:
completed = subprocess.run(
Expand Down Expand Up @@ -64,3 +67,22 @@ def test_release_gate_requires_qualification_when_running() -> None:
assert completed.returncode == 2
assert "--candidate-dir, --candidate-manifest and --qualification" in completed.stderr
assert "required unless --list is used" in completed.stderr


def test_release_gate_binds_the_wsl2_known_good_environment(tmp_path: Path) -> None:
plan = release_gate.gate_plan(
candidate_dir=tmp_path / "candidate",
candidate_wheel=tmp_path / "candidate.whl",
candidate_sdist=tmp_path / "candidate.tar.gz",
qualification=tmp_path / "qualification.json",
site=tmp_path / "site",
screenshots=tmp_path / "screenshots",
source_commit="a" * 40,
)
command = next(gate.command for gate in plan if gate.name == "release_evidence_chain")
known_good_sha256 = command[command.index("--known-good-sha256") + 1]

wsl2_manifest = Path("environments/known-good-rtx4080-wsl2-cu130.json")
legacy_manifest = Path("environments/known-good-rtx4080-cu130.json")
assert known_good_sha256 == hashlib.sha256(wsl2_manifest.read_bytes()).hexdigest()
assert known_good_sha256 != hashlib.sha256(legacy_manifest.read_bytes()).hexdigest()
0