mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 23:57:11 -04:00
[PR #199] [MERGED] test: add unit tests for pkg/config package #228
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/vxcontrol/pentagi/pull/199
Author: @mason5052
Created: 3/12/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @asdek
Base:
feature/next_release← Head:test/config-package-coverage📝 Commits (2)
155ceectest: add unit tests for pkg/config package4cffbe3Make config tests hermetic against ambient environment variables📊 Changes
1 file changed (+263 additions, -1 deletions)
View changed files
📝
backend/pkg/config/config_test.go(+263 -1)📄 Description
Description of Change
Problem: The
pkg/configpackage has no unit test coverage. This package handles all environment variable parsing, default values, URL parsing, and installation ID management for the entire application.Solution: Add 14 unit tests covering NewConfig defaults, environment variable overrides, URL parsing, provider server URL defaults, summarizer settings, search engine defaults, and all ensureInstallationID code paths (UUID generation, file read/write, invalid value handling).
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
go test ./pkg/config/... -vTest Results
Checklist
go fmtandgo vetrun🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.