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

Ban usage of require.Error #1346

Merged
merged 94 commits into from
Apr 22, 2023
Merged

Ban usage of require.Error #1346

merged 94 commits into from
Apr 22, 2023

Conversation

StephenButtolph
Copy link
Contributor

Why this should be merged

Tests using require.Error can be subtly incorrect because an unexpected error may be returned.

How this works

Bans the usage of require.Error and removes all usage of require.Error

How this was tested

CI

@StephenButtolph StephenButtolph added testing This primarily focuses on testing ci This focuses on changes to the CI process cleanup Code quality improvement labels Apr 14, 2023
@StephenButtolph StephenButtolph added this to the v1.10.1 milestone Apr 14, 2023
@StephenButtolph StephenButtolph self-assigned this Apr 14, 2023
_, err = db.history.getValueChanges(toBeDeletedRoot, endRoot, nil, nil, 1)
require.Error(err, ErrRootIDNotPresent)
require.ErrorIs(err, ErrStartRootNotFound)
Copy link
Contributor Author

@StephenButtolph StephenButtolph Apr 14, 2023

Choose a reason for hiding this comment

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

@dboehm-avalabs this error wasn't correct - lmk if this error is unexpected.

Base automatically changed from codec-error-handling to dev April 21, 2023 21:08
@StephenButtolph StephenButtolph changed the base branch from dev to utils-error-handling April 21, 2023 21:27
@StephenButtolph StephenButtolph changed the base branch from utils-error-handling to consensus-error-handling April 21, 2023 21:35
@StephenButtolph StephenButtolph changed the base branch from consensus-error-handling to not-platformvm-error-handling April 21, 2023 21:48
@StephenButtolph StephenButtolph marked this pull request as ready for review April 21, 2023 22:04
sharedMemory atomic.SharedMemory
sourceKeys []*secp256k1.PrivateKey
timestamp time.Time
expectedBuildError error
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can we do expectedErr since we're only testing build?

Copy link
Contributor

@dhrubabasu dhrubabasu left a comment

Choose a reason for hiding this comment

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

🏆

Base automatically changed from not-platformvm-error-handling to dev April 22, 2023 19:30
@StephenButtolph StephenButtolph merged commit 6d1e0a7 into dev Apr 22, 2023
@StephenButtolph StephenButtolph deleted the ban-require-error branch April 22, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci This focuses on changes to the CI process cleanup Code quality improvement testing This primarily focuses on testing
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants