debug windows env
This commit is contained in:
parent
b423edff7b
commit
4b1108734c
2 changed files with 24 additions and 1 deletions
2
.github/workflows/go.yml
vendored
2
.github/workflows/go.yml
vendored
|
|
@ -25,6 +25,6 @@ jobs:
|
|||
run: go mod download
|
||||
|
||||
- name: Run unit and integration tests
|
||||
run: go test -v ./pkg/cmd/release/verify-asset/...
|
||||
run: go test -v ./pkg/cmd/release/verify-asset ./pkg/cmd/attestation/artifact
|
||||
- name: Build
|
||||
run: go build -v ./cmd/gh
|
||||
|
|
|
|||
23
pkg/cmd/attestation/artifact/file_test.go
Normal file
23
pkg/cmd/attestation/artifact/file_test.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package artifact
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cli/cli/v2/pkg/cmd/attestation/test"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_digestLocalFileArtifact_withRealZip(t *testing.T) {
|
||||
// Path to the test artifact
|
||||
artifactPath := test.NormalizeRelativePath("../../attestation/test/data/github_release_artifact.zip")
|
||||
|
||||
// Calculate expected digest using the same algorithm as the function under test
|
||||
expectedDigest := "f7165848f9f5ddc578d7adbd1f566a394169385c73bd88bf60df7e759db8e08d"
|
||||
|
||||
// Call the function under test
|
||||
artifact, err := digestLocalFileArtifact(artifactPath, "sha256")
|
||||
require.NoError(t, err)
|
||||
require.Equal(t, "file://"+artifactPath, artifact.URL)
|
||||
require.Equal(t, expectedDigest, artifact.digest)
|
||||
require.Equal(t, "sha256", artifact.digestAlg)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue