Skip to content

Add tests for extractor#50

Open
IITI-tushar wants to merge 1 commit into
SBOMit:masterfrom
IITI-tushar:test-pkg-attestation-extractor
Open

Add tests for extractor#50
IITI-tushar wants to merge 1 commit into
SBOMit:masterfrom
IITI-tushar:test-pkg-attestation-extractor

Conversation

@IITI-tushar
Copy link
Copy Markdown

This pull request adds comprehensive unit tests for the ExtractorChain functionality in the pkg/attestation/extractor_test.go file. The new tests verify the registration and retrieval of extractors, supported types, registration of custom extractors, and the behavior of extracting files from attestations—including deduplication and filtering.

Key additions and improvements:

ExtractorChain registration and retrieval:

  • Adds tests to ensure that default extractors (material, command-run, product) are registered and retrievable, and that unknown types are not registered.
  • Adds a test to verify that custom extractors can be registered and retrieved as expected.

Supported types:

  • Adds a test to confirm that SupportedTypes() returns the expected set of extractor types.

File extraction behavior:

  • Adds tests for ExtractAll() to check deduplication of file paths, correct application of type filters, and correct invocation count of each extractor.

Signed-off-by: Tushar Saxena <019saxenatushar@gmail.com>
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.

1 participant