Merge pull request #1293 from trheyi/main

Refactor logging in model tests for consistency
This commit is contained in:
Max 2025-11-11 16:42:25 +08:00 committed by GitHub
commit 89c72fc07d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -77,7 +77,7 @@ func TestListModels(t *testing.T) {
// Verify model ID format: connector-model-assistantName-yao_assistantID // Verify model ID format: connector-model-assistantName-yao_assistantID
assert.Contains(t, firstModel.ID, "-yao_", "Model ID should contain '-yao_' prefix") assert.Contains(t, firstModel.ID, "-yao_", "Model ID should contain '-yao_' prefix")
t.Logf("First model: ID=%s, Created=%d, OwnedBy=%s", t.Logf("First model: ID=%s, Created=%d, OwnedBy=%s",
firstModel.ID, firstModel.Created, firstModel.OwnedBy) firstModel.ID, firstModel.Created, firstModel.OwnedBy)
} else { } else {
t.Log("No models returned (this is OK if no assistants exist)") t.Log("No models returned (this is OK if no assistants exist)")
@ -206,7 +206,7 @@ func TestGetModelDetails(t *testing.T) {
// Note: Created timestamp may be 0 or negative for legacy data, newly created assistants will have proper timestamps // Note: Created timestamp may be 0 or negative for legacy data, newly created assistants will have proper timestamps
assert.NotEmpty(t, model.OwnedBy, "Model should have owner") assert.NotEmpty(t, model.OwnedBy, "Model should have owner")
t.Logf("Model details: ID=%s, Created=%d, OwnedBy=%s", t.Logf("Model details: ID=%s, Created=%d, OwnedBy=%s",
model.ID, model.Created, model.OwnedBy) model.ID, model.Created, model.OwnedBy)
}) })
@ -322,9 +322,9 @@ func TestModelIDFormat(t *testing.T) {
assistantID := parts[1] assistantID := parts[1]
// Verify prefix has at least: connector-model // Verify prefix has at least: connector-model
assert.True(t, strings.Contains(prefix, "-"), assert.True(t, strings.Contains(prefix, "-"),
"Model ID prefix should contain connector-model parts") "Model ID prefix should contain connector-model parts")
// Verify assistant ID is not empty // Verify assistant ID is not empty
assert.NotEmpty(t, assistantID, "Assistant ID should not be empty") assert.NotEmpty(t, assistantID, "Assistant ID should not be empty")
@ -424,4 +424,3 @@ func TestModelPermissions(t *testing.T) {
t.Log("Permission-based filtering is working") t.Log("Permission-based filtering is working")
}) })
} }