From de8778797f85e9db7cca3bfca3bb9e11cd07b141 Mon Sep 17 00:00:00 2001 From: Meredith Lancaster Date: Tue, 8 Apr 2025 19:09:52 -0600 Subject: [PATCH] temporarily skip non-failing tests Signed-off-by: Meredith Lancaster --- pkg/cmd/attestation/api/client_test.go | 18 ++++++++++++++++++ .../artifact/artifact_posix_test.go | 1 + .../artifact/artifact_windows_test.go | 1 + .../attestation/artifact/digest/digest_test.go | 2 ++ pkg/cmd/attestation/artifact/image_test.go | 3 +++ .../attestation/artifact/oci/client_test.go | 4 ++++ pkg/cmd/attestation/auth/host_test.go | 1 + pkg/cmd/attestation/download/download_test.go | 2 ++ pkg/cmd/attestation/download/metadata_test.go | 1 + pkg/cmd/attestation/download/options_test.go | 1 + pkg/cmd/attestation/inspect/bundle_test.go | 2 ++ pkg/cmd/attestation/inspect/inspect_test.go | 3 +++ .../trustedroot/trustedroot_test.go | 3 +++ .../verification/attestation_test.go | 5 +++++ .../verification/extensions_test.go | 1 + pkg/cmd/attestation/verification/tuf_test.go | 1 + pkg/cmd/attestation/verify/options_test.go | 1 + pkg/cmd/attestation/verify/policy_test.go | 1 + .../verify/verify_integration_test.go | 4 ++++ pkg/cmd/attestation/verify/verify_test.go | 4 ++++ 20 files changed, 59 insertions(+) diff --git a/pkg/cmd/attestation/api/client_test.go b/pkg/cmd/attestation/api/client_test.go index 787408a4e..0e0827295 100644 --- a/pkg/cmd/attestation/api/client_test.go +++ b/pkg/cmd/attestation/api/client_test.go @@ -43,6 +43,7 @@ func NewClientWithMockGHClient(hasNextPage bool) Client { } func TestGetByDigest(t *testing.T) { + t.Skip() c := NewClientWithMockGHClient(false) attestations, err := c.GetByRepoAndDigest(testRepo, testDigest, DefaultLimit) require.NoError(t, err) @@ -60,6 +61,7 @@ func TestGetByDigest(t *testing.T) { } func TestGetByDigestGreaterThanLimit(t *testing.T) { + t.Skip() c := NewClientWithMockGHClient(false) limit := 3 @@ -80,6 +82,7 @@ func TestGetByDigestGreaterThanLimit(t *testing.T) { } func TestGetByDigestWithNextPage(t *testing.T) { + t.Skip() c := NewClientWithMockGHClient(true) attestations, err := c.GetByRepoAndDigest(testRepo, testDigest, DefaultLimit) require.NoError(t, err) @@ -97,6 +100,7 @@ func TestGetByDigestWithNextPage(t *testing.T) { } func TestGetByDigestGreaterThanLimitWithNextPage(t *testing.T) { + t.Skip() c := NewClientWithMockGHClient(true) limit := 7 @@ -117,6 +121,7 @@ func TestGetByDigestGreaterThanLimitWithNextPage(t *testing.T) { } func TestGetByDigest_NoAttestationsFound(t *testing.T) { + t.Skip() fetcher := mockDataGenerator{ NumAttestations: 5, } @@ -142,6 +147,7 @@ func TestGetByDigest_NoAttestationsFound(t *testing.T) { } func TestGetByDigest_Error(t *testing.T) { + t.Skip() fetcher := mockDataGenerator{ NumAttestations: 5, } @@ -163,6 +169,7 @@ func TestGetByDigest_Error(t *testing.T) { } func TestFetchBundleFromAttestations_BundleURL(t *testing.T) { + t.Skip() httpClient := &mockHttpClient{} client := LiveClient{ httpClient: httpClient, @@ -180,6 +187,7 @@ func TestFetchBundleFromAttestations_BundleURL(t *testing.T) { } func TestFetchBundleFromAttestations_MissingBundleAndBundleURLFields(t *testing.T) { + t.Skip() httpClient := &mockHttpClient{} client := LiveClient{ httpClient: httpClient, @@ -196,6 +204,7 @@ func TestFetchBundleFromAttestations_MissingBundleAndBundleURLFields(t *testing. } func TestFetchBundleFromAttestations_FailOnTheSecondAttestation(t *testing.T) { + t.Skip() mockHTTPClient := &failAfterNCallsHttpClient{ // the initial HTTP request will succeed, which returns a bundle for the first attestation // all following HTTP requests will fail, which means the function fails to fetch a bundle @@ -218,6 +227,7 @@ func TestFetchBundleFromAttestations_FailOnTheSecondAttestation(t *testing.T) { } func TestFetchBundleFromAttestations_FailAfterRetrying(t *testing.T) { + t.Skip() mockHTTPClient := &reqFailHttpClient{} c := &LiveClient{ @@ -234,6 +244,7 @@ func TestFetchBundleFromAttestations_FailAfterRetrying(t *testing.T) { } func TestFetchBundleFromAttestations_FallbackToBundleField(t *testing.T) { + t.Skip() mockHTTPClient := &mockHttpClient{} c := &LiveClient{ @@ -252,6 +263,7 @@ func TestFetchBundleFromAttestations_FallbackToBundleField(t *testing.T) { // getBundle successfully fetches a bundle on the first HTTP request attempt func TestGetBundle(t *testing.T) { + t.Skip() mockHTTPClient := &mockHttpClient{} c := &LiveClient{ @@ -268,6 +280,7 @@ func TestGetBundle(t *testing.T) { // getBundle retries successfully when the initial HTTP request returns // a 5XX status code func TestGetBundle_SuccessfulRetry(t *testing.T) { + t.Skip() mockHTTPClient := &failAfterNCallsHttpClient{ FailOnCallN: 1, FailOnAllSubsequentCalls: false, @@ -286,6 +299,7 @@ func TestGetBundle_SuccessfulRetry(t *testing.T) { // getBundle does not retry when the function fails with a permanent backoff error condition func TestGetBundle_PermanentBackoffFail(t *testing.T) { + t.Skip() mockHTTPClient := &invalidBundleClient{} c := &LiveClient{ httpClient: mockHTTPClient, @@ -302,6 +316,7 @@ func TestGetBundle_PermanentBackoffFail(t *testing.T) { // getBundle retries when the HTTP request fails func TestGetBundle_RequestFail(t *testing.T) { + t.Skip() mockHTTPClient := &reqFailHttpClient{} c := &LiveClient{ @@ -316,6 +331,7 @@ func TestGetBundle_RequestFail(t *testing.T) { } func TestGetTrustDomain(t *testing.T) { + t.Skip() fetcher := mockMetaGenerator{ TrustDomain: "foo", } @@ -348,6 +364,7 @@ func TestGetTrustDomain(t *testing.T) { } func TestGetAttestationsRetries(t *testing.T) { + t.Skip() getAttestationRetryInterval = 0 fetcher := mockDataGenerator{ @@ -388,6 +405,7 @@ func TestGetAttestationsRetries(t *testing.T) { // test total retries func TestGetAttestationsMaxRetries(t *testing.T) { + t.Skip() getAttestationRetryInterval = 0 fetcher := mockDataGenerator{ diff --git a/pkg/cmd/attestation/artifact/artifact_posix_test.go b/pkg/cmd/attestation/artifact/artifact_posix_test.go index 31e9cb7e7..2fca69cbb 100644 --- a/pkg/cmd/attestation/artifact/artifact_posix_test.go +++ b/pkg/cmd/attestation/artifact/artifact_posix_test.go @@ -10,6 +10,7 @@ import ( ) func TestNormalizeReference(t *testing.T) { + t.Skip() testCases := []struct { name string reference string diff --git a/pkg/cmd/attestation/artifact/artifact_windows_test.go b/pkg/cmd/attestation/artifact/artifact_windows_test.go index 46995f226..4648be0a5 100644 --- a/pkg/cmd/attestation/artifact/artifact_windows_test.go +++ b/pkg/cmd/attestation/artifact/artifact_windows_test.go @@ -10,6 +10,7 @@ import ( ) func TestNormalizeReference(t *testing.T) { + t.Skip() testCases := []struct { name string reference string diff --git a/pkg/cmd/attestation/artifact/digest/digest_test.go b/pkg/cmd/attestation/artifact/digest/digest_test.go index bcfd2c1ac..2fb7727f5 100644 --- a/pkg/cmd/attestation/artifact/digest/digest_test.go +++ b/pkg/cmd/attestation/artifact/digest/digest_test.go @@ -9,6 +9,7 @@ import ( ) func TestArtifactDigestWithAlgorithm(t *testing.T) { + t.Skip() testString := "deadbeef" sha512TestDigest := "113a3bc783d851fc0373214b19ea7be9fa3de541ecb9fe026d52c603e8ea19c174cc0e9705f8b90d312212c0c3a6d8453ddfb3e3141409cf4bedc8ef033590b4" sha256TestDigest := "2baf1f40105d9501fe319a8ec463fdf4325a2a5df445adf3f572f626253678c9" @@ -36,6 +37,7 @@ func TestArtifactDigestWithAlgorithm(t *testing.T) { } func TestValidDigestAlgorithms(t *testing.T) { + t.Skip() t.Run("includes sha256", func(t *testing.T) { assert.Contains(t, ValidDigestAlgorithms(), "sha256") }) diff --git a/pkg/cmd/attestation/artifact/image_test.go b/pkg/cmd/attestation/artifact/image_test.go index 5ea5f9a37..ad0c1f406 100644 --- a/pkg/cmd/attestation/artifact/image_test.go +++ b/pkg/cmd/attestation/artifact/image_test.go @@ -9,6 +9,7 @@ import ( ) func TestDigestContainerImageArtifact(t *testing.T) { + t.Skip() expectedDigest := "1234567890abcdef" client := oci.MockClient{} url := "example.com/repo:tag" @@ -20,6 +21,7 @@ func TestDigestContainerImageArtifact(t *testing.T) { } func TestParseImageRefFailure(t *testing.T) { + t.Skip() client := oci.ReferenceFailClient{} url := "example.com/repo:tag" _, err := digestContainerImageArtifact(url, client) @@ -27,6 +29,7 @@ func TestParseImageRefFailure(t *testing.T) { } func TestFetchImageFailure(t *testing.T) { + t.Skip() testcase := []struct { name string client oci.Client diff --git a/pkg/cmd/attestation/artifact/oci/client_test.go b/pkg/cmd/attestation/artifact/oci/client_test.go index a46533366..73cf9b42d 100644 --- a/pkg/cmd/attestation/artifact/oci/client_test.go +++ b/pkg/cmd/attestation/artifact/oci/client_test.go @@ -13,6 +13,7 @@ import ( ) func TestGetImageDigest_Success(t *testing.T) { + t.Skip() expectedDigest := v1.Hash{ Hex: "1234567890abcdef", Algorithm: "sha256", @@ -37,6 +38,7 @@ func TestGetImageDigest_Success(t *testing.T) { } func TestGetImageDigest_ReferenceFail(t *testing.T) { + t.Skip() c := LiveClient{ parseReference: func(string, ...name.Option) (name.Reference, error) { return nil, fmt.Errorf("failed to parse reference") @@ -53,6 +55,7 @@ func TestGetImageDigest_ReferenceFail(t *testing.T) { } func TestGetImageDigest_AuthFail(t *testing.T) { + t.Skip() c := LiveClient{ parseReference: func(string, ...name.Option) (name.Reference, error) { return name.Tag{}, nil @@ -70,6 +73,7 @@ func TestGetImageDigest_AuthFail(t *testing.T) { } func TestGetImageDigest_Denied(t *testing.T) { + t.Skip() c := LiveClient{ parseReference: func(string, ...name.Option) (name.Reference, error) { return name.Tag{}, nil diff --git a/pkg/cmd/attestation/auth/host_test.go b/pkg/cmd/attestation/auth/host_test.go index 5d905bd04..88f1da09b 100644 --- a/pkg/cmd/attestation/auth/host_test.go +++ b/pkg/cmd/attestation/auth/host_test.go @@ -9,6 +9,7 @@ import ( ) func TestIsHostSupported(t *testing.T) { + t.Skip() testcases := []struct { name string expectedErr bool diff --git a/pkg/cmd/attestation/download/download_test.go b/pkg/cmd/attestation/download/download_test.go index ddcd08c92..4bdfb4e25 100644 --- a/pkg/cmd/attestation/download/download_test.go +++ b/pkg/cmd/attestation/download/download_test.go @@ -35,6 +35,7 @@ func expectedFilePath(tempDir string, digestWithAlg string) string { } func TestNewDownloadCmd(t *testing.T) { + t.Skip() testIO, _, _, _ := iostreams.Test() f := &cmdutil.Factory{ IOStreams: testIO, @@ -190,6 +191,7 @@ func TestNewDownloadCmd(t *testing.T) { } func TestRunDownload(t *testing.T) { + t.Skip() tempDir := t.TempDir() store := &LiveStore{ outputPath: tempDir, diff --git a/pkg/cmd/attestation/download/metadata_test.go b/pkg/cmd/attestation/download/metadata_test.go index 2596e2377..6f9c868c8 100644 --- a/pkg/cmd/attestation/download/metadata_test.go +++ b/pkg/cmd/attestation/download/metadata_test.go @@ -28,6 +28,7 @@ func OnCreateMetadataFileFailure(artifactDigest string, attestationsResp []*api. } func TestCreateJSONLinesFilePath(t *testing.T) { + t.Skip() tempDir := t.TempDir() artifact, err := artifact.NewDigestedArtifact(oci.MockClient{}, "../test/data/sigstore-js-2.1.0.tgz", "sha512") require.NoError(t, err) diff --git a/pkg/cmd/attestation/download/options_test.go b/pkg/cmd/attestation/download/options_test.go index 800691d79..fa6814838 100644 --- a/pkg/cmd/attestation/download/options_test.go +++ b/pkg/cmd/attestation/download/options_test.go @@ -8,6 +8,7 @@ import ( ) func TestAreFlagsValid(t *testing.T) { + t.Skip() tests := []struct { name string limit int diff --git a/pkg/cmd/attestation/inspect/bundle_test.go b/pkg/cmd/attestation/inspect/bundle_test.go index 61b8d7bfc..c37613831 100644 --- a/pkg/cmd/attestation/inspect/bundle_test.go +++ b/pkg/cmd/attestation/inspect/bundle_test.go @@ -10,6 +10,7 @@ import ( ) func TestGetOrgAndRepo(t *testing.T) { + t.Skip() t.Run("with valid source URL", func(t *testing.T) { sourceURL := "https://github.com/github/gh-attestation" org, repo, err := getOrgAndRepo("", sourceURL) @@ -36,6 +37,7 @@ func TestGetOrgAndRepo(t *testing.T) { } func TestGetAttestationDetail(t *testing.T) { + t.Skip() bundlePath := test.NormalizeRelativePath("../test/data/sigstore-js-2.1.0-bundle.json") attestations, err := verification.GetLocalAttestations(bundlePath) diff --git a/pkg/cmd/attestation/inspect/inspect_test.go b/pkg/cmd/attestation/inspect/inspect_test.go index 1e0c1305e..0f9da0396 100644 --- a/pkg/cmd/attestation/inspect/inspect_test.go +++ b/pkg/cmd/attestation/inspect/inspect_test.go @@ -31,6 +31,7 @@ var ( ) func TestNewInspectCmd(t *testing.T) { + t.Skip() testIO, _, _, _ := iostreams.Test() f := &cmdutil.Factory{ IOStreams: testIO, @@ -88,6 +89,7 @@ func TestNewInspectCmd(t *testing.T) { } func TestRunInspect(t *testing.T) { + t.Skip() opts := Options{ BundlePath: bundlePath, Logger: io.NewTestHandler(), @@ -113,6 +115,7 @@ func TestRunInspect(t *testing.T) { } func TestJSONOutput(t *testing.T) { + t.Skip() testIO, _, out, _ := iostreams.Test() opts := Options{ BundlePath: bundlePath, diff --git a/pkg/cmd/attestation/trustedroot/trustedroot_test.go b/pkg/cmd/attestation/trustedroot/trustedroot_test.go index c4a259436..5ad4e5131 100644 --- a/pkg/cmd/attestation/trustedroot/trustedroot_test.go +++ b/pkg/cmd/attestation/trustedroot/trustedroot_test.go @@ -22,6 +22,7 @@ import ( ) func TestNewTrustedRootCmd(t *testing.T) { + t.Skip() testIO, _, _, _ := iostreams.Test() f := &cmdutil.Factory{ IOStreams: testIO, @@ -82,6 +83,7 @@ func TestNewTrustedRootCmd(t *testing.T) { } func TestNewTrustedRootWithTenancy(t *testing.T) { + t.Skip() testIO, _, _, _ := iostreams.Test() var testReg httpmock.Registry var metaResp = api.MetaResponse{ @@ -163,6 +165,7 @@ var newTUFErrClient tufClientInstantiator = func(o *tuf.Options) (*tuf.Client, e } func TestGetTrustedRoot(t *testing.T) { + t.Skip() mirror := "https://tuf-repo.github.com" root := test.NormalizeRelativePath("../verification/embed/tuf-repo.github.com/root.json") diff --git a/pkg/cmd/attestation/verification/attestation_test.go b/pkg/cmd/attestation/verification/attestation_test.go index 8acff0c37..166339bca 100644 --- a/pkg/cmd/attestation/verification/attestation_test.go +++ b/pkg/cmd/attestation/verification/attestation_test.go @@ -14,6 +14,7 @@ import ( ) func TestLoadBundlesFromJSONLinesFile(t *testing.T) { + t.Skip() t.Run("with original file", func(t *testing.T) { path := "../test/data/sigstore-js-2.1.0_with_2_bundles.jsonl" attestations, err := loadBundlesFromJSONLinesFile(path) @@ -43,6 +44,7 @@ func TestLoadBundlesFromJSONLinesFile(t *testing.T) { } func TestLoadBundlesFromJSONLinesFile_RejectEmptyJSONLFile(t *testing.T) { + t.Skip() // Create a temporary file emptyJSONL, err := os.CreateTemp("", "empty.jsonl") require.NoError(t, err) @@ -56,6 +58,7 @@ func TestLoadBundlesFromJSONLinesFile_RejectEmptyJSONLFile(t *testing.T) { } func TestLoadBundleFromJSONFile(t *testing.T) { + t.Skip() path := "../test/data/sigstore-js-2.1.0-bundle.json" attestations, err := loadBundleFromJSONFile(path) @@ -64,6 +67,7 @@ func TestLoadBundleFromJSONFile(t *testing.T) { } func TestGetLocalAttestations(t *testing.T) { + t.Skip() t.Run("with JSON file containing one bundle", func(t *testing.T) { path := "../test/data/sigstore-js-2.1.0-bundle.json" attestations, err := GetLocalAttestations(path) @@ -118,6 +122,7 @@ func TestGetLocalAttestations(t *testing.T) { } func TestFilterAttestations(t *testing.T) { + t.Skip() attestations := []*api.Attestation{ { Bundle: &bundle.Bundle{ diff --git a/pkg/cmd/attestation/verification/extensions_test.go b/pkg/cmd/attestation/verification/extensions_test.go index 73d808119..2e9ea1745 100644 --- a/pkg/cmd/attestation/verification/extensions_test.go +++ b/pkg/cmd/attestation/verification/extensions_test.go @@ -25,6 +25,7 @@ func createSampleResult() *AttestationProcessingResult { } func TestVerifyCertExtensions(t *testing.T) { + t.Skip() results := []*AttestationProcessingResult{createSampleResult()} certSummary := certificate.Summary{} diff --git a/pkg/cmd/attestation/verification/tuf_test.go b/pkg/cmd/attestation/verification/tuf_test.go index e8b6ecf98..dc2b36bb6 100644 --- a/pkg/cmd/attestation/verification/tuf_test.go +++ b/pkg/cmd/attestation/verification/tuf_test.go @@ -11,6 +11,7 @@ import ( ) func TestGitHubTUFOptionsNoMetadataDir(t *testing.T) { + t.Skip() os.Setenv("CODESPACES", "true") opts := GitHubTUFOptions(o.None[string]()) diff --git a/pkg/cmd/attestation/verify/options_test.go b/pkg/cmd/attestation/verify/options_test.go index bdb851e7b..3f5a79065 100644 --- a/pkg/cmd/attestation/verify/options_test.go +++ b/pkg/cmd/attestation/verify/options_test.go @@ -23,6 +23,7 @@ var baseOptions = Options{ } func TestAreFlagsValid(t *testing.T) { + t.Skip() t.Run("has invalid Repo value", func(t *testing.T) { opts := baseOptions opts.Repo = "sigstoresigstore-js" diff --git a/pkg/cmd/attestation/verify/policy_test.go b/pkg/cmd/attestation/verify/policy_test.go index ff10cad11..719119083 100644 --- a/pkg/cmd/attestation/verify/policy_test.go +++ b/pkg/cmd/attestation/verify/policy_test.go @@ -9,6 +9,7 @@ import ( ) func TestNewEnforcementCriteria(t *testing.T) { + t.Skip() artifactPath := "../test/data/sigstore-js-2.1.0.tgz" t.Run("sets SANRegex and SAN using SANRegex and SAN", func(t *testing.T) { diff --git a/pkg/cmd/attestation/verify/verify_integration_test.go b/pkg/cmd/attestation/verify/verify_integration_test.go index 92864f78e..e6bdd1cc8 100644 --- a/pkg/cmd/attestation/verify/verify_integration_test.go +++ b/pkg/cmd/attestation/verify/verify_integration_test.go @@ -17,6 +17,7 @@ import ( ) func TestVerifyIntegration(t *testing.T) { + t.Skip() logger := io.NewTestHandler() sigstoreConfig := verification.SigstoreConfig{ @@ -130,6 +131,7 @@ func TestVerifyIntegration(t *testing.T) { } func TestVerifyIntegrationCustomIssuer(t *testing.T) { + t.Skip() artifactPath := test.NormalizeRelativePath("../test/data/custom-issuer-artifact") bundlePath := test.NormalizeRelativePath("../test/data/custom-issuer.sigstore.json") @@ -203,6 +205,7 @@ func TestVerifyIntegrationCustomIssuer(t *testing.T) { } func TestVerifyIntegrationReusableWorkflow(t *testing.T) { + t.Skip() artifactPath := test.NormalizeRelativePath("../test/data/reusable-workflow-artifact") bundlePath := test.NormalizeRelativePath("../test/data/reusable-workflow-attestation.sigstore.json") @@ -295,6 +298,7 @@ func TestVerifyIntegrationReusableWorkflow(t *testing.T) { } func TestVerifyIntegrationReusableWorkflowSignerWorkflow(t *testing.T) { + t.Skip() artifactPath := test.NormalizeRelativePath("../test/data/reusable-workflow-artifact") bundlePath := test.NormalizeRelativePath("../test/data/reusable-workflow-attestation.sigstore.json") diff --git a/pkg/cmd/attestation/verify/verify_test.go b/pkg/cmd/attestation/verify/verify_test.go index 092a009d8..40635c220 100644 --- a/pkg/cmd/attestation/verify/verify_test.go +++ b/pkg/cmd/attestation/verify/verify_test.go @@ -34,6 +34,7 @@ var ( ) func TestNewVerifyCmd(t *testing.T) { + t.Skip() testIO, _, _, _ := iostreams.Test() var testReg httpmock.Registry var metaResp = api.MetaResponse{ @@ -315,6 +316,7 @@ func TestNewVerifyCmd(t *testing.T) { } func TestVerifyCmdAuthChecks(t *testing.T) { + t.Skip() f := &cmdutil.Factory{} t.Run("by default auth check is required", func(t *testing.T) { @@ -345,6 +347,7 @@ func TestVerifyCmdAuthChecks(t *testing.T) { } func TestJSONOutput(t *testing.T) { + t.Skip() testIO, _, out, _ := iostreams.Test() opts := Options{ ArtifactPath: artifactPath, @@ -368,6 +371,7 @@ func TestJSONOutput(t *testing.T) { } func TestRunVerify(t *testing.T) { + t.Skip() logger := io.NewTestHandler() publicGoodOpts := Options{