(t *testing.T)
| 139 | } |
| 140 | |
| 141 | func 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 | |
| 165 | func TestMissingToolNotEnabledByDefault(t *testing.T) { |
| 166 | compiler := NewCompiler() |
nothing calls this directly
no test coverage detected