MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestCheckReportsUpToDate

Function TestCheckReportsUpToDate

internal/update/update_test.go:352–367  ·  view source on GitHub ↗

TestCheckReportsUpToDate: local hash matches the manifest → Check returns false. The steady-state path that keeps the spinner quiet after a release.

(t *testing.T)

Source from the content-addressed store, hash-verified

350// TestCheckReportsUpToDate: local hash matches the manifest → Check returns
351// false. The steady-state path that keeps the spinner quiet after a release.
352func TestCheckReportsUpToDate(t *testing.T) {
353 asset := platformAsset(t)
354 tmpDir := t.TempDir()
355 exec := filepath.Join(tmpDir, "codehamr")
356 body := []byte("running binary content\n")
357 if err := os.WriteFile(exec, body, 0o755); err != nil {
358 t.Fatal(err)
359 }
360 r := newFakeRelease(t, asset, body, hashOf(body))
361 withReleaseURLs(t, r.srv.URL)
362 t.Setenv("CODEHAMR_NO_UPDATE_CHECK", "")
363
364 if Check(context.Background(), exec) {
365 t.Fatal("Check should return false when local hash matches published")
366 }
367}
368
369// TestCheckReportsStale: published hash differs from local → Check returns
370// true (update available), driving the maybeSelfUpdate trigger.

Callers

nothing calls this directly

Calls 5

platformAssetFunction · 0.85
newFakeReleaseFunction · 0.85
hashOfFunction · 0.85
withReleaseURLsFunction · 0.85
CheckFunction · 0.85

Tested by

no test coverage detected