diff --git a/checks/raw/binary_artifact.go b/checks/raw/binary_artifact.go index 8c0c7ee0052..77e8bf999d1 100644 --- a/checks/raw/binary_artifact.go +++ b/checks/raw/binary_artifact.go @@ -107,7 +107,6 @@ var checkBinaryFileContent fileparser.DoWhileTrueOnFileContent = func(path strin }) } - fmt.Println(*pfiles) return true, nil } diff --git a/e2e/binary_artifacts_test.go b/e2e/binary_artifacts_test.go index 495d61d14f1..fd66deba31e 100644 --- a/e2e/binary_artifacts_test.go +++ b/e2e/binary_artifacts_test.go @@ -76,10 +76,11 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() { Dlogger: &dl, } // TODO: upload real binaries to the repo as well. + // There are 24 dummy binaries that are ignoreed because they only contain ASCII characters. expected := scut.TestReturn{ Error: nil, - Score: checker.MinResultScore, - NumberOfWarn: 25, + Score: checker.MaxResultScore - 1, + NumberOfWarn: 1, NumberOfInfo: 0, NumberOfDebug: 0, } @@ -95,7 +96,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() { repo, err := githubrepo.MakeGithubRepo("ossf-tests/scorecard-check-binary-artifacts-e2e") Expect(err).Should(BeNil()) repoClient := githubrepo.CreateGithubRepoClient(context.Background(), logger) - err = repoClient.InitRepo(repo, "0c6e8991781bba24bfaaa0525f69329f672ef7b5") + err = repoClient.InitRepo(repo, "5b48dea88825662d67ed94b609b45cf7705333b6") Expect(err).Should(BeNil()) req := checker.CheckRequest{ @@ -105,10 +106,11 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() { Dlogger: &dl, } // TODO: upload real binaries to the repo as well. + // There are 24 dummy binaries that are ignoreed because they only contain ASCII characters. expected := scut.TestReturn{ Error: nil, - Score: checker.MinResultScore, - NumberOfWarn: 24, + Score: checker.MaxResultScore - 1, + NumberOfWarn: 1, NumberOfInfo: 0, NumberOfDebug: 0, } @@ -117,7 +119,7 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() { Expect(scut.ValidateTestReturn(nil, "binary artifacts", &expected, &result, &dl)).Should(BeTrue()) Expect(repoClient.Close()).Should(BeNil()) }) - It("Should return binary artifacts present in source code", func() { + It("Should return no binary artifacts present in source code", func() { dl := scut.TestDetailLogger{} repo, err := githubrepo.MakeGithubRepo("ossf-tests/scorecard-check-binary-artifacts-e2e-4-binaries") Expect(err).Should(BeNil()) @@ -132,10 +134,11 @@ var _ = Describe("E2E TEST:"+checks.CheckBinaryArtifacts, func() { Dlogger: &dl, } // TODO: upload real binaries to the repo as well. + // Existing binaries only contain SCII characters and are ignored. expected := scut.TestReturn{ Error: nil, - Score: checker.MaxResultScore - 4, - NumberOfWarn: 4, + Score: checker.MaxResultScore, + NumberOfWarn: 0, NumberOfInfo: 0, NumberOfDebug: 0, }