-
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
chore: add unit testcases for files in Text format. #2274
chore: add unit testcases for files in Text format. #2274
Conversation
Signed-off-by: Electronic-Waste <2690692950@qq.com>
The newly added code obeys the rules in Developer Guide. |
/cc @tenzen-y |
Signed-off-by: Electronic-Waste <2690692950@qq.com>
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.
My first pass.
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Electronic-Waste <2690692950@qq.com>
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Show resolved
Hide resolved
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
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
"Positive case for logs in TEXT format": { | ||
filePath: filepath.Join(testTextDataPath, "good.log"), | ||
metrics: []string{"accuracy", "loss"}, | ||
filters: []string{"{metricName: ([\\w|-]+), metricValue: ((-?\\d+)(\\.\\d+)?)}"}, |
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.
As we mentioned in the issue, our motivation is to verify if this filter works fine to avoid bugs like this: #1754
We should add unit test for our File Metrics Collector to verify log parsing.
That will help to avoid issues similar to: #1754
So, could you add more than valid and invalid cases?
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.
Yes, I'll do it later.
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.
Some new test cases similar to bugs in #1754 have been added to the test file.
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Show resolved
Hide resolved
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
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
Thanks!
/lgtm
/approve
/hold
for Ci
@kubeflow/wg-automl-leads Could you approve CI?
It seems that CI does not start yet...Is it manipulated by someone? |
Thank you for this @Electronic-Waste, I will review PR on Monday. I triggered CI. |
@andreyvelich Okay, thx for your clarification. |
Signed-off-by: Electronic-Waste <2690692950@qq.com>
if err := generateJSONTestFiles(); err != nil { | ||
t.Fatal(err) | ||
} | ||
if err := generateTEXTTestFiles(); err != 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.
Did you push the commit? I can still see 2 separate functions.
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.
Yes, I pushed the commit. I just integrated dir creation & deletion operations into functions. Test file generation is not included since it's not necessary.
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Electronic-Waste <2690692950@qq.com>
@andreyvelich Is there anything else wrong with this PR? I can modify them soon. |
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 for the updates @Electronic-Waste!
Congratulation with your first contribution to Kubeflow 🎉
/lgtm
/assign @tenzen-y @johnugeorge
/hold for CI/CD and review from @tenzen-y and @johnugeorge |
I'm glad to see that my first PR is going to be merged! |
@andreyvelich I see. The new commit is added to this PR. |
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Electronic-Waste <2690692950@qq.com>
b60e35c
to
82c248f
Compare
@andreyvelich A new commit is added to the PR. Sorry for my mistake. |
Tests were succeeded! |
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.
Generally, lgtm
pkg/metricscollector/v1beta1/file-metricscollector/file-metricscollector_test.go
Show resolved
Hide resolved
[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 |
What this PR does / why we need it:
Add unit test cases for files in Text format in
file-metricscollector_test.go
, including: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: