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

Function TestProcessIncludesWithWorkflowSpec_WithCommitSHA

pkg/cli/imports_test.go:86–115  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestProcessIncludesWithWorkflowSpec_WithCommitSHA(t *testing.T) {
87 // Test with commit SHA
88 content := `---
89engine: claude
90---
91
92# Test Workflow
93
94{{#import agentics/config.md}}
95`
96
97 workflow := &WorkflowSpec{
98 RepoSpec: RepoSpec{
99 RepoSlug: "githubnext/agentics",
100 },
101 }
102
103 commitSHA := "e2770974a7eaccb58ddafd5606c38a05ba52c631"
104
105 result, err := processIncludesWithWorkflowSpec(content, workflow, commitSHA, "/tmp/package", "", false)
106 if err != nil {
107 t.Fatalf("Expected no error, got: %v", err)
108 }
109
110 // Should use commit SHA instead of version
111 expectedInclude := "{{#import githubnext/agentics/agentics/config.md@e2770974a7eaccb58ddafd5606c38a05ba52c631}}"
112 if !strings.Contains(result, expectedInclude) {
113 t.Errorf("Expected result to contain '%s'\nGot:\n%s", expectedInclude, result)
114 }
115}
116
117func TestProcessIncludesWithWorkflowSpec_EmptyFilePath(t *testing.T) {
118 // Test with section-only reference (should be skipped/passed through)

Callers

nothing calls this directly

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected