mirror of
https://github.com/nyakang/nyaterm.git
synced 2026-11-15 08:08:08 +00:00
- Introduced `rust-toolchain.toml` to specify Rust version 1.99.1 with a minimal profile. - Added `rustfmt.toml` to enforce the 2024 edition style for Rust formatting. - Updated GitHub Actions workflows to read the Rust toolchain version dynamically and adjusted caching strategies accordingly. - Enhanced CI workflows with orchestrate jobs for better job selection and dependency management. - Implemented scheduled runs for CI workflows to ensure regular checks.
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
"""A selected native suite must report missing coverage and fail, never skip."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import contextlib
|
|
import io
|
|
import os
|
|
from pathlib import Path
|
|
import sys
|
|
import tempfile
|
|
import unittest
|
|
from unittest.mock import patch
|
|
|
|
from scripts.ci import test_scripts
|
|
|
|
|
|
class NativeTestRunnerTests(unittest.TestCase):
|
|
def test_missing_native_tool_fails_and_reports_zero_coverage(self):
|
|
with tempfile.TemporaryDirectory() as folder:
|
|
summary = Path(folder) / "summary.md"
|
|
with patch.object(sys, "argv", ["test_scripts", "--suite", "windows-msi"]), \
|
|
patch.object(sys, "platform", "win32"), \
|
|
patch.object(test_scripts.shutil, "which", return_value=None), \
|
|
patch.dict(os.environ, {"GITHUB_STEP_SUMMARY": str(summary)}), \
|
|
contextlib.redirect_stderr(io.StringIO()), self.assertRaises(SystemExit) as error:
|
|
test_scripts.main()
|
|
self.assertNotEqual(error.exception.code, 0)
|
|
message = summary.read_text(encoding="utf-8")
|
|
self.assertIn("windows-msi", message)
|
|
self.assertIn("blocked, 0 run", message)
|
|
self.assertIn("wix", message)
|