Skip to content

[plan] Add regression tests for numeric version type handling #8225

@github-actions

Description

@github-actions

Objective

Add comprehensive regression tests to ensure version fields correctly handle numeric types and prevent future type handling inconsistencies.

Context

After fixing the three version field type handling issues, we need tests to prevent regression and validate that both string and numeric types work as advertised in the schema.

Test Coverage Needed

1. Engine Version Tests (pkg/workflow/engine_test.go)

  • String version: engine.version: "beta"
  • Integer version: engine.version: 20
  • Float version: engine.version: 3.11

2. GitHub MCP Version Tests (pkg/parser/mcp_test.go)

  • String version: tools.github.version: "v1.0.0"
  • Integer version: tools.github.version: 20
  • Float version: tools.github.version: 3.11

3. Playwright Version Tests (pkg/parser/mcp_test.go)

  • String version: tools.playwright.version: "v1.41.0"
  • Integer version: tools.playwright.version: 20
  • Float version: tools.playwright.version: 1.41

Test Structure

Use table-driven tests with descriptive names:

func TestVersionTypeHandling(t *testing.T) {
    tests := []struct {
        name     string
        version  interface{}
        expected string
    }{
        {"string version", "beta", "beta"},
        {"integer version", 20, "20"},
        {"float version", 3.11, "3.11"},
    }
    
    for _, tt := range tests {
        t.Run(tt.name, func(t *testing.T) {
            // Test implementation
        })
    }
}

Files to Modify

  • Update: pkg/workflow/engine_test.go
  • Update: pkg/parser/mcp_test.go

Acceptance Criteria

  • All three version fields have test coverage for string, int, and float types
  • Tests validate correct string conversion from numeric types
  • Tests follow existing test patterns in the codebase
  • All tests pass with make test-unit

Estimated Effort

~30 minutes implementation
Related to #8221

AI generated by Plan Command for discussion #8218

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions