Added E2E test for score command covering all the NTIA cases.
Added a separate dir test/data which contains the sbom files. And these has been used for test. These files has been take from here.
Refractor score command functionalities.
I did this because earlier the name of the function and functionalities of that doesn't make a proper sense.
For wrting function wise test, it should return values. Currently the workflow or design of score command is forward way, that means it continue calling one after other function and at the end it prints out the result. Whereas now after making changes, we return the value and print the report at the starting it self. For more to understand this diagram will help:
To run these test as the Pull Request is made. This would help to identify that the changes made by contributor doesn't fails test. If test fails it ensure that the changes made by the contributor changed the core functionality, which shouldn't.
Add package wise test. To be more concise, add function wise test for each package.
Lastly, to add the codecov CI which will tell how much test it covers, and many more things.
closes: https://github.com/interlynk-io/sbomqs/issues/30
This PR brings following changes:
test/data
which contains the sbom files. And these has been used for test. These files has been take from here.FUTURE WORK:
Doing all these will fulfil the requirement of ScoreCard CI test.
More detail about changes:
ValidateFile
function covering below cases: This function validate all files and return files.HandlePaths
function: This function return all files retrieve from PathsGetDocsAndScore
function: This function returns docs, score, etc.