Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/cli/logs_overview_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

// TestWorkflowRunStructHasMissingToolCount verifies that WorkflowRun has the MissingToolCount field
func TestWorkflowRunStructHasMissingToolCount(t *testing.T) {
t.Parallel()
run := WorkflowRun{
MissingToolCount: 5,
}
Expand All @@ -21,6 +22,7 @@ func TestWorkflowRunStructHasMissingToolCount(t *testing.T) {

// TestProcessedRunPopulatesMissingToolCount verifies that missing tools are counted correctly
func TestProcessedRunPopulatesMissingToolCount(t *testing.T) {
t.Parallel()
processedRuns := []ProcessedRun{
{
Run: WorkflowRun{
Expand Down Expand Up @@ -49,6 +51,7 @@ func TestProcessedRunPopulatesMissingToolCount(t *testing.T) {

// TestLogsOverviewHeaderIncludesMissing verifies the header includes "Missing"
func TestLogsOverviewHeaderIncludesMissing(t *testing.T) {
t.Parallel()
// This test verifies the structure by checking that our expected headers are defined
expectedHeaders := []string{"Run ID", "Workflow", "Status", "Duration", "Tokens", "Cost ($)", "Turns", "Errors", "Warnings", "Missing", "Created", "Logs Path"}

Expand All @@ -67,6 +70,7 @@ func TestLogsOverviewHeaderIncludesMissing(t *testing.T) {

// TestTotalMissingToolsCalculation verifies totals are calculated correctly
func TestTotalMissingToolsCalculation(t *testing.T) {
t.Parallel()
runs := []WorkflowRun{
{DatabaseID: 1, MissingToolCount: 2, LogsPath: "/tmp/gh-aw/run-1"},
{DatabaseID: 2, MissingToolCount: 0, LogsPath: "/tmp/gh-aw/run-2"},
Expand All @@ -93,6 +97,7 @@ func TestTotalMissingToolsCalculation(t *testing.T) {

// TestMissingToolCountFieldAccessibility verifies field is accessible
func TestMissingToolCountFieldAccessibility(t *testing.T) {
t.Parallel()
var run WorkflowRun

// Should be able to set and get the field
Expand Down
4 changes: 4 additions & 0 deletions pkg/cli/logs_parsing_fallback_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
)

func TestParseLogFileWithEngine_FallbackParser(t *testing.T) {
t.Parallel()
tests := []struct {
name string
logContent string
Expand Down Expand Up @@ -66,6 +67,7 @@ INFO: Configuration loaded`,

for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
// Create a temporary log file
tempDir := t.TempDir()
logFile := filepath.Join(tempDir, "test.log")
Expand All @@ -82,6 +84,7 @@ INFO: Configuration loaded`,
}

func TestParseLogFileWithEngine_FallbackVsEngineSpecific(t *testing.T) {
t.Parallel()
// Test that fallback parser works but engine-specific parser is still preferred
logContent := `::error::GitHub Actions error
ERROR: Generic error
Expand All @@ -104,6 +107,7 @@ ERROR: Generic error
}

func TestParseLogFileWithEngine_NoAwInfoJson(t *testing.T) {
t.Parallel()
// Simulate a scenario where aw_info.json is missing
// This should trigger the fallback parser

Expand Down
2 changes: 2 additions & 0 deletions pkg/cli/logs_patch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
)

func TestLogsPatchArtifactHandling(t *testing.T) {
t.Parallel()
// Create a temporary directory for the test
tmpDir := testutil.TempDir(t, "test-*")

Expand Down Expand Up @@ -71,6 +72,7 @@ index 0000000..9daeafb
}

func TestLogsCommandHelp(t *testing.T) {
t.Parallel()
// Test that the logs command help includes patch information
cmd := NewLogsCommand()
helpText := cmd.Long
Expand Down
3 changes: 3 additions & 0 deletions pkg/cli/logs_summary_file_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (

// TestWriteSummaryFile tests the writeSummaryFile function
func TestWriteSummaryFile(t *testing.T) {
t.Parallel()
// Create a temporary directory for testing
tmpDir := t.TempDir()
summaryPath := filepath.Join(tmpDir, "test-summary.json")
Expand Down Expand Up @@ -87,6 +88,7 @@ func TestWriteSummaryFile(t *testing.T) {

// TestWriteSummaryFileCreatesDirectory tests that parent directory is created
func TestWriteSummaryFileCreatesDirectory(t *testing.T) {
t.Parallel()
// Create a temporary directory for testing
tmpDir := t.TempDir()
summaryPath := filepath.Join(tmpDir, "subdir", "nested", "summary.json")
Expand Down Expand Up @@ -120,6 +122,7 @@ func TestWriteSummaryFileCreatesDirectory(t *testing.T) {

// TestWriteSummaryFileWithEmptyPath tests that empty path skips writing
func TestSummaryFileDisabling(t *testing.T) {
t.Parallel()
// This test verifies the behavior when summaryFile is empty string
// The actual skip logic is in the orchestrator, but we document the behavior here

Expand Down
Loading