[PR #198] [MERGED] test: add unit tests for pkg/version package #229

Closed
opened 2026-06-06 22:09:48 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/pentagi/pull/198
Author: @mason5052
Created: 3/12/2026
Status: Merged
Merged: 3/20/2026
Merged by: @asdek

Base: feature/next_releaseHead: test/version-package-coverage


📝 Commits (1)

  • 854cd6d test: add unit tests for pkg/version package

📊 Changes

1 file changed (+73 additions, -0 deletions)

View changed files

backend/pkg/version/version_test.go (+73 -0)

📄 Description

Description of Change

Problem: The pkg/version package has no unit test coverage. The package provides binary version, name, and development mode detection used throughout the application.

Solution: Add comprehensive unit tests for all three exported functions (GetBinaryVersion, IsDevelopMode, GetBinaryName) covering all code paths including default values, custom values, and combined version-revision formatting.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Security update
  • Test update
  • Documentation update
  • Configuration change

Areas Affected

  • Core Services (Frontend UI / Backend API)
  • AI Agents (Researcher / Developer / Executor)
  • Security Tools Integration
  • Memory System (Vector Store / Knowledge Base)
  • Monitoring Stack (Grafana / OpenTelemetry)
  • Analytics & Reporting
  • External Integrations (LLM Providers / Search Engines / Security APIs)
  • Documentation
  • Infrastructure / DevOps

Testing and Verification

Test Configuration

  • PentAGI Version: v1.2.0 (master)
  • Go Version: 1.24.1
  • Host OS: Windows 11

Test Steps

  1. Run go test ./pkg/version/... -v

Test Results

=== RUN   TestGetBinaryVersion_Default
--- PASS: TestGetBinaryVersion_Default (0.00s)
=== RUN   TestGetBinaryVersion_WithVersion
--- PASS: TestGetBinaryVersion_WithVersion (0.00s)
=== RUN   TestGetBinaryVersion_WithVersionAndRevision
--- PASS: TestGetBinaryVersion_WithVersionAndRevision (0.00s)
=== RUN   TestGetBinaryVersion_WithRevisionOnly
--- PASS: TestGetBinaryVersion_WithRevisionOnly (0.00s)
=== RUN   TestIsDevelopMode_True
--- PASS: TestIsDevelopMode_True (0.00s)
=== RUN   TestIsDevelopMode_False
--- PASS: TestIsDevelopMode_False (0.00s)
=== RUN   TestGetBinaryName_Default
--- PASS: TestGetBinaryName_Default (0.00s)
=== RUN   TestGetBinaryName_Custom
--- PASS: TestGetBinaryName_Custom (0.00s)
PASS
ok  	pentagi/pkg/version	4.393s

Checklist

  • Code follows project coding standards
  • Tests added for changes
  • All tests pass
  • go fmt and go vet run
  • Changes are backward compatible

🔄 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/vxcontrol/pentagi/pull/198 **Author:** [@mason5052](https://github.com/mason5052) **Created:** 3/12/2026 **Status:** ✅ Merged **Merged:** 3/20/2026 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `feature/next_release` ← **Head:** `test/version-package-coverage` --- ### 📝 Commits (1) - [`854cd6d`](https://github.com/vxcontrol/pentagi/commit/854cd6d0226b1b44c73a4b01db3e5f6bd3f112fe) test: add unit tests for pkg/version package ### 📊 Changes **1 file changed** (+73 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `backend/pkg/version/version_test.go` (+73 -0) </details> ### 📄 Description ## Description of Change **Problem:** The `pkg/version` package has no unit test coverage. The package provides binary version, name, and development mode detection used throughout the application. **Solution:** Add comprehensive unit tests for all three exported functions (`GetBinaryVersion`, `IsDevelopMode`, `GetBinaryName`) covering all code paths including default values, custom values, and combined version-revision formatting. ## Type of Change - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) - [ ] Security update - [x] Test update - [ ] Documentation update - [ ] Configuration change ## Areas Affected - [x] Core Services (Frontend UI / Backend API) - [ ] AI Agents (Researcher / Developer / Executor) - [ ] Security Tools Integration - [ ] Memory System (Vector Store / Knowledge Base) - [ ] Monitoring Stack (Grafana / OpenTelemetry) - [ ] Analytics & Reporting - [ ] External Integrations (LLM Providers / Search Engines / Security APIs) - [ ] Documentation - [ ] Infrastructure / DevOps ## Testing and Verification ### Test Configuration - PentAGI Version: v1.2.0 (master) - Go Version: 1.24.1 - Host OS: Windows 11 ### Test Steps 1. Run `go test ./pkg/version/... -v` ### Test Results ``` === RUN TestGetBinaryVersion_Default --- PASS: TestGetBinaryVersion_Default (0.00s) === RUN TestGetBinaryVersion_WithVersion --- PASS: TestGetBinaryVersion_WithVersion (0.00s) === RUN TestGetBinaryVersion_WithVersionAndRevision --- PASS: TestGetBinaryVersion_WithVersionAndRevision (0.00s) === RUN TestGetBinaryVersion_WithRevisionOnly --- PASS: TestGetBinaryVersion_WithRevisionOnly (0.00s) === RUN TestIsDevelopMode_True --- PASS: TestIsDevelopMode_True (0.00s) === RUN TestIsDevelopMode_False --- PASS: TestIsDevelopMode_False (0.00s) === RUN TestGetBinaryName_Default --- PASS: TestGetBinaryName_Default (0.00s) === RUN TestGetBinaryName_Custom --- PASS: TestGetBinaryName_Custom (0.00s) PASS ok pentagi/pkg/version 4.393s ``` ## Checklist - [x] Code follows project coding standards - [x] Tests added for changes - [x] All tests pass - [x] `go fmt` and `go vet` run - [x] Changes are backward compatible --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-06 22:09:48 -04:00
yindo closed this issue 2026-06-06 22:09:48 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#229