v2
This commit is contained in:
1 parent
0efaae1715
commit
c1a2a8cc30
13 files changed
+180
-137
No files matched your search
+19
-4
@@ -15,20 +15,35 @@ def test_package_filename_parsing():
|
||||
assert app.parse_package(Path("rustbox-0.0.5-1.x86_64.rpm"), "rpm") == ("rustbox", "0.0.5-1", "x86_64")
|
||||
|
||||
|
||||
def test_catalog_reads_linux_snapshot():
|
||||
def test_catalog_uses_three_linux_distribution_families():
|
||||
with tempfile.TemporaryDirectory() as tmp:
|
||||
root = Path(tmp)
|
||||
rel = root / "releases/one"
|
||||
(rel / "apt/pool/main/r/rustbox").mkdir(parents=True)
|
||||
(rel / "rpm/x86_64").mkdir(parents=True)
|
||||
(rel / "suse/x86_64").mkdir(parents=True)
|
||||
(rel / "LINUX-BUILD-INFO.txt").write_text("app_version=0.0.5\npackage_release=1\nbuilt_at=2026-10-30T12:00:00Z\nsource_commit=abc\npackaging_revision=1\n")
|
||||
(rel / "SUSE-BUILD-INFO.txt").write_text("app_version=0.0.5\npackage_release=1\nbuilt_at=2026-10-30T12:00:00Z\nsource_commit=abc\npackaging_revision=1\n")
|
||||
common = "app_version=0.0.5\npackage_release=1\nbuilt_at=2026-10-30T12:00:00Z\nsource_commit=abc\npackaging_revision=1\n"
|
||||
(rel / "DEBIAN-BUILD-INFO.txt").write_text(common + "package_family=debian\n")
|
||||
(rel / "RHEL-BUILD-INFO.txt").write_text(common + "package_family=rhel\n")
|
||||
(rel / "SUSE-BUILD-INFO.txt").write_text(common + "package_family=suse\n")
|
||||
(rel / "apt/pool/main/r/rustbox/rustbox_0.0.5-1_amd64.deb").write_bytes(b"deb")
|
||||
(rel / "rpm/x86_64/rustbox-0.0.5-1.x86_64.rpm").write_bytes(b"rpm")
|
||||
(rel / "suse/x86_64/rustbox-0.0.5-1.x86_64.rpm").write_bytes(b"rpm")
|
||||
(root / "current").symlink_to("releases/one")
|
||||
catalog = app.generate_catalog(root)
|
||||
assert catalog["ready"] is True
|
||||
assert catalog["builds"]["linux"]["app_version"] == "0.0.5"
|
||||
assert set(catalog["builds"]) == {"debian", "rhel", "suse"}
|
||||
assert catalog["builds"]["debian"]["app_version"] == "0.0.5"
|
||||
assert {pkg["channel"] for pkg in catalog["packages"]} == {"debian", "rhel", "suse"}
|
||||
assert len(catalog["packages"]) == 3
|
||||
|
||||
|
||||
def test_dashboard_is_english_text_only():
|
||||
html = (ROOT / "dashboard/web/index.html").read_text()
|
||||
js = (ROOT / "dashboard/web/app.js").read_text()
|
||||
assert 'lang="en"' in html
|
||||
assert "brand-icon" not in html
|
||||
assert "favicon" not in html
|
||||
assert "status-dot" not in html
|
||||
for label in ("Overview", "Packages", "Installation", "Repositories", "Debian / Ubuntu", "RHEL / AlmaLinux / Rocky Linux", "SUSE / openSUSE"):
|
||||
assert label in html or label in js
|
||||
@@ -57,3 +57,24 @@ def test_docker_context_excludes_secrets_and_state():
|
||||
assert ".env" in data
|
||||
assert "gpg/" in data
|
||||
assert "data/" in data
|
||||
|
||||
|
||||
def test_repository_public_port_is_18965():
|
||||
env = (ROOT / ".env.example").read_text()
|
||||
compose = (ROOT / "docker-compose.yml").read_text()
|
||||
start = (ROOT / "start.sh").read_text()
|
||||
assert "HTTP_PORT=18965" in env
|
||||
assert "127.0.0.1:18965" in env
|
||||
assert "${HTTP_PORT:-18965}:8080" in compose
|
||||
assert "DEFAULT_HTTP_PORT=18965" in start
|
||||
|
||||
|
||||
def test_all_three_linux_families_are_always_published():
|
||||
build = (ROOT / "scripts/build-release.sh").read_text()
|
||||
init = (ROOT / "scripts/init-storage.sh").read_text()
|
||||
compose = (ROOT / "docker-compose.yml").read_text()
|
||||
assert "BUILD_SUSE" not in build
|
||||
assert "BUILD_SUSE" not in compose
|
||||
for name in ("DEBIAN-BUILD-INFO.txt", "RHEL-BUILD-INFO.txt", "SUSE-BUILD-INFO.txt"):
|
||||
assert name in build
|
||||
assert name in init
|
||||
Reference in new issue
Block a user