• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cweill / gotests / 18882875710
94%

Build:
DEFAULT BRANCH: master
Ran 28 Oct 2025 05:02PM UTC
Jobs 1
Files 14
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Oct 2025 05:20PM UTC coverage: 94.232% (-2.0%) from 96.272%
18882875710

push

github

web-flow
feat: AI-powered test case generation (#194)

* feat: add AI test generation foundation (WIP)

Implementing AI-powered test case generation as proposed in issue #41.
This is the foundation layer with provider interface and Ollama support.

New package: internal/ai/
- provider.go: Provider interface and config structs
- ollama.go: Ollama provider implementation with retry logic
- prompt.go: Prompt templates for LLM test case generation
- validator.go: In-memory compilation validation using go/parser

CLI additions:
- `-ai`: Enable AI test case generation
- `-ai-model`: Specify model (default: qwen2.5-coder:0.5b)
- `-ai-endpoint`: Ollama endpoint (default: localhost:11434)
- `-ai-cases`: Number of cases to generate (default: 3)

Options propagation:
- Added UseAI, AIModel, AIEndpoint, AICases to Options structs
- Flows from CLI flags → process.Options → gotests.Options

Still TODO:
- Integrate AI into output processing
- Modify templates for AI case injection
- Testing and validation

Related to #41

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* feat: complete AI test case generation integration

Implements full integration of AI-powered test case generation:

1. Added function body extraction:
   - Modified goparser to extract function body source code
   - Added Body field to models.Function for AI context
   - Implemented extractFunctionBody helper using AST positions

2. Enhanced AI prompt with one-shot examples:
   - Added example for simple functions (Max)
   - Added example for error-returning functions (Divide)
   - Includes function body in prompt for better context
   - Aligned prompt with wantName() helper conventions

3. Template integration:
   - Updated function.tmpl to render AI-generated test cases
   - Falls back to TODO comment when AI is not enabled/fails
   - Properly handles Args and Want maps from TestCase struct

4. Configuration improvements:
   - Set temperature... (continued)

690 of 753 new or added lines in 10 files covered. (91.63%)

1552 of 1647 relevant lines covered (94.23%)

1320.52 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
3
98.36
internal/ai/prompt.go
3
98.01
-0.94% internal/goparser/goparser.go
5
86.73
3.13% internal/output/options.go
8
93.44
internal/ai/prompt_go.go
20
88.24
internal/ai/ollama.go
24
86.05
internal/ai/parser_go.go
Jobs
ID Job ID Ran Files Coverage
1 18882875710.1 28 Oct 2025 05:02PM UTC 14
94.23
GitHub Action Run
Source Files on build 18882875710
  • Tree
  • List 14
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5e8b5b06 on github
  • Prev Build on develop (#18725169102)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc