mirror of
https://github.com/vxcontrol/pentagi.git
synced 2026-07-20 12:37:04 -04:00
[PR #213] [MERGED] test: add unit tests for pkg/graph context helpers #239
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/213
Author: @mason5052
Created: 3/17/2026
Status: ✅ Merged
Merged: 3/20/2026
Merged by: @asdek
Base:
feature/next_release← Head:test/graph-context-coverage📝 Commits (1)
b130cd0test: add graph context helper coverage📊 Changes
1 file changed (+200 additions, -0 deletions)
View changed files
➕
backend/pkg/graph/context_test.go(+200 -0)📄 Description
Description of the Change
Problem
backend/pkg/graph/context.goprovides key context helper functions used throughout the graph layer (user ID, user type, permissions) but had no unit test coverage.Solution
Add
context_test.gowith 20 focused unit tests covering all testable functions in the package.Closes N/A
Type of Change
Areas Affected
Testing and Verification
Test Configuration
Test Steps
go test ./pkg/graph/... -count=1go test ./pkg/graph/... -count=1 -shuffle=ongo vet ./pkg/graph/...Test Results
Security Considerations
No security implications. Test-only change covering authentication context helpers.
Performance Impact
None. Test-only change.
Documentation Updates
None required.
Deployment Notes
None. Test-only change.
Checklist
Code Quality
go fmtandgo vet(for Go code)Security
Compatibility
Documentation
Additional Notes
validatePermissionWithFlowIDis intentionally excluded: it requires adatabase.Querierinterface, which would need either a large mock or integration test infrastructure outside the scope of this narrow PR.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.