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

tests: add tests for go/vt/hook #15015

Merged
merged 8 commits into from
Jan 25, 2024

Conversation

Maniktherana
Copy link
Contributor

Description

Bump coverage from 37.7% to 78.3%

Related Issue(s)

#14931

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

@Maniktherana Maniktherana requested a review from deepthi as a code owner January 23, 2024 11:00
Copy link
Contributor

vitess-bot bot commented Jan 23, 2024

Review Checklist

Hello reviewers! 👋 Please follow this checklist when reviewing this Pull Request.

General

  • Ensure that the Pull Request has a descriptive title.
  • Ensure there is a link to an issue (except for internal cleanup and flaky test fixes), new features should have an RFC that documents use cases and test cases.

Tests

  • Bug fixes should have at least one unit or end-to-end test, enhancement and new features should have a sufficient number of tests.

Documentation

  • Apply the release notes (needs details) label if users need to know about this change.
  • New features should be documented.
  • There should be some code comments as to why things are implemented the way they are.
  • There should be a comment at the top of each new or modified test to explain what the test does.

New flags

  • Is this flag really necessary?
  • Flag names must be clear and intuitive, use dashes (-), and have a clear help text.

If a workflow is added or modified:

  • Each item in Jobs should be named in order to mark it as required.
  • If the workflow needs to be marked as required, the maintainer team must be notified.

Backward compatibility

  • Protobuf changes should be wire-compatible.
  • Changes to _vt tables and RPCs need to be backward compatible.
  • RPC changes should be compatible with vitess-operator
  • If a flag is removed, then it should also be removed from vitess-operator and arewefastyet, if used there.
  • vtctl command output order should be stable and awk-able.

@vitess-bot vitess-bot bot added NeedsBackportReason If backport labels have been applied to a PR, a justification is required NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsIssue A linked issue is missing for this Pull Request NeedsWebsiteDocsUpdate What it says labels Jan 23, 2024
@github-actions github-actions bot added this to the v19.0.0 milestone Jan 23, 2024
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (7800699) 47.29% compared to head (1d99c99) 47.41%.
Report is 19 commits behind head on main.

Files Patch % Lines
go/vt/vttablet/tabletserver/tabletserver.go 27.27% 5 Missing and 3 partials ⚠️
go/vt/vtgate/querylog.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #15015      +/-   ##
==========================================
+ Coverage   47.29%   47.41%   +0.11%     
==========================================
  Files        1139     1144       +5     
  Lines      238914   238995      +81     
==========================================
+ Hits       113004   113326     +322     
+ Misses     117315   117085     -230     
+ Partials     8595     8584      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frouioui frouioui added Type: Testing Component: General Changes throughout the code base and removed NeedsDescriptionUpdate The description is not clear or comprehensive enough, and needs work NeedsWebsiteDocsUpdate What it says NeedsIssue A linked issue is missing for this Pull Request NeedsBackportReason If backport labels have been applied to a PR, a justification is required labels Jan 23, 2024
Copy link
Member

@frouioui frouioui left a comment

Choose a reason for hiding this comment

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

So far looks good to me besides the comments I left. I see coverage is up to almost 80%. More uncovered lines left are error cases, do you think you can go ahead and test those lines as well?

go/vt/hook/hook_test.go Outdated Show resolved Hide resolved
go/vt/hook/hook_test.go Outdated Show resolved Hide resolved
@Maniktherana
Copy link
Contributor Author

Maniktherana commented Jan 23, 2024

More uncovered lines left are error cases, do you think you can go ahead and test those lines as well?

@frouioui I'd rather tackle those in another PR as it's been slightly tricky trying to invoke stuff like HOOK_GENERIC_ERROR and HOOK_TIMEOUT_ERROR

Also one of the CI tests was failing. Think there was data race error for the unit_race test. Are there any changes I need to make for that?

@frouioui
Copy link
Member

I'd rather tackle those in another PR as it's been slightly tricky trying to invoke stuff like HOOK_GENERIC_ERROR and HOOK_TIMEOUT_ERROR

Sounds good to me!

@frouioui
Copy link
Member

frouioui commented Jan 23, 2024

Also one of the CI tests was failing. Think there was data race error for the unit_race test. Are there any changes I need to make for that?

It seems like TestExecuteAsWritePipe is flaky or failing when ran with -race, you should investigate locally to see if you can reproduce the issue. You can find the entire stack trace there: https://github.com/vitessio/vitess/actions/runs/7625023330/job/20769168942?pr=15015#logs

edit: you should test the entire package with -race

Signed-off-by: Manik Rana <[email protected]>
go/vt/hook/hook_test.go Outdated Show resolved Hide resolved
@frouioui frouioui self-requested a review January 23, 2024 17:54
Copy link
Member

@GuptaManan100 GuptaManan100 left a comment

Choose a reason for hiding this comment

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

LGTM

@GuptaManan100 GuptaManan100 merged commit 79534fd into vitessio:main Jan 25, 2024
102 checks passed
@Maniktherana Maniktherana deleted the add-tests-vt-hook branch January 25, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: General Changes throughout the code base Type: Testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants