Repository navigation
Tests: provide a way to generate a simple metadata set - #1915
Merged
jku merged 2 commits intoMar 23, 2022
Merged
Conversation
added 2 commits
March 22, 2022 16:42
A really specific bug occurred on CI runs on all Windows machines https://github.com/theupdateframework/python-tuf/runs/5467473050?check_suite_focus=true where we weren't able to verify that what was generated is the same as the stored on Git. After research with Jussi, we found out that the problem comes not from the content of the file that was generated, but because on Windows Git proactively replaced all line endings for text files with CRLF symbol ("\r") this made the locally stored JSON files different from the one generated. We want to make sure such bugs doesn't occur again and that's why we disable this behavior for all JSON files. Signed-off-by: Martin Vrachev <[email protected]>
I created a new script called "generate_md.py" which can be used to easily generate a repository. Additionally, I created a new test file making sure that the locally stored metadata files and the newly generated metadata roles are the same. This will allow us to test that we are not changing the metadata file structure when making changes. Signed-off-by: Martin Vrachev <[email protected]>
Collaborator
Author
|
@lukpueh because of a GitHub bug the new changes inside |
3 tasks
Pull Request Test Coverage Report for Build 2023507191
💛 - Coveralls |
jku
approved these changes
Mar 23, 2022
jku
left a comment
Member
There was a problem hiding this comment.
This looks a lot better and shorter, thanks!
- The key & signer handling could probably be better (why does the generator function need to construct the signers?) but there's no need to polish everything before we know what the code is going to be like...
- The error message could mention that new expected results should only be generated if the change in results was expected
- script only works if run from a specific working directory
- two separate arguments (dump/verify) is weird: that leads to 4 distinct modes but only two of them make sense...
These are all either trivial or just thoughts for future: I think it's a good start for these tests, approved.
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Continuation from #1898.
Because of a GitHub bug the new changes inside
test-static-data-generationbranch of my forkweren't noticed.
That's why I created a new pr.
Related to: #1806
Description of the changes being introduced by the pull request:
I created a new script called "generate_md.py" which can be used
to easily generate a repository. Additionally, I created a new
test file making sure that the locally stored metadata files and
the newly generated metadata roles are the same.
This will allow us to test that we are not changing the metadata
file structure when making changes.
Signed-off-by: Martin Vrachev [email protected]
Please verify and check that the pull request fulfills the following
requirements: