Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Included Tests for memory.go LoadEnvelope and Search #59

Merged
merged 8 commits into from
Jan 22, 2024

Conversation

neilnaveen
Copy link
Contributor

@neilnaveen neilnaveen commented Oct 25, 2023

  • Included tests for LoadEnvelope
  • Included tests for Search

@neilnaveen neilnaveen force-pushed the neil/memory-test branch 2 times, most recently from 6de8947 to 2c162e3 Compare October 26, 2023 16:27
@neilnaveen neilnaveen changed the title Included Tests for memory.go LoadEnvelope Included Tests for memory.go LoadEnvelope and Search Oct 29, 2023
- Included tests for LoadEnvelope

Signed-off-by: neilnaveen <[email protected]>
- Fixed lint issues
- Renamed test function to TestLoadEnvelope

Signed-off-by: neilnaveen <[email protected]>
- Included test for search function
- Cleaned up test for LoadEnvelope

Signed-off-by: neilnaveen <[email protected]>
intotoStatment: intoto.Statement{
Type: "https://in-toto.io/Statement/v0.1",
Subject: []intoto.Subject{{Name: "example", Digest: map[string]string{"sha256": "exampledigest"}}},
PredicateType: "https://slsa.dev/provenance/v0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is the predicate type we should be setting

mSource: NewMemorySource(),
},
{
name: "Empty Invalid intotoStatment",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that an empty in-toto statement has been provided, but maybe thinking "Invalid" in the test name might not be necessary. A bit of a nit though.

{
Type: "1",
Subject: []intoto.Subject{{Name: "example1", Digest: map[string]string{"a": "exampledigest", "b": "exampledigest2", "c": "exampledigest3"}}},
PredicateType: "https://slsa.dev/provenance/v0.2",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again I think the Predicate Type here is incorrect.

@ChaosInTheCRD
Copy link
Collaborator

Hi @neilnaveen! Thank you so much for taking the time to add these tests, they're very valuable 😄.

Hopefully you can see through the barrage of suggestions, most of them are little suggestions so they shouldn't take any time to review and address.

With the exception of the changes that I have outlined, I don't see why we couldn't approve and merge this work for now. For context @neilnaveen we are going to be working over the next couple of months on improving the tests within this repository and https://github.com/in-toto/witness, and this helps us move forward in that regard.

@ChaosInTheCRD ChaosInTheCRD merged commit 3e7ddcc into in-toto:main Jan 22, 2024
10 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