scorecard/e2e/config_test.go
Spencer Schrock 513c6ebbde
🌱 Add config e2e test and fix README (#4232)
* add config e2e test

Signed-off-by: Spencer Schrock <sschrock@google.com>

* update readme syntax

The old syntax was changed so the README was out of date.
This was exposed when setting up the e2e repo.

Signed-off-by: Spencer Schrock <sschrock@google.com>

* fix rename

Signed-off-by: Spencer Schrock <sschrock@google.com>

---------

Signed-off-by: Spencer Schrock <sschrock@google.com>
2024-07-10 12:52:03 -07:00

41 lines
1.3 KiB
Go

// Copyright 2024 OpenSSF Scorecard Authors
//
// Licensed 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 e2e
import (
"context"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/ossf/scorecard/v5/checks"
"github.com/ossf/scorecard/v5/clients/githubrepo"
"github.com/ossf/scorecard/v5/pkg/scorecard"
)
var _ = Describe("E2E TEST: config parsing", func() {
Context("E2E TEST:Valid config parsing", func() {
It("Should return an annotation from the config", func() {
repo, err := githubrepo.MakeGithubRepo("ossf-tests/scorecard-config-e2e")
Expect(err).Should(BeNil())
results, err := scorecard.Run(context.Background(), repo,
scorecard.WithChecks([]string{checks.CheckCodeReview}),
)
Expect(err).Should(BeNil())
Expect(len(results.Config.Annotations)).Should(BeNumerically(">=", 1))
})
})
})