-
Notifications
You must be signed in to change notification settings - Fork 455
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
fix: clean up UTs for file metrics collector #2285
Conversation
PTAL👀 /assign @andreyvelich @tenzen-y . BTW my flag is standing :) |
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.
Give my first review
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
I reordered the judging logics in Also, some typical error's descriptions are added to the returned error in PTAL👀 if you have some spare time @tenzen-y @andreyvelich . |
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.
Basically, lgtm
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector.go
Outdated
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector.go
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector.go
Outdated
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
@tenzen-y It seems that the CI failed due to other reasons which are not concerned with my code. |
I'll try to check it. |
@Electronic-Waste Could you rebase this PR? Because I fixed CI issues. |
@tenzen-y Sure! I'll rebase it soon. |
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
cf7ea21
to
da94a7d
Compare
Some unexpected errors occurred in
And also
I encountered them many times in CI. Should we look into these errors and fix them? |
Those errors are known flakness issues. I'll try to restart jobs. |
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.
Thank you!
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Electronic-Waste, tenzen-y 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 |
@tenzen-y Thank you for your review! |
What this PR does / why we need it:
Current error comparison in file-metricscollector_test.go is based on a boolean rather than the error content To make test cases more detailed and accurate, we should expose and compare errors.
And also @tenzen-y suggested that
t.TempDir
should be used for generating test directory. So I replace static directories witht.TempDir
.Related discussion: #1756 (comment) #2274 (comment)
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #1756
Checklist: