All Versions
18
Latest Version
Avg Release Cycle
210 days
Latest Release
227 days ago

Changelog History
Page 1

  • v1.9.0 Changes

    October 28, 2025

    โœ… ๐Ÿค– 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 AIgotests -all -ai -w yourfile.go
    

    ๐Ÿ“ Example

    Given this function:

    funcCalculateDiscount(pricefloat64,percentageint) (float64,error) {ifprice\<0{return0,errors.New("price cannot be negative")
        }ifpercentage\<0||percentage\>100{return0,errors.New("percentage must be between 0 and 100")
        }returnprice-(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 modelgotests -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 endpointgotests -all -ai -ai-endpoint http://custom:11434 -w file.go
    

    ๐Ÿ”’ ๐Ÿ”’ Privacy & Security

    • 0๏ธโƒฃ โœ… 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
    • 0๏ธโƒฃ -ai-model - Select model (default: qwen2.5-coder:0.5b)
    • 0๏ธโƒฃ -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 : v1.8.0...v1.9.0

  • v1.8.0 Changes

    October 21, 2025

    ๐Ÿ‘ ๐ŸŽ‰ Full Go Generics Support

    ๐Ÿ‘ This release adds complete support for Go generics (type parameters), enabling gotests to generate tests for generic functions and methods on generic types.

    โœจ Key Features

    • ๐Ÿ”ง Generic Functions : Generate tests for functions with type parameters

    • ๐Ÿ—๏ธ Generic Types : Support for methods on generic types

    • ๐ŸŽฏ All Constraint Types : any, comparable, union types (int64 | float64), approximation (~int)

    • ๐Ÿง  Smart Type Mapping : Intelligent defaults for type instantiation

    • ๐Ÿ”„ Multiple Type Parameters : Handles functions like Pair[T, U any]

    โœ… ๐Ÿ“Š Test Coverage

    • โœ… 97.5% main package coverage
    • โœ… 83.5% overall project coverage
    • โœ… 100% coverage on all new parser functions
    • โœ… โœ… 8 comprehensive generic test patterns

    ๐Ÿ”ง Technical Improvements

    ๐Ÿ“œ Parser Enhancements:

    • ๐Ÿ†• New parseTypeDecls() extracts type parameters from type declarations
    • ๐Ÿ†• New parseTypeParams() parses AST field lists
    • ๐Ÿ†• New extractBaseTypeName() handles receiver types

    Template Functions:

    • TypeArgs - generates concrete type arguments for calls
    • FieldType - substitutes type parameters in field declarations
    • ReceiverType - substitutes type parameters in receiver instantiations

    โšก๏ธ Model Updates:

    • ๐Ÿ†• New TypeParam struct
    • โž• Added TypeParams field to Function
    • Helper methods: IsGeneric(), HasGenericReceiver()

    ๐Ÿ“š ๐Ÿ“š Documentation

    โž• Added comprehensive "Go Generics Support" section to README with:

    • โœ… Example: Generic function test generation
    • Example: Methods on generic types
    • Type constraint mapping reference

    ๐Ÿ›  ๐Ÿ› Fixes

    โœ… Closes #165

    ๐Ÿ“ฆ Installation

    go install github.com/cweill/gotests/gotests@v1.8.0
    

    ๐Ÿ™ Credits

    ๐Ÿค– Developed with assistance from Claude Code


    Full Changelog : v1.7.0...v1.8.0

  • v1.7.4 Changes

    October 21, 2025

    What's New in v1.7.4

    ๐Ÿš€ This release fixes two important bugs that improve test correctness and restore broken functionality.

    ๐Ÿ› Bug Fixes

    โœ… ๐Ÿ› Fixed wantErr Test Logic (PR #169)

    โœ… When a test expects an error (tt.wantErr == true), gotests now correctly skips result validation instead of checking potentially undefined return values.

    Before:

    if(err!=nil)!=tt.wantErr{t.Errorf("Foo() error = %v, wantErr %v",err,tt.wantErr)continue}// Bug: Still checks results even when error is expected!ifgot!=tt.want{t.Errorf("Foo() = %v, want %v",got,tt.want)
    }
    

    After:

    if(err!=nil)!=tt.wantErr{t.Errorf("Foo() error = %v, wantErr %v",err,tt.wantErr)continue}iftt.wantErr{return// โ† Fixed: Skip result checks when error expected}ifgot!=tt.want{t.Errorf("Foo() = %v, want %v",got,tt.want)
    }
    

    โœ… This prevents false test failures and ensures tests behave correctly when expecting errors.

    Thanks to @arifmahmudrana for identifying this issue!

    โœ… ๐Ÿ› Fixed -template_params Flag (Issue #149)

    โœ… The -template_params flag was defined but never actually used due to a bug from PR #90. This flag now works correctly!

    Usage:

    # Pass template parameters as JSON string$ gotests -template_params'{"key":"value"}'-all file.go# Or use a file (takes precedence)$ gotests -template_params_file params.json -all file.go
    

    โœ… This is useful when calling gotests from other tools with custom templates.

    Thanks to @butuzov for identifying this bug and @cweill for the fix suggestion!

    Installation

    go install github.com/cweill/gotests/gotests@v1.7.4
    

    Full Changelog : v1.7.3...v1.7.4

  • v1.7.3 Changes

    October 21, 2025

    What's New in v1.7.3

    โšก๏ธ This is a security update that addresses multiple CVEs by updating dependencies.

    ๐Ÿ”’ Security Fixes

    โšก๏ธ ๐Ÿ”’ Updated golang.org/x/tools to fix CVEs

    Updated golang.org/x/tools from v0.0.0-20191109212701 (November 2019) to v0.38.0 (latest) to address multiple security vulnerabilities:

    ๐Ÿ”„ Changes

    • โšก๏ธ Updated golang.org/x/tools from 2019 version to v0.38.0
    • โšก๏ธ Updated Go directive to 1.24.0 (with toolchain go1.24.5)
    • โž• Added indirect dependencies: golang.org/x/mod v0.29.0, golang.org/x/sync v0.17.0
    • ๐Ÿ›  Fixed test code compatibility with stricter format string checking in newer x/tools

    โšก๏ธ All tests pass with the updated dependencies.

    Installation

    go install github.com/cweill/gotests/gotests@v1.7.3
    

    Important Note

    โšก๏ธ We recommend all users update to this version to ensure you have the latest security fixes.

    Full Changelog : v1.7.2...v1.7.3


    ๐Ÿ”’ Thanks to @testwill for identifying these security vulnerabilities!

  • v1.7.2 Changes

    October 21, 2025

    What's New in v1.7.2

    ๐Ÿ“š This is a small cleanup release with code quality improvements and documentation updates.

    ๐Ÿ‘Œ Improvements

    ๐Ÿงน Code Cleanup
    • โœ‚ Remove unnecessary type conversion (#170) - Simplified code in generateTest() by removing redundant type conversion. Thanks to @fengxuway!
    ๐Ÿ“š ๐Ÿ“š Documentation
    • โšก๏ธ Update VS Code link (#167) - Changed Visual Studio Code link to point directly to gotests-specific configuration documentation for easier setup. Thanks to @davidhsingyuchen!

    Installation

    go install github.com/cweill/gotests/gotests@v1.7.2
    

    Full Changelog : v1.7.1...v1.7.2

  • v1.7.1 Changes

    October 21, 2025

    What's New in v1.7.1

    ๐Ÿš€ This release adds two highly-requested features to improve the gotests experience.

    ๐Ÿ†• New Features

    ๐Ÿงช go-cmp Support (-use_go_cmp)

    โœ… Generate tests using google/go-cmp instead of reflect.DeepEqual for better test assertions and diff output.

    $ gotests -use_go_cmp -all -w example.go
    

    โœ… Generated tests will use cmp.Equal() for comparisons and cmp.Diff() in error messages, providing much clearer output when tests fail.

    Example output:

    if!cmp.Equal(tt.want,got) {t.Errorf("Foo() = %v, want %v\ndiff=%s",got,tt.want,cmp.Diff(tt.want,got))
    }
    

    โœ… Resolves #155 (thanks to @butuzov for the original PR!)

    ๐Ÿ“‹ Version Information (-version)

    โœ… Check which version of gotests you're running:

    $ gotests -version
    gotests v1.7.1
    Go version: go1.22.0
    Git commit: 5252e0b...
    Build time: 2025-10-21T02:15:00Z
    

    ๐Ÿš€ This helps with troubleshooting and verifying you have the latest release.

    โœ… Resolves #133

    Housekeeping

    • โœ… Closed superseded README PRs (#172, #166) that were already addressed in v1.7.0

    Installation

    go install github.com/cweill/gotests/gotests@v1.7.1
    

    Full Changelog : v1.7.0...v1.7.1

  • v1.7.0 Changes

    October 21, 2025

    ๐Ÿš€ v1.7.0 - Major Modernization Release

    ๐Ÿš€ After 5 years since v1.6.0, we're excited to release v1.7.0 with major improvements and modernizations! ๐ŸŽ‰

    โœจ New Features

    ๐Ÿ‘ Recursive Directory Support

    โœ… You can now generate tests for entire directory trees using the ... pattern:

    gotests -all pkg/...
    

    โœ… This will recursively generate tests for all Go files in the pkg directory and its subdirectories. Fixes #186.

    Cleaner Generated Code

    โœ… Generated tests now use Go 1.22+ loop variable scoping, eliminating the need for the tt := tt shadowing pattern. Tests are now cleaner and more readable.

    ๐Ÿ‘ Better Error Handling

    โœ… Subtests with return values now use t.Fatalf() instead of t.Errorf() + return, providing clearer test failure semantics and preventing misleading output. Thanks to PR #184.

    ๐Ÿ”ง Improvements

    ๐Ÿ’ฅ BREAKING: Minimum Go Version

    • Minimum Go version increased from 1.6 to 1.22
    • Leverages modern Go features for cleaner generated code
    • ๐Ÿ‘ Aligns with Go's official support policy

    Dependency Reduction

    • ๐Ÿ“ฆ Replaced third-party bindata tools with stdlib embed package (PR #181)
    • โœ‚ Removed 834+ lines of generated code
    • ๐Ÿ— Simplified build process - no more go generate needed
    • ๐Ÿ‘ Better maintainability and reduced external dependencies

    ๐Ÿ› Bug Fixes

    • ๐Ÿ›  Fixed import path bug when receiver types and methods are in different files (PR #179)
    • ๐Ÿ“ฆ Now correctly collects imports from all files in the package
    • โœ… Prevents compilation errors in generated test files

    Template Improvements

    • โœ… Proper t.Parallel() placement at top-level test functions (fixes #188)
    • ๐Ÿ‘• Satisfies tparallel linter requirements
    • ๐Ÿ‘ Better parallel test execution

    ๐Ÿ“š Documentation & Installation

    • โšก๏ธ Updated README to use go install instead of deprecated go get (PR #180)
    • โœ… Documented the -named flag for map-based table tests (PR #185)
    • โž• Added CHANGELOG.md for tracking changes
    • โž• Added CLAUDE.md for AI-assisted development

    โšก๏ธ ๐Ÿ“ฆ CI/CD Updates

    • โšก๏ธ Updated GitHub Actions to test Go 1.22.x, 1.23.x, 1.24.x, and 1.25.x
    • Modernized actions: setup-go v2โ†’v5, checkout v2โ†’v4
    • Simplified coverage reporting with coverallsapp/github-action@v2
    • ๐Ÿ›  Fixed bot commit support for automated workflows

    ๐Ÿ“Š Statistics

    • 834+ lines of generated bindata code removed
    • 5 PRs integrated
    • 2 issues fixed
    • 4 Go versions tested in CI (was 8, now focused on recent versions)

    ๐Ÿ™ Thanks

    ๐Ÿš€ Special thanks to the contributors whose PRs were integrated in this release:

    • โœ… PR #184 (t.Fatalf improvement)
    • ๐Ÿ“š PR #185 (documentation)
    • โœ… PR #180 (go install)
    • ๐Ÿ“ฆ PR #181 (embed package)
    • โœ… PR #179 (import fix)

    And to everyone who reported issues and helped maintain this project!

    ๐Ÿ“ Installation

    go install github.com/cweill/gotests/gotests@latest
    

    ๐Ÿ”— Full Changelog

    ๐Ÿ‘€ See CHANGELOG.md for complete details.

  • v1.6.0

    December 26, 2020
  • v1.5.3

    April 07, 2019
  • v1.5.2

    November 08, 2016