Skip to content

Move test code into a _test.go file#14

Merged
vanbroup merged 2 commits intodigitorus:masterfrom
rosstimothy:tross/testing
Jul 25, 2025
Merged

Move test code into a _test.go file#14
vanbroup merged 2 commits intodigitorus:masterfrom
rosstimothy:tross/testing

Conversation

@rosstimothy
Copy link
Copy Markdown

@rosstimothy rosstimothy commented Jul 24, 2025

The lack of a _test.go suffix on the dsa test prevents dead code elimination from removing the test file from builds. This results in testing symbols leaking into every downstream binary that depends on pkcs7 either directly or transitively. For an example see the following dependency tree.

goda tree "reach(github.com/sigstore/sigstore-go/pkg/tlog...:all, testing)"
  ├ github.com/sigstore/sigstore-go/pkg/tlog
    ├ github.com/sigstore/rekor/pkg/types/dsse/v0.0.1
      └ github.com/in-toto/in-toto-golang/in_toto
        └ github.com/secure-systems-lab/go-securesystemslib/signerverifier
    ├ github.com/sigstore/rekor/pkg/types/intoto/v0.0.2
      └ github.com/in-toto/in-toto-golang/in_toto ~
    └ github.com/sigstore/sigstore-go/pkg/root
      └ github.com/sigstore/timestamp-authority/pkg/verification
        ├ github.com/digitorus/pkcs7
        └ github.com/digitorus/timestamp
          └ github.com/digitorus/pkcs7 ~

The lack of a _test.go suffix on the dsa test prevents dead code
elimination from removing the test file from builds. This results
in testing symbols leaking into every downstream binary that
depends on pkcs7 either directly or transitively.
@rosstimothy rosstimothy marked this pull request as ready for review July 24, 2025 19:52
@rosstimothy
Copy link
Copy Markdown
Author

Hello! @vanbroup, I am a first time contributor to this project, I noticed that you have helped review previous PRs. Is this a PR that you would be able to help provide feedback on? Thank you!

@vanbroup vanbroup merged commit d7644b3 into digitorus:master Jul 25, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants