Skip to content

test: add unit tests for pkg/version package#198

Merged
asdek merged 1 commit intovxcontrol:feature/next_releasefrom
mason5052:test/version-package-coverage
Mar 20, 2026
Merged

test: add unit tests for pkg/version package#198
asdek merged 1 commit intovxcontrol:feature/next_releasefrom
mason5052:test/version-package-coverage

Conversation

@mason5052
Copy link
Copy Markdown
Contributor

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

Add comprehensive unit tests for GetBinaryVersion, IsDevelopMode, and
GetBinaryName functions covering all code paths including default values,
custom values, and combined version-revision formatting.
Copilot AI review requested due to automatic review settings March 12, 2026 17:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds initial unit test coverage for the backend/pkg/version package, which provides binary name/version and “develop mode” detection used across the application.

Changes:

  • Adds unit tests for GetBinaryVersion() covering default, version-only, revision-only, and version+revision cases.
  • Adds unit tests for IsDevelopMode() for both develop and non-develop scenarios.
  • Adds unit tests for GetBinaryName() covering default and custom binary names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread backend/pkg/version/version_test.go
Comment thread backend/pkg/version/version_test.go
Comment thread backend/pkg/version/version_test.go
Comment thread backend/pkg/version/version_test.go
@mason5052
Copy link
Copy Markdown
Contributor Author

Hi, just a friendly ping -- this is a small test-only PR (8 tests for pkg/version) with no production code changes. Happy to adjust anything if needed. Thanks for your time!

@asdek asdek changed the base branch from master to feature/next_release March 20, 2026 13:41
@asdek asdek merged commit 3d8e337 into vxcontrol:feature/next_release Mar 20, 2026
3 of 4 checks passed
@asdek
Copy link
Copy Markdown
Contributor

asdek commented Mar 20, 2026

hey @mason5052

thanks for the PR, requests are accepted with a slight delay due to the use of sprints in product development, these are not always urgent changes, I hope for your understanding

@asdek asdek mentioned this pull request Mar 22, 2026
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants