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

Function TestExtractEngineConfigInferredWithoutAwInfo

pkg/cli/audit_expanded_test.go:114–123  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

112}
113
114func TestExtractEngineConfigInferredWithoutAwInfo(t *testing.T) {
115 tmpDir := testutil.TempDir(t, "engine-infer-*")
116 logContent := `{"type":"result","subtype":"success","num_turns":3,"usage":{"input_tokens":100,"output_tokens":200}}`
117 require.NoError(t, os.WriteFile(filepath.Join(tmpDir, "agent-stdio.log"), []byte(logContent), 0o644))
118
119 _, inferredEngineID := inferFallbackLogMetrics(tmpDir)
120 result := extractEngineConfigWithInferredEngine(tmpDir, inferredEngineID)
121 require.NotNil(t, result, "Engine config should be inferred when aw_info.json is missing but agent log is available")
122 assert.NotEmpty(t, result.EngineID, "Inferred engine ID should not be empty")
123}
124
125func TestInferFallbackLogMetricsFindsNestedAgentStdioLog(t *testing.T) {
126 tmpDir := testutil.TempDir(t, "engine-infer-nested-*")

Callers

nothing calls this directly

Calls 3

TempDirFunction · 0.92
inferFallbackLogMetricsFunction · 0.85

Tested by

no test coverage detected