-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Labels
refactorNo logic but only implementation changes.No logic but only implementation changes.testing-onlyOnly relevant for testing.Only relevant for testing.
Description
Context
Many test cases currently use assert.NoError(t, err)
without checking the returned bool. This can lead to false positives, where the test continues after an unexpected error, potentially masking failures.
According to the testify docs, require.NoError
should be used when the test cannot continue meaningfully after an error.
Also the current codebase contains many legacy deadcode that should be investigated and cleaned up if not needed.
Suggested fix
- Audit the codebase for uses of assert.NoError(t, err) that are not conditionally checked. Replace them with require.NoError(t, err) where the error should cause the test to fail immediately.
- Audit the codebase for deadcode and remove them.
Scope
- Leave existing usage as-is in current PRs to avoid scope creep.
- Address this issue in a dedicated follow-up PR.
- Publish a follow-up release (temp. name v0.14.1)
Example
Example of incorrect pattern:
assert.NoError(t, err) // not checked, test continues on unexpected error
Correct pattern:
require.NoError(t, err) // fails immediately if err != nil
Metadata
Metadata
Assignees
Labels
refactorNo logic but only implementation changes.No logic but only implementation changes.testing-onlyOnly relevant for testing.Only relevant for testing.