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

cweill / gotests / 18735038392 / 1
94%
master: 94%

Build:
Build:
LAST BUILD BRANCH: develop
DEFAULT BRANCH: master
Ran 23 Oct 2025 01:51AM UTC
Files 14
Run time 0s
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.1

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

1512 of 1599 relevant lines covered (94.56%)

1359.95 hits per line

Source Files on job 18735038392.1
  • Tree
  • List 14
  • Changed 5
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 18735038392
  • e07ade54 on github
  • Prev Job for on feature/ai-test-generation (#18725169102.1)
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

© 2026 Coveralls, Inc