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
9 changes: 6 additions & 3 deletions scripts/run_pre1_qualification_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

ROOT = Path(__file__).resolve().parents[1]
COMPONENT = 'client-rust'
RUNTIMES = ['msrv-1.86', 'candidate-stable-pinned']
RUNTIMES = ['msrv-1.86', 'rust-1.98.0']
TARGETS = ['linux-x86_64', 'linux-aarch64', 'macos-x86_64', 'macos-arm64', 'windows-x86_64']
DIRECTORIES = ['php', 'rust']
MODES = ['public', 'restricted', 'local-only']
Expand Down Expand Up @@ -142,8 +142,11 @@ def validate_context(cell: str, scenario: str | None) -> tuple[str, dict, dict]:
def expected_runtime_version(runtime: str, manifest: dict) -> str:
if runtime.startswith("cpython-") or runtime.startswith("node-") or runtime.startswith("php-"):
return runtime.split("-", 1)[1]
if runtime == "candidate-stable-pinned":
return str(manifest["toolchains"]["rust_stable"])
if runtime.startswith("rust-"):
expected = str(manifest["toolchains"]["rust_stable"])
if runtime != f"rust-{expected}":
raise ValueError("qualification stable Rust runtime differs from the candidate")
return expected
field = {"client-rust": "rust_client_msrv", "directory-rust": "rust_directory_msrv", "management": "management_msrv"}[COMPONENT]
return str(manifest["toolchains"][field])

Expand Down
9 changes: 9 additions & 0 deletions scripts/test_pre1_qualification_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ def test_referenced_test_files_exist(self) -> None:
if token.startswith(("tests/", "scripts/")) and "." in Path(token).name:
self.assertTrue((ROOT / token).is_file(), token)

def test_stable_runtime_is_exactly_bound_to_candidate(self) -> None:
manifest = {"toolchains": {"rust_stable": "1.98.0"}}
self.assertEqual(
module.expected_runtime_version("rust-1.98.0", manifest), "1.98.0"
)
manifest["toolchains"]["rust_stable"] = "1.99.0"
with self.assertRaises(ValueError):
module.expected_runtime_version("rust-1.98.0", manifest)


if __name__ == "__main__":
unittest.main()
Loading