MCPcopy Create free account
hub / github.com/ForestHubAI/edge-agents / writeLocalRecord

Function writeLocalRecord

go/engine/memory/manager_test.go:26–32  ·  view source on GitHub ↗

writeLocalRecord seeds a .json record directly, simulating a warm volume left behind by a prior run.

(t *testing.T, dir string, f workflow.MemoryFile)

Source from the content-addressed store, hash-verified

24// writeLocalRecord seeds a <uid>.json record directly, simulating a warm
25// volume left behind by a prior run.
26func writeLocalRecord(t *testing.T, dir string, f workflowapi.MemoryFile) {
27 t.Helper()
28 require.NoError(t, os.MkdirAll(dir, 0o755))
29 b, err := json.Marshal(f)
30 require.NoError(t, err)
31 require.NoError(t, os.WriteFile(filepath.Join(dir, f.Id+".json"), b, 0o644))
32}
33
34func TestManager_Reconcile_SeedsFromDeclaredWhenLocalEmpty(t *testing.T) {
35 // Empty local dir: declared content is the seed.

Calls

no outgoing calls

Tested by

no test coverage detected