Add ability to use mock without passing in arguments#191
Add ability to use mock without passing in arguments#191maysunfaisal merged 4 commits intodevfile:mainfrom
Conversation
Signed-off-by: Maysun J Faisal <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
==========================================
- Coverage 60.53% 60.46% -0.07%
==========================================
Files 43 43
Lines 5047 5061 +14
==========================================
+ Hits 3055 3060 +5
- Misses 1802 1810 +8
- Partials 190 191 +1 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Maysun J Faisal <[email protected]>
| // So we should be adaptable and use the function params | ||
| // and mock the output | ||
| if util.IsGitProviderRepo(params.URL) { | ||
| gc.MockGitURL.Host = params.URL |
There was a problem hiding this comment.
for this case, is it possible that gc.MockGitURL is nil?
There was a problem hiding this comment.
Its not a pointer, I dont think we should check for nil here. Its a regular struct assignment.
| mockGitUrl = gc.MockGitURL | ||
| mockGitUrl.Token = gc.GitTestToken | ||
| } | ||
| } else if params.URL != "" { |
There was a problem hiding this comment.
can you add a test case for this block?
There was a problem hiding this comment.
good catch, tests updated.
Signed-off-by: Maysun J Faisal <[email protected]>
| client: MockDevfileUtilsClient{MockGitURL: util.MockGitUrl{Host: server.URL}, DownloadOptions: util.MockDownloadOptions{MockFile: "OK"}}, | ||
| name: "Case 6: Input url is valid with a mock client, dont use mock data during invocation", | ||
| client: MockDevfileUtilsClient{}, | ||
| url: server.URL, |
There was a problem hiding this comment.
are we able to test a gitURL?
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
since you add support for empty client, should add new unit test for your change, not editing the existing tests. the empty client case you added, needs a gitURL?
There was a problem hiding this comment.
I'll add a Github URL
Signed-off-by: Maysun J Faisal <[email protected]>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: maysunfaisal, yangcao77 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
What does this PR do?:
Which issue(s) this PR fixes:
PR acceptance criteria:
Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened and linked to this PR, if they are not in the PR scope due to various constraints.
Unit/Functional tests
QE Integration test
Documentation (READMEs, Product Docs, Blogs, Education Modules, etc.)
Client Impact
Gosec scans
How to test changes / Special notes to the reviewer:
tests should pass