Tag releases, and name the version on the Overview
nix run .#release ends by creating the annotated tag vX.Y.Z on the released commit (the tags routers that update from the repository look for); it refuses a HEAD of another version and does nothing outside a checkout. The System card on the Overview says which nixos-router and NixOS run. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -155,6 +155,25 @@ func TestDashboardRenders(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestDashboardNamesTheVersion(t *testing.T) {
|
||||
a, sys := newTestApp(t)
|
||||
dir := t.TempDir()
|
||||
sys.ReleaseFile = filepath.Join(dir, "router-release")
|
||||
sys.VersionFile = filepath.Join(dir, "nixos-version")
|
||||
os.WriteFile(sys.ReleaseFile, []byte(`{"version":"4.5.6"}`), 0o600)
|
||||
os.WriteFile(sys.VersionFile, []byte("26.11.20261113.d5cc683\n"), 0o600)
|
||||
a.sys = sys
|
||||
h := a.routes()
|
||||
cookie := login(t, h)
|
||||
// The page and the fragment that refreshes it say what runs.
|
||||
for _, path := range []string{"/", "/dashboard?range=24h"} {
|
||||
body := do(h, "GET", path, nil, cookie).Body.String()
|
||||
if !strings.Contains(body, "nixos-router 4.5.6") || !strings.Contains(body, "NixOS 26.11.20261113.d5cc683") {
|
||||
t.Errorf("%s does not name the version:\n%s", path, body)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestBackup(t *testing.T) {
|
||||
a, sys := newTestApp(t)
|
||||
h := a.routes()
|
||||
|
||||
Reference in New Issue
Block a user