-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
workloadrepo: Add unit testing for the Workload Repository. #58266
Conversation
Hi @wddevries. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Please resolve the conflicts. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #58266 +/- ##
================================================
+ Coverage 73.0858% 73.6320% +0.5462%
================================================
Files 1676 1676
Lines 463685 465641 +1956
================================================
+ Hits 338888 342861 +3973
+ Misses 103941 101924 -2017
Partials 20856 20856
Flags with carried forward coverage won't be shown. Click here to find out more.
|
6409e21
to
c77178b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty much LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have much objections on these little refactors, LGTM
c77178b
to
0206059
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
�[31m�[1mTIMEOUT: �[0m//pkg/util/workloadrepo:workloadrepo_test (Summary)
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/util/workloadrepo/workloadrepo_test/test.log
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/util/workloadrepo/workloadrepo_test/test_attempts/attempt_1.log
/home/jenkins/.tidb/tmp/63a9840cd0739f2c243bb46478607469/execroot/__main__/bazel-out/k8-fastbuild/testlogs/pkg/util/workloadrepo/workloadrepo_test/test_attempts/attempt_2.log
�[31m�[1mERROR: �[0m/home/jenkins/agent/workspace/pingcap/tidb/ghpr_unit_test/tidb/pkg/util/workloadrepo/BUILD.bazel:41:8: Testing //pkg/util/workloadrepo:workloadrepo_test failed: Test failed, aborting
==================== Test output for //pkg/util/workloadrepo:workloadrepo_test:
Is there a problem for the test?
@wddevries: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
/test unit-test |
@wddevries: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@henrybw: adding LGTM is restricted to approvers and reviewers in OWNERS files. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
5b44f73
to
3da6355
Compare
…pdated for snapshot command changes.)
… partitions when no partition covers tomorrow.
…er an empty string or 'table.'
…() for testing purposes.
…t testing can be deterministic.
…workers at initialization.
3da6355
to
5aa4be0
Compare
pkg/util/workloadrepo/worker_test.go
Outdated
if !testWorker { | ||
workerCtx.etcdClient = nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, can we do workCtx = worker{}
? GO will init every field to zero.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was under the impression that multiple unit tests were being run within the same process and that the global variables were not reinitialized between tests, but my experimentation seems to indicate this is not the case. I will fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bb7133, henrybw, xhebox The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Issue Number: ref #58247
Problem Summary:
This pull request adds unit testing for the Workload Repository code. It also fixes a few issues and refactors some code. Specific changes include:
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.