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

Function TestActionResolverCache

pkg/workflow/action_resolver_test.go:54–71  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestActionResolverCache(t *testing.T) {
55 // Create a cache and resolver
56 tmpDir := testutil.TempDir(t, "test-*")
57 cache := NewActionCache(tmpDir)
58 resolver := NewActionResolver(cache)
59
60 // Manually add an entry to the cache
61 cache.Set("actions/checkout", "v5", "test-sha-123")
62
63 // Resolve should return cached value without making API call
64 sha, err := resolver.ResolveSHA(context.Background(), "actions/checkout", "v5")
65 if err != nil {
66 t.Errorf("Expected no error for cached entry, got: %v", err)
67 }
68 if sha != "test-sha-123" {
69 t.Errorf("Expected SHA 'test-sha-123', got '%s'", sha)
70 }
71}
72
73func TestActionResolverFailedResolutionCache(t *testing.T) {
74 // Create a cache and resolver

Callers

nothing calls this directly

Calls 7

SetMethod · 0.95
ResolveSHAMethod · 0.95
TempDirFunction · 0.92
NewActionCacheFunction · 0.85
NewActionResolverFunction · 0.85
BackgroundMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected