-
Notifications
You must be signed in to change notification settings - Fork 880
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
operator/pkg: unit test utilities #5675
base: master
Are you sure you want to change the base?
operator/pkg: unit test utilities #5675
Conversation
4b7a340
to
e5d5c72
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5675 +/- ##
==========================================
+ Coverage 35.85% 38.60% +2.75%
==========================================
Files 647 650 +3
Lines 45070 55122 +10052
==========================================
+ Hits 16158 21281 +5123
- Misses 27664 32480 +4816
- Partials 1248 1361 +113
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
When I run the ut in the windows, it report error:
=== RUN TestDownloadFile/DownloadFile_FileDownlaoded_
util_test.go:229: failed to prep before downloading the file, got: failed to create temp file: open C:\Users\C00502~1\AppData\Local\Temp/tempfile-*.txt: The filename, directory name, or volume label syntax is incorrect.
util_test.go:236: unexpected error, got: failed to download file. url: https://www.example.com/test-file code: 503
util_test.go:242: failed to verify the actual of download of file: failed to read file: open C:\Users\C00502~1\AppData\Local\Temp/tempfile-*.txt: The filename, directory name, or volume label syntax is incorrect.
--- FAIL: TestDownloadFile (0.00s)
--- PASS: TestDownloadFile/DownloadFile_UrlIsNotFound_FailedToGetResponse (0.00s)
--- PASS: TestDownloadFile/DownloadFile_ServiceIsUnavailable_FailedToReachTheService (0.00s)
--- FAIL: TestDownloadFile/DownloadFile_FileDownlaoded_ (0.00s)
e5d5c72
to
ae2abe7
Compare
@XiShanYongYe-Chang Good catch! The current unit testing code assumed it was only targeting the Linux platform, so it used "/" as a separator. I've updated it to use |
Okay, let me have a retry. |
ae2abe7
to
0509eb0
Compare
I've updated the last commit. @XiShanYongYe-Chang, I realized that I forgot to replace one instance where "/" was used. 😁 Please pull the latest commit! 🙏 |
It still failed:
|
/assign |
0509eb0
to
4be46de
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
In this commit, we unit test utilities on downloader operations and unpacking tar files. Signed-off-by: Mohamed Awnallah <[email protected]>
4be46de
to
49eb96b
Compare
@XiShanYongYe-Chang, I've updated the commit. I believe the issue is primarily with the naming of the file |
Description
In this commit, we unit test utilities on downloader operations and unpacking tar files.
What type of PR is this?
Which issue(s) this PR fixes:
Part of #5491.
Does this PR introduce a user-facing change?: