[PR #244] [MERGED] test: add unit tests for graphiti client disabled mode #263

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

📋 Pull Request Information

Original PR: https://github.com/vxcontrol/pentagi/pull/244
Author: @mason5052
Created: 4/8/2026
Status: Merged
Merged: 4/11/2026
Merged by: @asdek

Base: mainHead: test/graphiti-client-coverage


📝 Commits (1)

  • 166035b test: add unit tests for graphiti client disabled mode

📊 Changes

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

View changed files

backend/pkg/graphiti/client_test.go (+133 -0)

📄 Description

Summary

  • Add unit tests for backend/pkg/graphiti/client.go
  • Cover disabled-mode behavior for NewClient, IsEnabled, GetTimeout, AddMessages, and all search methods
  • Keep scope hermetic and test-only without introducing a fake Graphiti server

Test Coverage

Covered:

  • NewClient(..., enabled=false)
  • (*Client).IsEnabled
  • (*Client).GetTimeout
  • (*Client).AddMessages
  • (*Client).TemporalWindowSearch
  • (*Client).EntityRelationshipsSearch
  • (*Client).DiverseResultsSearch
  • (*Client).EpisodeContextSearch
  • (*Client).SuccessfulToolsSearch
  • (*Client).RecentContextSearch
  • (*Client).EntityByLabelSearch

Behavior verified:

  • disabled client is created without error
  • nil/disabled/enabled state handling is correct
  • disabled AddMessages is a no-op
  • disabled search methods return nil response and an error containing graphiti is not enabled

Scope Notes

  • Enabled-path network behavior is intentionally not tested
  • Testing the real enabled path would require a fake Graphiti server and would make this PR broader than intended

Test Plan

  • go test ./pkg/graphiti/... -count=1
  • go test ./pkg/graphiti/... -count=1 -shuffle=on
  • go vet ./pkg/graphiti/...

🔄 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/244 **Author:** [@mason5052](https://github.com/mason5052) **Created:** 4/8/2026 **Status:** ✅ Merged **Merged:** 4/11/2026 **Merged by:** [@asdek](https://github.com/asdek) **Base:** `main` ← **Head:** `test/graphiti-client-coverage` --- ### 📝 Commits (1) - [`166035b`](https://github.com/vxcontrol/pentagi/commit/166035b3de8cc81127411b059e2fdd1552d86fad) test: add unit tests for graphiti client disabled mode ### 📊 Changes **1 file changed** (+133 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `backend/pkg/graphiti/client_test.go` (+133 -0) </details> ### 📄 Description ## Summary - Add unit tests for `backend/pkg/graphiti/client.go` - Cover disabled-mode behavior for `NewClient`, `IsEnabled`, `GetTimeout`, `AddMessages`, and all search methods - Keep scope hermetic and test-only without introducing a fake Graphiti server ## Test Coverage Covered: - `NewClient(..., enabled=false)` - `(*Client).IsEnabled` - `(*Client).GetTimeout` - `(*Client).AddMessages` - `(*Client).TemporalWindowSearch` - `(*Client).EntityRelationshipsSearch` - `(*Client).DiverseResultsSearch` - `(*Client).EpisodeContextSearch` - `(*Client).SuccessfulToolsSearch` - `(*Client).RecentContextSearch` - `(*Client).EntityByLabelSearch` Behavior verified: - disabled client is created without error - nil/disabled/enabled state handling is correct - disabled `AddMessages` is a no-op - disabled search methods return nil response and an error containing `graphiti is not enabled` ## Scope Notes - Enabled-path network behavior is intentionally not tested - Testing the real enabled path would require a fake Graphiti server and would make this PR broader than intended ## Test Plan - [x] `go test ./pkg/graphiti/... -count=1` - [x] `go test ./pkg/graphiti/... -count=1 -shuffle=on` - [x] `go vet ./pkg/graphiti/...` --- <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:57 -04:00
yindo closed this issue 2026-06-06 22:09:57 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vxcontrol/pentagi#263