internal/rosa: create metadata alongside artifact
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m45s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 4m0s
Test / Sandbox (race detector) (push) Successful in 5m28s
Test / Hakurei (race detector) (push) Successful in 6m32s
Test / Flake checks (push) Successful in 1m21s
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m45s
Test / ShareFS (push) Successful in 3m47s
Test / Hakurei (push) Successful in 4m0s
Test / Sandbox (race detector) (push) Successful in 5m28s
Test / Hakurei (race detector) (push) Successful in 6m32s
Test / Flake checks (push) Successful in 1m21s
This enables deferring evaluation of azalea-based packages and fixes the longstanding quirk of version being disjoint from other metadata. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -22,12 +22,12 @@ func TestInfo(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
_t := rosa.Native().Std()
|
||||
_, qemuVersion := _t.Load(rosa.QEMU)
|
||||
_, glibVersion := _t.Load(rosa.GLib)
|
||||
zlib, zlibVersion := _t.Load(rosa.Zlib)
|
||||
_, zstdVersion := _t.Load(rosa.Zstd)
|
||||
_, hakureiVersion := _t.Load(rosa.Hakurei)
|
||||
_, hakureiDistVersion := _t.Load(rosa.HakureiDist)
|
||||
qemuMeta, _ := _t.Load(rosa.QEMU)
|
||||
glibMeta, _ := _t.Load(rosa.GLib)
|
||||
zlibMeta, zlib := _t.Load(rosa.Zlib)
|
||||
zstdMeta, _ := _t.Load(rosa.Zstd)
|
||||
hakureiMeta, _ := _t.Load(rosa.Hakurei)
|
||||
hakureiDistMeta, _ := _t.Load(rosa.HakureiDist)
|
||||
|
||||
testCases := []struct {
|
||||
name string
|
||||
@@ -38,24 +38,24 @@ func TestInfo(t *testing.T) {
|
||||
wantErr any
|
||||
}{
|
||||
{"qemu", []string{"qemu"}, nil, "", `
|
||||
name : qemu-` + qemuVersion + `
|
||||
name : qemu-` + qemuMeta.Version + `
|
||||
description : a generic and open source machine emulator and virtualizer
|
||||
website : https://www.qemu.org
|
||||
depends on : glib-` + glibVersion + ` zstd-` + zstdVersion + `
|
||||
depends on : glib-` + glibMeta.Version + ` zstd-` + zstdMeta.Version + `
|
||||
`, nil},
|
||||
|
||||
{"multi", []string{"hakurei", "hakurei-dist"}, nil, "", `
|
||||
name : hakurei-` + hakureiVersion + `
|
||||
name : hakurei-` + hakureiMeta.Version + `
|
||||
description : low-level userspace tooling for Rosa OS
|
||||
website : https://hakurei.app
|
||||
|
||||
name : hakurei-dist-` + hakureiDistVersion + `
|
||||
name : hakurei-dist-` + hakureiDistMeta.Version + `
|
||||
description : low-level userspace tooling for Rosa OS (distribution tarball)
|
||||
website : https://hakurei.app
|
||||
`, nil},
|
||||
|
||||
{"nonexistent", []string{"zlib", "\x00"}, nil, "", `
|
||||
name : zlib-` + zlibVersion + `
|
||||
name : zlib-` + zlibMeta.Version + `
|
||||
description : lossless data-compression library
|
||||
website : https://zlib.net
|
||||
|
||||
@@ -65,12 +65,12 @@ website : https://zlib.net
|
||||
"zstd": "internal/pkg (amd64) on satori\n",
|
||||
"hakurei": "internal/pkg (amd64) on satori\n\n",
|
||||
}, "", `
|
||||
name : zlib-` + zlibVersion + `
|
||||
name : zlib-` + zlibMeta.Version + `
|
||||
description : lossless data-compression library
|
||||
website : https://zlib.net
|
||||
status : not yet cured
|
||||
|
||||
name : zstd-` + zstdVersion + `
|
||||
name : zstd-` + zstdMeta.Version + `
|
||||
description : a fast compression algorithm
|
||||
website : https://facebook.github.io/zstd
|
||||
status : internal/pkg (amd64) on satori
|
||||
@@ -79,7 +79,7 @@ status : internal/pkg (amd64) on satori
|
||||
{"status cache perm", []string{"zlib"}, map[string]string{
|
||||
"zlib": "\x00",
|
||||
}, "", `
|
||||
name : zlib-` + zlibVersion + `
|
||||
name : zlib-` + zlibMeta.Version + `
|
||||
description : lossless data-compression library
|
||||
website : https://zlib.net
|
||||
`, func(cm *cache) error {
|
||||
@@ -91,7 +91,7 @@ website : https://zlib.net
|
||||
}},
|
||||
|
||||
{"status report", []string{"zlib"}, nil, strings.Repeat("\x00", len(pkg.Checksum{})+8), `
|
||||
name : zlib-` + zlibVersion + `
|
||||
name : zlib-` + zlibMeta.Version + `
|
||||
description : lossless data-compression library
|
||||
website : https://zlib.net
|
||||
status : not in report
|
||||
@@ -140,7 +140,7 @@ status : not in report
|
||||
|
||||
if tc.status != nil {
|
||||
for name, status := range tc.status {
|
||||
a, _ := _t.Load(rosa.ArtifactH(unique.Make(name)))
|
||||
_, a := _t.Load(rosa.ArtifactH(unique.Make(name)))
|
||||
if a == nil {
|
||||
t.Fatalf("invalid name %q", name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user