MCPcopy Create free account
hub / github.com/github/gh-aw / TestActionCache

Function TestActionCache

pkg/workflow/action_cache_test.go:16–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestActionCache(t *testing.T) {
17 // Create temporary directory for testing
18 tmpDir := testutil.TempDir(t, "test-*")
19
20 cache := NewActionCache(tmpDir)
21
22 // Test setting and getting
23 cache.Set("actions/checkout", "v5", "abc123")
24
25 sha, found := cache.Get("actions/checkout", "v5")
26 if !found {
27 t.Error("Expected to find cached entry")
28 }
29 if sha != "abc123" {
30 t.Errorf("Expected SHA 'abc123', got '%s'", sha)
31 }
32
33 // Test cache miss
34 _, found = cache.Get("actions/unknown", "v1")
35 if found {
36 t.Error("Expected cache miss for unknown action")
37 }
38}
39
40func TestActionCacheSaveLoad(t *testing.T) {
41 // Create temporary directory for testing

Callers

nothing calls this directly

Calls 6

SetMethod · 0.95
GetMethod · 0.95
TempDirFunction · 0.92
NewActionCacheFunction · 0.85
ErrorMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected