generated from coulomb/repo-seed
local OpenCMIS TCK runtime
This commit is contained in:
@@ -2,6 +2,7 @@ from __future__ import annotations
|
||||
|
||||
import http.client
|
||||
import json
|
||||
import subprocess
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
@@ -15,6 +16,7 @@ from guide_board.execution import run_assessment
|
||||
from guide_board.planning import build_run_plan, validate_assessment_profile
|
||||
from guide_board.retention import build_trend_summary
|
||||
from guide_board.service import ServiceHandle, start_service
|
||||
from open_cmis_tck.bootstrap import TCK_COORDINATE, check_runtime
|
||||
from open_cmis_tck.profile import validate_cmis_profile_config
|
||||
|
||||
|
||||
@@ -81,6 +83,64 @@ class OpenCmisTckExtensionTests(unittest.TestCase):
|
||||
broken_diagnostics["diagnostics"][0]["message"],
|
||||
)
|
||||
|
||||
def test_bootstrap_reports_local_tck_runtime_posture(self) -> None:
|
||||
with TemporaryDirectory() as temporary_directory:
|
||||
output = Path(temporary_directory) / "runtime-summary.json"
|
||||
|
||||
summary = check_runtime(ROOT, output, resolve=False)
|
||||
|
||||
self.assertIn(summary["status"], {"ready", "blocked"})
|
||||
self.assertEqual(summary["tck"]["coordinate"], TCK_COORDINATE)
|
||||
self.assertEqual(
|
||||
summary["tck"]["runner_class"],
|
||||
"org.apache.chemistry.opencmis.tck.runner.ConsoleRunner",
|
||||
)
|
||||
self.assertTrue(output.exists())
|
||||
|
||||
def test_console_adapter_dry_run_writes_session_and_group_files(self) -> None:
|
||||
with TemporaryDirectory() as temporary_directory:
|
||||
temp_root = Path(temporary_directory)
|
||||
run_dir = temp_root / "run"
|
||||
artifact_dir = run_dir / "artifacts" / "open-cmis-tck" / "tck" / "repository-type"
|
||||
completed = subprocess.run(
|
||||
[
|
||||
sys.executable,
|
||||
str(ROOT / "adapters" / "opencmis_console_adapter.py"),
|
||||
"--browser-url",
|
||||
"http://127.0.0.1:8000/cmis/browser",
|
||||
"--repository-id",
|
||||
"local-test-repository",
|
||||
"--check-group",
|
||||
"repository-type",
|
||||
"--artifact-dir",
|
||||
str(artifact_dir),
|
||||
"--run-dir",
|
||||
str(run_dir),
|
||||
"--extension-path",
|
||||
str(ROOT),
|
||||
"--dry-run",
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
check=False,
|
||||
)
|
||||
result = json.loads(completed.stdout)
|
||||
|
||||
self.assertEqual(completed.returncode, 0)
|
||||
self.assertEqual(result["result"], "skipped")
|
||||
self.assertIn(
|
||||
"artifacts/open-cmis-tck/tck/repository-type/session.properties",
|
||||
result["artifact_refs"],
|
||||
)
|
||||
self.assertIn(
|
||||
"org.apache.chemistry.opencmis.binding.spi.type=browser",
|
||||
(artifact_dir / "session.properties").read_text(encoding="utf-8"),
|
||||
)
|
||||
self.assertIn(
|
||||
"org.apache.chemistry.opencmis.tck.tests.basics.BasicsTestGroup",
|
||||
(artifact_dir / "groups.txt").read_text(encoding="utf-8"),
|
||||
)
|
||||
|
||||
def test_runs_cmis_preflight_against_local_endpoint(self) -> None:
|
||||
server = HTTPServer(("127.0.0.1", 0), _CmisHandler)
|
||||
thread = threading.Thread(target=server.serve_forever)
|
||||
|
||||
Reference in New Issue
Block a user