[PR #1733] fix(deps): update module github.com/cweill/gotests to v1.9.0 #1716

Open
opened 2025-11-01 21:26:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-vikunja/vikunja/pull/1733
Author: @renovate[bot]
Created: 10/30/2025
Status: 🔄 Open

Base: mainHead: renovate/github.com-cweill-gotests-1.x


📝 Commits (1)

  • bb05a26 fix(deps): update module github.com/cweill/gotests to v1.9.0

📊 Changes

2 files changed (+3 additions, -1 deletions)

View changed files

📝 go.mod (+1 -1)
📝 go.sum (+2 -0)

📄 Description

This PR contains the following updates:

Package Change Age Confidence
github.com/cweill/gotests v1.8.0 -> v1.9.0 age confidence

Release Notes

cweill/gotests (github.com/cweill/gotests)

v1.9.0: - AI-Powered Test Generation

Compare Source

🤖 AI-Powered Test Generation

This release adds AI-powered test case generation using local LLMs via Ollama, enabling automatic generation of intelligent, realistic test cases.

Key Features
  • 🧠 Intelligent Test Cases: AI analyzes function implementation to generate realistic test values, edge cases, and error conditions
  • 🏠 Local-First & Private: Uses Ollama to run LLMs locally - your code never leaves your machine
  • Fast Small Models: Default qwen2.5-coder:0.5b model (400MB) generates tests in seconds
  • 🎯 Smart Coverage: Automatically identifies edge cases, error conditions, and validation logic
  • 🔧 Flexible: Support for simple types, complex types, methods, variadic params, and multiple return values
  • 📊 Configurable: Adjust min/max test cases, choose different models, or use custom endpoints
🚀 Quick Start

# Install Ollama (one-time setup)
curl -fsSL https://ollama.com/install.sh | sh
ollama serve &
ollama pull qwen2.5-coder:0.5b

# Generate tests with AI
gotests -all -ai -w yourfile.go
📝 Example

Given this function:

func CalculateDiscount(price float64, percentage int) (float64, error) {
    if price < 0 {
        return 0, errors.New("price cannot be negative")
    }
    if percentage < 0 || percentage > 100 {
        return 0, errors.New("percentage must be between 0 and 100")
    }
    return price - (price * float64(percentage) / 100.0), nil
}

AI generates:

  • Valid input test case
  • Negative price error case
  • Invalid percentage error case
  • Proper error handling and assertions
🎛️ Configuration Options

# Use different model
gotests -all -ai -ai-model llama3.2:latest -w file.go

# Generate specific number of test cases (min = max)
gotests -all -ai -ai-min-cases 5 -ai-max-cases 5 -w file.go

# Generate range of test cases (AI chooses 3-7)
gotests -all -ai -ai-min-cases 3 -ai-max-cases 7 -w file.go

# Custom Ollama endpoint
gotests -all -ai -ai-endpoint http://custom:11434 -w file.go
🔒 Privacy & Security
  • Local-first by default - Using Ollama keeps all data on your machine
  • Offline operation - Works completely offline with local models
  • ⚠️ Function bodies are analyzed - Business logic and code comments are sent to the LLM
  • 🔒 Recommendation: Avoid using -ai on code containing secrets or API keys
📊 Test Coverage Improvements
  • Increased overall project coverage from 28.1% to 84.6% (#​196)
  • Added comprehensive tests for:
    • internal/goparser package
    • internal/models package
    • internal/output package
    • internal/render package
    • gotests/process package
📚 Documentation Enhancements
  • Added godoc comments to all exported functions (#​195)
  • Expanded README with:
    • AI-powered test generation section
    • Quick start examples
    • Privacy and security considerations
    • Configuration options and examples
🛠️ Technical Implementation

New Packages:

  • internal/ai - AI provider abstraction layer
    • Ollama provider with health checks and retries
    • Go-specific prompt engineering
    • Response parsing and validation
    • E2E test suite with golden file validation

CLI Flags:

  • -ai - Enable AI test case generation
  • -ai-model - Select model (default: qwen2.5-coder:0.5b)
  • -ai-endpoint - Ollama endpoint (default: http://localhost:11434)
  • -ai-min-cases - Minimum test cases to generate (default: 3)
  • -ai-max-cases - Maximum test cases to generate (default: 10)

Architecture:

  • Provider-based design for future LLM support
  • Language-agnostic core with Go-specific implementation
  • Graceful fallback to TODO comments on generation failure
  • Integration with existing template rendering pipeline
🐛 Known Issues
  • Issue #​197: 4 out of 11 E2E tests disabled due to environment-dependent LLM non-determinism
    • Does not affect functionality, only E2E test validation
    • 7 E2E tests pass consistently on first attempt
    • Will be addressed in future patch release
📦 Installation
go install github.com/cweill/gotests/gotests@v1.9.0
🙏 Credits

🤖 Developed with assistance from Claude Code


Full Changelog: https://github.com/cweill/gotests/compare/v1.8.0...v1.9.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-vikunja/vikunja/pull/1733 **Author:** [@renovate[bot]](https://github.com/apps/renovate) **Created:** 10/30/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `renovate/github.com-cweill-gotests-1.x` --- ### 📝 Commits (1) - [`bb05a26`](https://github.com/go-vikunja/vikunja/commit/bb05a261f47123cee57acea804df00383d06310a) fix(deps): update module github.com/cweill/gotests to v1.9.0 ### 📊 Changes **2 files changed** (+3 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `go.mod` (+1 -1) 📝 `go.sum` (+2 -0) </details> ### 📄 Description This PR contains the following updates: | Package | Change | Age | Confidence | |---|---|---|---| | [github.com/cweill/gotests](https://redirect.github.com/cweill/gotests) | `v1.8.0` -> `v1.9.0` | [![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fcweill%2fgotests/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fcweill%2fgotests/v1.8.0/v1.9.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>cweill/gotests (github.com/cweill/gotests)</summary> ### [`v1.9.0`](https://redirect.github.com/cweill/gotests/releases/tag/v1.9.0): - AI-Powered Test Generation [Compare Source](https://redirect.github.com/cweill/gotests/compare/v1.8.0...v1.9.0) #### 🤖 AI-Powered Test Generation This release adds **AI-powered test case generation** using local LLMs via Ollama, enabling automatic generation of intelligent, realistic test cases. ##### ✨ Key Features - 🧠 **Intelligent Test Cases**: AI analyzes function implementation to generate realistic test values, edge cases, and error conditions - 🏠 **Local-First & Private**: Uses Ollama to run LLMs locally - your code never leaves your machine - ⚡ **Fast Small Models**: Default qwen2.5-coder:0.5b model (400MB) generates tests in seconds - 🎯 **Smart Coverage**: Automatically identifies edge cases, error conditions, and validation logic - 🔧 **Flexible**: Support for simple types, complex types, methods, variadic params, and multiple return values - 📊 **Configurable**: Adjust min/max test cases, choose different models, or use custom endpoints ##### 🚀 Quick Start ```bash # Install Ollama (one-time setup) curl -fsSL https://ollama.com/install.sh | sh ollama serve & ollama pull qwen2.5-coder:0.5b # Generate tests with AI gotests -all -ai -w yourfile.go ``` ##### 📝 Example Given this function: ```go func CalculateDiscount(price float64, percentage int) (float64, error) { if price < 0 { return 0, errors.New("price cannot be negative") } if percentage < 0 || percentage > 100 { return 0, errors.New("percentage must be between 0 and 100") } return price - (price * float64(percentage) / 100.0), nil } ``` AI generates: - ✅ Valid input test case - ✅ Negative price error case - ✅ Invalid percentage error case - ✅ Proper error handling and assertions ##### 🎛️ Configuration Options ```bash # Use different model gotests -all -ai -ai-model llama3.2:latest -w file.go # Generate specific number of test cases (min = max) gotests -all -ai -ai-min-cases 5 -ai-max-cases 5 -w file.go # Generate range of test cases (AI chooses 3-7) gotests -all -ai -ai-min-cases 3 -ai-max-cases 7 -w file.go # Custom Ollama endpoint gotests -all -ai -ai-endpoint http://custom:11434 -w file.go ``` ##### 🔒 Privacy & Security - ✅ **Local-first by default** - Using Ollama keeps all data on your machine - ✅ **Offline operation** - Works completely offline with local models - ⚠️ **Function bodies are analyzed** - Business logic and code comments are sent to the LLM - 🔒 **Recommendation**: Avoid using `-ai` on code containing secrets or API keys ##### 📊 Test Coverage Improvements - Increased overall project coverage from **28.1%** to **84.6%** ([#&#8203;196](https://redirect.github.com/cweill/gotests/issues/196)) - Added comprehensive tests for: - internal/goparser package - internal/models package - internal/output package - internal/render package - gotests/process package ##### 📚 Documentation Enhancements - Added godoc comments to all exported functions ([#&#8203;195](https://redirect.github.com/cweill/gotests/issues/195)) - Expanded README with: - AI-powered test generation section - Quick start examples - Privacy and security considerations - Configuration options and examples ##### 🛠️ Technical Implementation **New Packages:** - `internal/ai` - AI provider abstraction layer - Ollama provider with health checks and retries - Go-specific prompt engineering - Response parsing and validation - E2E test suite with golden file validation **CLI Flags:** - `-ai` - Enable AI test case generation - `-ai-model` - Select model (default: qwen2.5-coder:0.5b) - `-ai-endpoint` - Ollama endpoint (default: <http://localhost:11434>) - `-ai-min-cases` - Minimum test cases to generate (default: 3) - `-ai-max-cases` - Maximum test cases to generate (default: 10) **Architecture:** - Provider-based design for future LLM support - Language-agnostic core with Go-specific implementation - Graceful fallback to TODO comments on generation failure - Integration with existing template rendering pipeline ##### 🐛 Known Issues - Issue [#&#8203;197](https://redirect.github.com/cweill/gotests/issues/197): 4 out of 11 E2E tests disabled due to environment-dependent LLM non-determinism - Does not affect functionality, only E2E test validation - 7 E2E tests pass consistently on first attempt - Will be addressed in future patch release ##### 📦 Installation ```bash go install github.com/cweill/gotests/gotests@v1.9.0 ``` ##### 🙏 Credits 🤖 Developed with assistance from [Claude Code](https://claude.com/claude-code) *** **Full Changelog**: <https://github.com/cweill/gotests/compare/v1.8.0...v1.9.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/go-vikunja/vikunja). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTkuNCIsInVwZGF0ZWRJblZlciI6IjQxLjE1OS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the
pull-request
label 2025-11-01 21:26:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/vikunja#1716
No description provided.