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

Function TestGetActionPinWithData_V7Fallback

pkg/workflow/action_pins_test.go:910–937  ·  view source on GitHub ↗

TestGetActionPinWithData_V7Fallback verifies v7 fallback preserves source annotation.

(t *testing.T)

Source from the content-addressed store, hash-verified

908
909// TestGetActionPinWithData_V7Fallback verifies v7 fallback preserves source annotation.
910func TestGetActionPinWithData_V7Fallback(t *testing.T) {
911 data := &WorkflowData{
912 StrictMode: false,
913 }
914
915 result, err := getActionPinWithData("actions/upload-artifact", "v7", data)
916
917 if err != nil {
918 t.Fatalf("getActionPinWithData returned error: %v", err)
919 }
920
921 if result == "" {
922 t.Fatalf("getActionPinWithData returned empty string")
923 }
924
925 t.Logf("Result: %s", result)
926
927 // Should include resolved + source format for fallback.
928 if !strings.Contains(result, "# v7.0.1 (source v7)") {
929 t.Errorf("Expected resolved/source comment format in result, got: %s", result)
930 }
931
932 // Check the SHA matches v7 (resolves to v7.0.1 pin)
933 expectedSHA := "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a"
934 if !strings.Contains(result, expectedSHA) {
935 t.Errorf("Expected SHA %s in result, got: %s", expectedSHA, result)
936 }
937}
938
939// TestGetActionPinWithData_ExactVersionResolution verifies that when resolving
940// a version tag like "v4", the system returns exactly "v4" in the comment,

Callers

nothing calls this directly

Calls 2

getActionPinWithDataFunction · 0.85
ErrorfMethod · 0.45

Tested by

no test coverage detected