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

cweill / gotests / 18735038392
94%
master: 94%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: master
Ran 23 Oct 2025 01:51AM 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 01:49AM UTC coverage: 94.559% (-1.7%) from 96.272%
18735038392

Pull #194

github

cweill
fix: implement strict golden file validation and regenerate all goldens

## Problem
E2E tests were using weak validation that only checked if *any* test case
name appeared in the golden file. This allowed bad golden files with:
- Placeholder names ("descriptive_test_name")
- Function names as test names ("FilterPositive", "ParseKeyValue")
- Null/empty values instead of realistic test data

## Solution

### 1. Strict Golden File Validation (internal/ai/e2e_test.go)
- Parse both generated and golden files with parseGoTestCases()
- Compare test cases field-by-field (names, args, want values, wantErr)
- Fail immediately on ANY mismatch (not just warnings)
- Ensures temperature=0 determinism is actually validated

### 2. Golden File Regeneration Script (scripts/regenerate-goldens.sh)
- Automates regeneration of all 11 AI golden files
- Strips CLI output ("Generated TestXxx", warnings)
- Uses real Ollama + qwen2.5-coder:0.5b for generation
- Ensures consistency across all golden files

### 3. Fixed/Added Golden Files

**Added (4 new test cases):**
- calculator_multiply_ai.go
- calculator_divide_ai.go
- string_utils_reverse_ai.go
- string_utils_contains_any_ai.go

**Regenerated (7 existing files):**
- business_logic_calculate_discount_ai.go - cleaned format
- business_logic_format_currency_ai.go - fixed placeholder names
- data_processing_filter_positive_ai.go - fixed nil values → real data
- math_ops_clamp_ai.go - cleaned format
- math_ops_factorial_ai.go - fixed placeholder names
- string_utils_parse_key_value_ai.go - fixed nil values → real data
- user_service_hash_password_ai.go - cleaned format

## Results

✅ All 9 E2E tests pass with strict validation:
- business_logic_calculate_discount ✓
- math_ops_clamp ✓
- data_processing_filter_positive ✓ (was failing)
- user_service_hash_password ✓
- calculator_multiply ✓ (new)
- calculator_divide ✓ (new)
- string_utils_reverse ✓ (new)
- string_utils_parse_key_value ✓ (was failing)
- string_utils_contains_any ✓ (... (continued)
Pull Request #194: feat: AI-powered test case generation

650 of 705 new or added lines in 10 files covered. (92.2%)

6 existing lines in 2 files now uncovered.

1512 of 1599 relevant lines covered (94.56%)

1359.95 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.6
2.99% internal/output/options.go
6
94.55
internal/ai/prompt_go.go
14
89.78
internal/ai/ollama.go
24
86.05
internal/ai/parser_go.go

Uncovered Existing Lines

Lines Coverage ∆ File
2
96.99
0.09% gotests.go
4
86.6
2.99% internal/output/options.go
Jobs
ID Job ID Ran Files Coverage
1 18735038392.1 23 Oct 2025 01:51AM UTC 14
94.56
GitHub Action Run
Source Files on build 18735038392
  • Tree
  • List 14
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #194
  • PR Base - 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