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

Function TestAntigravityEngineExecution

pkg/workflow/antigravity_engine_test.go:138–331  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

136}
137
138func TestAntigravityEngineExecution(t *testing.T) {
139 engine := NewAntigravityEngine()
140
141 t.Run("basic execution", func(t *testing.T) {
142 workflowData := &WorkflowData{
143 Name: "test-workflow",
144 }
145
146 steps := engine.GetExecutionSteps(workflowData, "/tmp/test.log")
147 require.Len(t, steps, 2, "Should generate settings step and execution step")
148
149 // steps[0] = Write Antigravity Config, steps[1] = Execute Antigravity CLI
150 stepContent := strings.Join(steps[1], "\n")
151
152 assert.Contains(t, stepContent, "name: Execute Antigravity CLI", "Should have correct step name")
153 assert.Contains(t, stepContent, "id: agentic_execution", "Should have agentic_execution ID")
154 assert.Contains(t, stepContent, "agy --dangerously-skip-permissions", "Should invoke agy with auto-approval enabled")
155 assert.Contains(t, stepContent, "--dangerously-skip-permissions", "Should include auto-approval flag for tool executions")
156 assert.NotContains(t, stepContent, "--yolo", "Should not include unsupported --yolo flag")
157 assert.NotContains(t, stepContent, "--skip-trust", "Should not include unsupported --skip-trust flag")
158 assert.NotContains(t, stepContent, "--output-format stream-json", "Should not include unsupported output format flag")
159 assert.Contains(t, stepContent, `--prompt "$(cat /tmp/gh-aw/aw-prompts/prompt.txt)"`, "Should include prompt argument with correct shell quoting")
160 assert.Contains(t, stepContent, "/tmp/test.log", "Should include log file")
161 assert.Contains(t, stepContent, "ANTIGRAVITY_API_KEY: ${{ secrets.ANTIGRAVITY_API_KEY }}", "Should set ANTIGRAVITY_API_KEY env var")
162 assert.Contains(t, stepContent, "GEMINI_API_KEY: ${{ secrets.ANTIGRAVITY_API_KEY }}", "Should map GEMINI_API_KEY to the Antigravity secret for proxy auth")
163 })
164
165 t.Run("with model", func(t *testing.T) {
166 workflowData := &WorkflowData{
167 Name: "test-workflow",
168 EngineConfig: &EngineConfig{
169 Model: "antigravity-1.5-pro",
170 },
171 }
172
173 steps := engine.GetExecutionSteps(workflowData, "/tmp/test.log")
174 require.Len(t, steps, 2, "Should generate settings step and execution step")
175
176 stepContent := strings.Join(steps[1], "\n")
177
178 // Model is passed via the native ANTIGRAVITY_MODEL env var (not as a --model flag)
179 assert.Contains(t, stepContent, "ANTIGRAVITY_MODEL: antigravity-1.5-pro", "Should set ANTIGRAVITY_MODEL env var")
180 assert.NotContains(t, stepContent, "--model antigravity-1.5-pro", "Should not embed model in command")
181 })
182
183 t.Run("with MCP servers", func(t *testing.T) {
184 workflowData := &WorkflowData{
185 Name: "test-workflow",
186 ParsedTools: &ToolsConfig{
187 GitHub: &GitHubToolConfig{},
188 },
189 Tools: map[string]any{
190 "github": map[string]any{},
191 },
192 }
193
194 steps := engine.GetExecutionSteps(workflowData, "/tmp/test.log")
195 require.Len(t, steps, 2, "Should generate settings step and execution step")

Callers

nothing calls this directly

Calls 4

GetExecutionStepsMethod · 0.95
NewAntigravityEngineFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected