Projects STRLCPY scorecard Commits 603263cd
🤬
  • ■ ■ ■ ■
    checks/ci_tests.go
    skipped 39 lines
    40 40   rawData, err := raw.CITests(c.RepoClient)
    41 41   if err != nil {
    42 42   e := sce.WithMessage(sce.ErrScorecardInternal, err.Error())
    43  - return checker.CreateRuntimeErrorResult(CheckCodeReview, e)
     43 + return checker.CreateRuntimeErrorResult(CheckCITests, e)
    44 44   }
    45 45   
    46 46   // Return raw results.
    skipped 8 lines
  • ■ ■ ■ ■ ■ ■
    checks/ci_tests_test.go
     1 +// Copyright 2023 OpenSSF Scorecard Authors
     2 +//
     3 +// Licensed under the Apache License, Version 2.0 (the "License");
     4 +// you may not use this file except in compliance with the License.
     5 +// You may obtain a copy of the License at
     6 +//
     7 +// http://www.apache.org/licenses/LICENSE-2.0
     8 +//
     9 +// Unless required by applicable law or agreed to in writing, software
     10 +// distributed under the License is distributed on an "AS IS" BASIS,
     11 +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 +// See the License for the specific language governing permissions and
     13 +// limitations under the License.
     14 + 
     15 +package checks
     16 + 
     17 +import (
     18 + "fmt"
     19 + "testing"
     20 + 
     21 + "github.com/golang/mock/gomock"
     22 + 
     23 + "github.com/ossf/scorecard/v4/checker"
     24 + mockrepo "github.com/ossf/scorecard/v4/clients/mockclients"
     25 +)
     26 + 
     27 +func TestCITestsRuntimeError(t *testing.T) {
     28 + t.Parallel()
     29 + 
     30 + ctrl := gomock.NewController(t)
     31 + mockRepoClient := mockrepo.NewMockRepoClient(ctrl)
     32 + //nolint:goerr113
     33 + mockRepoClient.EXPECT().ListCommits().Return(nil, fmt.Errorf("some runtime error")).AnyTimes()
     34 + 
     35 + req := checker.CheckRequest{
     36 + RepoClient: mockRepoClient,
     37 + }
     38 + res := CITests(&req)
     39 + 
     40 + want := "CI-Tests"
     41 + if res.Name != want {
     42 + t.Errorf("got: %q, want: %q", res.Name, want)
     43 + }
     44 + ctrl.Finish()
     45 +}
     46 + 
Please wait...
Page is in error, reload to recover