generated from coulomb/repo-seed
command-runner support and first OpenCMIS TCK wrapper boundary
This commit is contained in:
@@ -165,6 +165,102 @@ class CoreArchitectureTests(unittest.TestCase):
|
||||
thread.join(timeout=5)
|
||||
server.server_close()
|
||||
|
||||
def test_runs_cmis_tck_command_wrapper_boundary(self) -> None:
|
||||
server = HTTPServer(("127.0.0.1", 0), _CmisHandler)
|
||||
thread = threading.Thread(target=server.serve_forever)
|
||||
thread.daemon = True
|
||||
thread.start()
|
||||
try:
|
||||
with TemporaryDirectory() as temporary_directory:
|
||||
temp_root = Path(temporary_directory)
|
||||
target_path = temp_root / "target.json"
|
||||
assessment_path = temp_root / "assessment.json"
|
||||
target_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"id": "local-cmis-command-test",
|
||||
"subject_type": "cmis-browser-binding-endpoint",
|
||||
"subject_name": "Local CMIS Command Test",
|
||||
"environment": "test",
|
||||
"scope": ["preflight", "tck-wrapper"],
|
||||
"endpoints": [
|
||||
{
|
||||
"id": "browser-binding",
|
||||
"url": f"http://127.0.0.1:{server.server_port}/cmis/browser",
|
||||
"binding": "cmis-browser",
|
||||
}
|
||||
],
|
||||
"artifacts": [],
|
||||
"credentials_ref": None,
|
||||
"declared_capabilities": ["cmis.repository-info"],
|
||||
"known_gaps": [],
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
assessment_path.write_text(
|
||||
json.dumps(
|
||||
{
|
||||
"id": "local-cmis-command-boundary",
|
||||
"framework_refs": ["cmis.browser-binding.compatibility.v1"],
|
||||
"extension_refs": ["open-cmis-tck"],
|
||||
"target_profile_ref": "local-cmis-command-test",
|
||||
"selected_check_groups": {
|
||||
"open-cmis-tck": ["repository-type"]
|
||||
},
|
||||
"expectations_ref": None,
|
||||
"waivers_ref": None,
|
||||
"output_policy": {
|
||||
"report_formats": ["json", "markdown"],
|
||||
"artifact_retention": "summary-only",
|
||||
},
|
||||
"retention_policy": {
|
||||
"summary_days": 365,
|
||||
"raw_artifact_days": 0,
|
||||
},
|
||||
"runtime_policy": {
|
||||
"offline": False,
|
||||
"timeout_seconds": 15,
|
||||
},
|
||||
}
|
||||
),
|
||||
encoding="utf-8",
|
||||
)
|
||||
|
||||
result = run_assessment(
|
||||
ROOT,
|
||||
target_path,
|
||||
assessment_path,
|
||||
temp_root / "run",
|
||||
)
|
||||
evidence = json.loads(
|
||||
(Path(result["run_dir"]) / "normalized" / "evidence.json").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
)["evidence"]
|
||||
findings = json.loads(
|
||||
(Path(result["run_dir"]) / "normalized" / "findings.json").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
)["findings"]
|
||||
|
||||
self.assertEqual(result["status"], "blocked")
|
||||
self.assertEqual(evidence[0]["result"], "pass")
|
||||
self.assertEqual(evidence[1]["result"], "blocked")
|
||||
self.assertEqual(evidence[1]["facts"]["runner_kind"], "command")
|
||||
self.assertIn(
|
||||
evidence[1]["facts"]["blocked_reason"],
|
||||
{"missing_dependency", "tck_invocation_not_configured"},
|
||||
)
|
||||
self.assertEqual(
|
||||
findings[0]["classification"],
|
||||
evidence[1]["facts"]["blocked_reason"],
|
||||
)
|
||||
finally:
|
||||
server.shutdown()
|
||||
thread.join(timeout=5)
|
||||
server.server_close()
|
||||
|
||||
|
||||
class _CmisHandler(BaseHTTPRequestHandler):
|
||||
def do_GET(self) -> None:
|
||||
|
||||
Reference in New Issue
Block a user