-
Notifications
You must be signed in to change notification settings - Fork 56
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
e2e logging: Hard to find errors in test log #1595
Comments
nirs
changed the title
e2e logging: errors logged as INFO level or without any level
e2e logging: Hard to find errors in test log
Oct 21, 2024
nirs
added a commit
to nirs/ramen
that referenced
this issue
Oct 30, 2024
When a test fails, we the go test framework logs the failure in an unhelpful way. This works for unit tests, since they are simple and do not log anything, but our tests are complex and log a lot. The failure logs from go test are hidden and hard to find. This change add wrappers for t.Fatal, t.FailNow, t.Skip, and t.Skipf so they use our logger instead of the go test framework logger. This ensures that every failure will have a proper ERROR log which is very easy to find. When handling errors in parent tests we don't have any context and we cannot log any useful error. The actual error that failed the sub test already logged the error, so we just mark the test as failed with util.FailNow(). Part-of: RamenDR#1595 Signed-off-by: Nir Soffer <[email protected]>
nirs
added a commit
to nirs/ramen
that referenced
this issue
Oct 30, 2024
When a test fails, we the go test framework logs the failure in an unhelpful way. This works for unit tests, since they are simple and do not log anything, but our tests are complex and log a lot. The failure logs from go test are hidden and hard to find. This change add wrappers for t.Fatal, t.FailNow, t.Skip, and t.Skipf so they use our logger instead of the go test framework logger. This ensures that every failure will have a proper ERROR log which is very easy to find. Errors logs include a traceback making it easier to understand the failure. When handling errors in parent tests we don't have any context and we cannot log any useful error. The actual error that failed the sub test already logged the error, so we just mark the test as failed with util.FailNow(). Part-of: RamenDR#1595 Signed-off-by: Nir Soffer <[email protected]>
nirs
added a commit
to nirs/ramen
that referenced
this issue
Oct 30, 2024
When a test fails, we the go test framework logs the failure in an unhelpful way. This works for unit tests, since they are simple and do not log anything, but our tests are complex and log a lot. The failure logs from go test are hidden and hard to find. This change add wrappers for t.Fatal, t.FailNow, t.Skip, and t.Skipf so they use our logger instead of the go test framework logger. This ensures that every failure will have a proper ERROR log which is very easy to find. Errors logs include a traceback making it easier to understand the failure. When handling errors in parent tests we don't have any context and we cannot log any useful error. The actual error that failed the sub test already logged the error, so we just mark the test as failed with util.FailNow(). Fixes: RamenDR#1595 Signed-off-by: Nir Soffer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Errors during test are logged without ERROR prefix, making it hard to find the issue when a test fails.
The issue is in go testing package - t.Error/Fatal do not log any prefix. This works for simple tests that do not log anything, but not for complex tests that have lot of logs.
The text was updated successfully, but these errors were encountered: