Skip to content

Add testing for examples #47

@fogfish

Description

@fogfish

Problem: Examples might break but we won't know until someone runs them.

Required Changes:

  1. Add examples/example_test.go:
func TestExamplesCompile(t *testing.T) {
    // Test that all examples compile
    examples := []string{
        "01_helloworld",
        "02_rainbow",
        // ...
    }
    
    for _, ex := range examples {
        cmd := exec.Command("go", "build", "./"+ex)
        if err := cmd.Run(); err != nil {
            t.Errorf("Example %s failed to compile: %v", ex, err)
        }
    }
}
  1. Add to CI pipeline
  2. Consider making examples buildable without LLM credentials

Estimated Effort: 1 hour
Skills Required: Testing, CI/CD

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions