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

Add tests for tuf-repository #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

mnm678
Copy link
Contributor

@mnm678 mnm678 commented Feb 18, 2022

Add tests for init and set up the testing infrastructure for future features.

Signed-off-by: Marina Moore <[email protected]>
Copy link
Contributor

@sudo-bmitch sudo-bmitch left a comment

Choose a reason for hiding this comment

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

Two thoughts on this one. If you want to make it an ephemeral test, I would use a directory that isn't checked into git. There is a t.TempDir() you can use to make a new directory that Go always cleans for you. Docs on that one: https://pkg.go.dev/testing#T.TempDir

And for test data you do want to include in the project, there's an under documented folder name called testdata that Go always ignores. So I tend to keep any non-Go data in those directories. There are a couple hints in the Go docs on this but it should really be called out better than finding it in Dave's blog posts: https://dave.cheney.net/2016/05/10/test-fixtures-in-go

Neither of these are big enough to hold up the merge of these test, they LGTM.

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