Skip to content

bug: Fix spdx Metadata Equality issue seen in e2e tests #178

@ashearin

Description

@ashearin

Export e2e tests uncovered a weird behavior in the testing environment, the spdx bom used in the export test is added to the cache via db.AddDocument and exported (to spdx format) to a file. the two files are then compared for equality, but fail on Meta data being different.

Some things are expected, like date will always be different, which easily handled, but the ID, tools and author being different needs more investigation.

Exported Document
# id:"https://spdx.org/spdxdocs/#DOCUMENT" version:"0" name:"bomctl_0.3.0_linux_amd64.tar.gz" date:{seconds:1727723887} tools:{name:"protobom-devel"} tools:{name:"syft-1.9.0"}
Original Document
# id:"https://anchore.com/syft/file/bomctl_0.3.0_linux_amd64.tar.gz-1b838d44-9d3c-47d0-9f7f-846397e701fa#DOCUMENT" version:"0" name:"bomctl_0.3.0_linux_amd64.tar.gz" date:{seconds:1723065476} tools:{name:"syft-1.9.0"} authors:{name:"Anchore, Inc" is_org:true}

The task here is to investigate and fix issue if it resides in bomctl, otherwise create an issue with supporting documentation and evidence in protobom to have it investigated there.

Also update the compare_documents to compare each field individually, and ignore expected differences , like date. If resolved within bomctl, uncomment e2e test checks for document equality.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions