-
Notifications
You must be signed in to change notification settings - Fork 173
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
chore: cleanup errchecking in tests #3040
Conversation
✅ Deploy Preview for zarf-docs canceled.
|
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
… to nolint ignore them Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…anic Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…gnore it Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…r before loop Signed-off-by: Kit Patella <kit@defenseunicorns.com>
…caller Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
a8e5de9
to
20241aa
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one comment, but it applies to most of the defers that got deleted. I think we should keep the defers
, and check errors within them otherwise during when a test fails before the cleanup step there will be no cleanup.
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
@AustinAbro321 Defers should be fixed in latest, also added some todos for when we swap over to the linter in main |
src/test/e2e/29_config_file_test.go
Outdated
@@ -139,30 +143,37 @@ func configFileDefaultTests(t *testing.T) { | |||
} | |||
|
|||
// Test remaining default initializers | |||
t.Setenv("ZARF_CONFIG", filepath.Join("src", "test", "zarf-config-test.toml")) | |||
defer os.Unsetenv("ZARF_CONFIG") | |||
envKey := "ZARF_CONFIG" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Could just set as const
mayb?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def, opted to keep it consistent but const was preferred
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more comments, but it's very close. Nice work! I've learned a lot about defer while doing this reviews
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Should all be reserved (cc @schristoff) and yeah 100% here too. I ended up trying a bunch of different error handling patterns, from manual orders to the named err + join, and definitely added a few tricks to the toolbox. named err + join is probably the closest thing we have in Go to a |
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com>
Signed-off-by: Kit Patella <kit@defenseunicorns.com> Signed-off-by: ittacco <lorenzo.tacconi1967@gmail.com>
Description
This PR is split out from #2993 to only fix ignored errors in tests.
Related Issue
Fixes #2949
Relates to #2993, #2953
Checklist before merging