This is an automated email from the ASF dual-hosted git repository. LinkinStars pushed a commit to branch dev in repository https://gitbox.apache.org/repos/asf/answer.git
commit 7af928cb99526505d88e3353c995f13fa12c2267 Author: seiya <[email protected]> AuthorDate: Thu Oct 15 13:15:56 2026 +0000 Revert "test: expose swallowed similar question lookup error" This reverts commit c4dd09b56a88292d2fae75ed1aa6736ecedfff0a. --- internal/service/content/question_service_test.go | 53 ----------------------- 1 file changed, 53 deletions(-) diff --git a/internal/service/content/question_service_test.go b/internal/service/content/question_service_test.go deleted file mode 100644 index d688c48f..00000000 --- a/internal/service/content/question_service_test.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package content - -import ( - "context" - "errors" - "testing" - - "github.com/apache/answer/internal/entity" - questioncommon "github.com/apache/answer/internal/service/question_common" -) - -type similarQuestionErrorRepo struct { - questioncommon.QuestionRepo - err error -} - -func (r *similarQuestionErrorRepo) GetQuestion(context.Context, string) (*entity.Question, bool, error) { - return nil, false, r.err -} - -func TestSimilarQuestionPropagatesInfoError(t *testing.T) { - wantErr := errors.New("question lookup failed") - repo := &similarQuestionErrorRepo{err: wantErr} - service := &QuestionService{ - questioncommon: questioncommon.NewQuestionCommon( - repo, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, - ), - } - - _, _, err := service.SimilarQuestion(context.Background(), "1", "viewer") - if !errors.Is(err, wantErr) { - t.Fatalf("SimilarQuestion() error = %v, want %v", err, wantErr) - } -}
