Skip to content

Conversation

@maysunfaisal
Copy link
Member

Signed-off-by: Maysun J Faisal maysunaneek@gmail.com

What does this PR do?

Adds mock funcs for the DevfileData interface via the mockgen tool

What issues does this PR fix or reference?

Fixes devfile/api#383

Is your PR tested? Consider putting some instruction how to test your changes

Yes, updated tests to use the mock data

@yangcao77
Copy link
Collaborator

Should the mock_interface be under testingutil pkg, instead of our production pkg?

@maysunfaisal
Copy link
Member Author

maysunfaisal commented Jun 9, 2021

@yangcao77 its usually kept in the same dir as the interface file. Thats the practice that I saw in online examples and odo as our close reference.

I'll check more tho, brb

@yangcao77
Copy link
Collaborator

@yangcao77 its usually kept in the same dir as the interface file. Thats the practice that I saw in online examples and odo as our close reference.

I'll check more tho, brb

Reasonable. If we have new interface for v3 in the future, we need to create matching mock funcs for new interface anyways.

Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
@yangcao77
Copy link
Collaborator

Another thought on this PR:
Since GetDevfileContainerComponents and GetDevfileVolumeComponents are depracated functions, our library should switch to use GetComponents(common.DevfileOptions) instead

Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
Copy link
Collaborator

@yangcao77 yangcao77 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good to me

@openshift-ci
Copy link

openshift-ci bot commented Jun 10, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maysunfaisal, yangcao77

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [maysunfaisal,yangcao77]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@maysunfaisal maysunfaisal merged commit 179c407 into devfile:main Jun 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create mocks for better testing

2 participants