From 6ffc847382ab07c596d00b06e6ca04b6a27dea0e Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 9 Aug 2025 17:28:57 +0800 Subject: [PATCH] Update test for Config struct to clarify feature computation timing - Modified the test case for UnmarshalJSON in config_test.go to specify that features are not computed during the unmarshalling process but rather after providers are loaded. - Added comments to explain the manual computation of features for testing purposes, ensuring clarity in the test logic. --- kb/types/config_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kb/types/config_test.go b/kb/types/config_test.go index 35acf616..8f92af53 100644 --- a/kb/types/config_test.go +++ b/kb/types/config_test.go @@ -164,7 +164,13 @@ func TestConfig_UnmarshalJSON(t *testing.T) { t.Errorf("Expected vector driver 'qdrant', got '%s'", config.Vector.Driver) } - // Verify Features are computed automatically + // Verify that Features are not computed during UnmarshalJSON (they should be computed later) + // Features will be computed after providers are loaded in the actual Load function + + // But we can manually compute features to test the logic + config.Features = config.ComputeFeatures() + + // These should be true based on the config content (graph, pdf, ffmpeg are present) if !config.Features.GraphDatabase { t.Error("Expected GraphDatabase feature to be true") }