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

Function TestMissingToolPromptGeneration

pkg/workflow/missing_tool_test.go:141–163  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

139}
140
141func TestMissingToolPromptGeneration(t *testing.T) {
142 compiler := NewCompiler()
143
144 // Create workflow data with missing-tool enabled
145 data := &WorkflowData{
146 MarkdownContent: "Test workflow content",
147 SafeOutputs: &SafeOutputsConfig{
148 MissingTool: &MissingToolConfig{BaseSafeOutputConfig: BaseSafeOutputConfig{Max: strPtr("10")}},
149 },
150 }
151
152 var yaml strings.Builder
153 compiler.generatePrompt(&yaml, data, false, nil)
154
155 output := yaml.String()
156
157 // Check that GH_AW_SAFE_OUTPUTS environment variable is included when SafeOutputs is configured
158 // This is how safe outputs tools are now discovered (via MCP server tool discovery)
159 // In the activation/prompt job, the path is hardcoded (no set-runtime-paths step available).
160 if !strings.Contains(output, "GH_AW_SAFE_OUTPUTS: ${{ runner.temp }}/gh-aw/safeoutputs/outputs.jsonl") {
161 t.Error("Expected 'GH_AW_SAFE_OUTPUTS' environment variable when SafeOutputs is configured")
162 }
163}
164
165func TestMissingToolNotEnabledByDefault(t *testing.T) {
166 compiler := NewCompiler()

Callers

nothing calls this directly

Calls 5

generatePromptMethod · 0.95
NewCompilerFunction · 0.85
strPtrFunction · 0.85
StringMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected