test: generate a minimal RPM in pure Go instead of a committed fixture
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

Removes the committed .rpm binary (gitignored, so it broke clean checkouts)
and the rpmbuild dependency. testsupport.MinimalRPM builds a valid-enough
RPM header in-memory for cavaliergopher/rpm to parse, used by both the rpm
provider test and the full-stack server repodata test.
This commit is contained in:
2026-07-03 14:25:30 +10:00
parent 1009bc7c69
commit 35719984e6
3 changed files with 62 additions and 11 deletions
+1 -4
View File
@@ -301,10 +301,7 @@ func TestServerLocalPyPI(t *testing.T) {
func TestServerLocalRPMRepodata(t *testing.T) {
requireStack(t)
rpm, err := os.ReadFile("../provider/rpm/testdata/e2e-testpkg-1.0-1.noarch.rpm")
if err != nil {
t.Skipf("rpm fixture unavailable: %v", err)
}
rpm := testsupport.MinimalRPM("e2e-testpkg", "1.0", "1", "noarch")
if resp, b := req(t, "POST", "/api/v2/remotes", `{"name":"srv-rpm","package_type":"rpm","repo_type":"local"}`); resp.StatusCode != 201 {
t.Fatalf("create rpm local: %d %s", resp.StatusCode, b)
}