Skip to content

Commit

Permalink
Merge branch 'main' into avbalter/support-nuget-package-manager
Browse files Browse the repository at this point in the history
  • Loading branch information
spencerschrock committed Jun 15, 2023
2 parents 94860aa + f928748 commit aad8ef0
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
fetch-depth: 2 # needed to diff changed files
- id: files
name: Get changed files
uses: tj-actions/changed-files@fb20f4d24890fadc539505b1746d260504b213d0 #v36.1.0
uses: tj-actions/changed-files@c9124514c375de5dbb9697afa6f2e36a236ee58c #v36.2.1
with:
files_ignore: '**.md'
- id: docs_only_check
Expand Down
60 changes: 60 additions & 0 deletions clients/githubrepo/releases_e2e_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// Copyright 2023 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 githubrepo

import (
"context"
"net/http"

"github.com/google/go-github/v38/github"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"

"github.com/ossf/scorecard/v4/clients"
"github.com/ossf/scorecard/v4/clients/githubrepo/roundtripper"
"github.com/ossf/scorecard/v4/log"
)

var _ = Describe("E2E TEST: githubrepo.releasesHandler", func() {
var releaseHandler *releasesHandler

BeforeEach(func() {
ctx := context.Background()
rt := roundtripper.NewTransport(context.Background(), &log.Logger{})
httpClient := &http.Client{
Transport: rt,
}
client := github.NewClient(httpClient)
releaseHandler = &releasesHandler{
client: client,
ctx: ctx,
}
})
Context("getReleases()", func() {
It("returns releases", func() {
repoURL := repoURL{
owner: "ossf",
repo: "scorecard",
commitSHA: clients.HeadSHA,
}

releaseHandler.init(context.Background(), &repoURL)
resp, err := releaseHandler.getReleases()
Expect(err).NotTo(HaveOccurred())
Expect(len(resp)).ShouldNot(Equal(0))
Expect(releaseHandler.errSetup).Should(BeNil())
})
})
})

0 comments on commit aad8ef0

Please sign in to comment.