|
| 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 e2e |
| 16 | + |
| 17 | +import ( |
| 18 | + "context" |
| 19 | + |
| 20 | + . "github.com/onsi/ginkgo/v2" |
| 21 | + . "github.com/onsi/gomega" |
| 22 | + |
| 23 | + "github.com/ossf/scorecard/v4/clients" |
| 24 | + "github.com/ossf/scorecard/v4/clients/githubrepo" |
| 25 | +) |
| 26 | + |
| 27 | +var _ = Describe("E2E TEST:WorkflowRun", func() { |
| 28 | + Context("E2E TEST:WorkflowRun", func() { |
| 29 | + It("Should return scorecard analysis workflow run", func() { |
| 30 | + // using the scorecard repo as an example. The tests repo workflow won't have any runs in the future and |
| 31 | + // that is why we are using the scorecard repo. |
| 32 | + repo, err := githubrepo.MakeGithubRepo("ossf/scorecard") |
| 33 | + Expect(err).Should(BeNil()) |
| 34 | + repoClient := githubrepo.CreateGithubRepoClient(context.Background(), logger) |
| 35 | + err = repoClient.InitRepo(repo, clients.HeadSHA, 0) |
| 36 | + Expect(err).Should(BeNil()) |
| 37 | + runs, err := repoClient.ListSuccessfulWorkflowRuns("scorecard-analysis.yml") |
| 38 | + Expect(err).Should(BeNil()) |
| 39 | + Expect(len(runs)).Should(BeNumerically(">", 0)) |
| 40 | + }) |
| 41 | + }) |
| 42 | +}) |
0 commit comments