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

Consider using regular log in the test cleanup function instead of fail now error #428

Closed
Tracked by #488
mojtaba-esk opened this issue Jun 6, 2024 · 0 comments
Closed
Tracked by #488
Labels
good first issue Good for newcomers knuu refactor Refactoring

Comments

@mojtaba-esk
Copy link
Member

Currently if the cleanup function for a test fails, it fails the entire test which is not ideal.

t.Cleanup(func() {
	require.NoError(t, instance.Destroy(context.Background()))
})

it is suggested to avoid that issue, simply use something that does not impact on the test validity like the following:

t.Cleanup(func() {
	err:= instance.Destroy(context.Background())
	if err != nil{
		t.Logf("cleanup failed: %w", err)
	}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers knuu refactor Refactoring
Projects
Archived in project
Development

No branches or pull requests

2 participants