исправить: закрыть ревью сквозной корреляции
CI / Rust Checks (pull_request) Successful in 8m33s
CI / UI Checks (pull_request) Successful in 5s
CI / Frontend E2E (pull_request) Successful in 6m51s
CI / Community Image Smoke (pull_request) Failing after 9m10s
CI / Deploy (pull_request) Has been skipped

This commit is contained in:
2026-07-31 02:37:45 +03:00
parent 0e8f1ca03a
commit 9a7d60593a
28 changed files with 667 additions and 98 deletions
+32
View File
@@ -47,6 +47,38 @@ class CommunityScopeCheckTests(unittest.TestCase):
self.assertIn("apps/ui.md:1", result.stderr)
self.assertIn("graphql", result.stderr.lower())
def test_inline_directive_allows_only_declared_marker(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
(root / "protocol.rs").write_text(
'assert_rejected_protocol("grpc"); '
"// community-scope: allow=grpc\n"
'assert_rejected_protocol("grpc");\n'
'assert_rejected_protocol("graphql"); '
"// community-scope: allow=grpc\n",
encoding="utf-8",
)
result = self.run_checker(root, ["protocol.rs"])
self.assertNotEqual(result.returncode, 0)
self.assertIn("protocol.rs:2: forbidden marker `grpc`", result.stderr)
self.assertIn("protocol.rs:3: forbidden marker `graphql`", result.stderr)
self.assertNotIn("protocol.rs:1:", result.stderr)
def test_rejects_marker_without_inline_directive(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
(root / "README.md").write_text(
"Enable grpc transport.\n",
encoding="utf-8",
)
result = self.run_checker(root, ["README.md"])
self.assertNotEqual(result.returncode, 0)
self.assertIn("forbidden marker `grpc`", result.stderr)
def test_ignores_default_excluded_paths(self) -> None:
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)