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

cweill / gotests
94%

Build:
DEFAULT BRANCH: master
Repo Added 25 Jan 2016 05:22AM UTC
Files 14
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

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • GitHub-actions
  • add-godoc-comments
  • ai
  • codeowners
  • develop
  • disable-1.6
  • feature/ai-test-generation
  • feature/fix_travis
  • go-11.1
  • master
  • receiver
  • release/1.5.3
  • revert-48-add-support-functions-from-tests
  • test-coverage-improvements
  • v1.0
  • v1.1
  • v1.2
  • v1.3.0
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v1.5.3
  • v1.6.0

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

Relevant lines Covered
Build:
Build:
1647 RELEVANT LINES 1552 COVERED LINES
1320.52 HITS PER LINE
Source Files on master
  • Tree
  • List 14
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
18882875710 master 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 pac... push 28 Oct 2025 05:02PM UTC web-flow github
94.23
18785413303 develop style: clean up test code formatting for improved readability (#198) - Remove unnecessary blank lines from test functions for improved code clarity Signed-off-by: appleboy <appleboy.tw@gmail.com> push 24 Oct 2025 04:08PM UTC web-flow github
94.23
18770061784 ai style: clean up test code formatting for improved readability - Remove unnecessary blank lines from test functions for improved code clarity Signed-off-by: appleboy <appleboy.tw@gmail.com> Pull #198 24 Oct 2025 04:06PM UTC appleboy github
94.23
18756499982 develop 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 pac... push 23 Oct 2025 05:21PM UTC web-flow github
94.23
18756373445 feature/ai-test-generation feat(ai): add min/max range for AI test case generation Replace fixed `-ai-cases` flag with flexible `-ai-min-cases` and `-ai-max-cases` flags (defaults: 3-10). This allows users to specify either a fixed number of test cases (min = max) or let t... Pull #194 23 Oct 2025 05:15PM UTC cweill github
94.23
18754597520 feature/ai-test-generation test(ai): disable 2 more non-deterministic E2E tests (4 total disabled) Disabled business_logic_calculate_discount and string_utils_reverse E2E tests due to environment-dependent non-determinism in qwen2.5-coder:0.5b. Key Finding: Non-determinis... Pull #194 23 Oct 2025 04:06PM UTC cweill github
94.33
18737582020 feature/ai-test-generation test(ai): temporarily disable non-deterministic calculator E2E tests Disabled calculator_multiply and calculator_divide E2E tests due to qwen2.5-coder:0.5b non-determinism with receiver method instantiation. The LLM randomly chooses between two ... Pull #194 23 Oct 2025 04:30AM UTC cweill github
94.33
18736962549 feature/ai-test-generation fix(ai): improve E2E test determinism and use natural language test names Changes: - Remove exampleNames from prompt that was forcing specific test name patterns - Add seed=42 to Ollama requests for deterministic output - Rewrite E2E tests to use... Pull #194 23 Oct 2025 03:52AM UTC cweill github
94.33
18735842190 feature/ai-test-generation feat: increase E2E test retry count to 10 attempts Increased retry count from 3 to 10 to better handle non-deterministic LLM output variance in CI environments. This gives qwen2.5-coder:0.5b more opportunities to produce output matching the golde... Pull #194 23 Oct 2025 02:41AM UTC cweill github
94.33
18735731293 feature/ai-test-generation feat: add retry logic to E2E tests for non-deterministic LLM output **Problem:** Small LLM models like qwen2.5-coder:0.5b are not perfectly deterministic even with temperature=0. In CI, the model sometimes generates slightly different test case n... Pull #194 23 Oct 2025 02:34AM UTC cweill github
94.33
See All Builds (1379)
  • Repo on GitHub
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