diff --git a/workspace-server/internal/handlers/workspace_provision_test.go b/workspace-server/internal/handlers/workspace_provision_test.go index bac1fbc1..b1f5f12e 100644 --- a/workspace-server/internal/handlers/workspace_provision_test.go +++ b/workspace-server/internal/handlers/workspace_provision_test.go @@ -570,7 +570,7 @@ func TestSeedInitialMemories_TruncatesOversizedContent(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - mock.ExpectExpectations() + mock.ExpectationsWereMet() workspaceID := "ws-trunc-" + tt.name content := strings.Repeat("X", tt.contentLen) memories := []models.MemorySeed{{Content: content, Scope: "LOCAL"}} @@ -624,7 +624,7 @@ func TestSeedInitialMemories_RedactsSecrets(t *testing.T) { // unrecognized scope value are silently skipped (not inserted). func TestSeedInitialMemories_InvalidScopeSkipped(t *testing.T) { mock := setupTestDB(t) - mock.ExpectExpectations() // no DB calls expected for invalid scope + mock.ExpectationsWereMet() // no DB calls expected for invalid scope memories := []models.MemorySeed{ {Content: "this should be skipped", Scope: "NOT_A_REAL_SCOPE"}, @@ -641,7 +641,7 @@ func TestSeedInitialMemories_InvalidScopeSkipped(t *testing.T) { // is handled without error (no DB calls). func TestSeedInitialMemories_EmptyMemoriesNil(t *testing.T) { mock := setupTestDB(t) - mock.ExpectExpectations() + mock.ExpectationsWereMet() seedInitialMemories(context.Background(), "ws-nil", nil, "test-ns") @@ -906,8 +906,6 @@ func containsStr(s, substr string) bool { // truncates content at maxMemoryContentLength before INSERT. Regression // test for the error-sanitization / memory-seed contract. func TestSeedInitialMemories_Truncation(t *testing.T) { - mock := setupTestDB(t) - largeContent := string(make([]byte, 100_001)) copy([]byte(largeContent), "X") // fill with "X" so test is deterministic @@ -1184,7 +1182,7 @@ func (m *mockEnvMutator) Run(_ context.Context, _ string, _ map[string]string) e return m.returnErr } -func (m *mockEnvMutator) Register(_ interface{}) {} +func (m *mockEnvMutator) Register(_ provisionhook.EnvMutator) {} // TestResolveAndStage_NoInternalErrorsInHTTPErr asserts that resolveAndStage // never puts err.Error() in HTTP error responses. Tests plugin source @@ -1263,6 +1261,8 @@ func (m *mockPluginsSources) Resolve(source plugins.Source) (plugins.SourceResol type mockResolver struct{} +func (*mockResolver) Scheme() string { return "" } + func (*mockResolver) Fetch(ctx context.Context, spec, destDir string) (string, error) { return "", nil }