GRM-30: feat: add runner labels support and refactor i18n to JSON
This commit was merged in pull request #9.
This commit is contained in:
@@ -17,7 +17,15 @@ class TestRunnerRegistry:
|
||||
|
||||
def test_add_and_get(self, tmp_path: Path) -> None:
|
||||
reg = RunnerRegistry(tmp_path / "runners.json")
|
||||
reg.add("r1", host="10.0.0.1", user="ubuntu", key="/key", mode="docker", gitea_url="https://git.example.com")
|
||||
reg.add(
|
||||
"r1",
|
||||
host="10.0.0.1",
|
||||
user="ubuntu",
|
||||
key="/key",
|
||||
mode="docker",
|
||||
gitea_url="https://git.example.com",
|
||||
labels="docker:docker://alpine:latest",
|
||||
)
|
||||
info = reg.get("r1")
|
||||
assert info is not None
|
||||
assert info["host"] == "10.0.0.1"
|
||||
@@ -25,8 +33,16 @@ class TestRunnerRegistry:
|
||||
assert info["key"] == "/key"
|
||||
assert info["mode"] == "docker"
|
||||
assert info["gitea_url"] == "https://git.example.com"
|
||||
assert info["labels"] == "docker:docker://alpine:latest"
|
||||
assert "created_at" in info
|
||||
|
||||
def test_add_without_labels(self, tmp_path: Path) -> None:
|
||||
reg = RunnerRegistry(tmp_path / "runners.json")
|
||||
reg.add("r1", host="10.0.0.1", user="ubuntu")
|
||||
info = reg.get("r1")
|
||||
assert info is not None
|
||||
assert info["labels"] is None
|
||||
|
||||
def test_get_missing(self, tmp_path: Path) -> None:
|
||||
reg = RunnerRegistry(tmp_path / "runners.json")
|
||||
assert reg.get("missing") is None
|
||||
|
||||
Reference in New Issue
Block a user