Skip to content

Conversation

@r4f4
Copy link
Contributor

@r4f4 r4f4 commented Mar 3, 2025

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Github / Jira issue:

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code Improvements (Refactoring, Performance, CI upgrades, etc)
  • Internal repo assets (diagrams / docs on github repo)
  • This change requires a documentation update on openshift docs

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.

Expected Outcome

Please describe the outcome expected from the tests.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 3, 2025
@openshift-ci openshift-ci bot requested review from lmzuccarelli and sherine-k March 3, 2025 17:56
@sherine-k
Copy link
Contributor

Hey @r4f4
Thanks for sharing about this library!
I think we are already using something similar: from testify/mock, here for example.

Interested to understand the pros and cons of these 2 libraries.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2025
Copy link
Contributor

@aguidirh aguidirh left a comment

Choose a reason for hiding this comment

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

I really like this mock approach. Thanks @r4f4

  • it generates the code automatically for you
  • it is possible to reuse the mocked structs from a different package instead of duplicating code (as it is currently)

@@ -247,75 +247,3 @@ func TestAdditionalImageCollector(t *testing.T) {
assert.ElementsMatch(t, expected, res)
})
}
Copy link
Contributor

Choose a reason for hiding this comment

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

It is really nice to reuse the mock from other packages instead of duplicating them.

+1

Comment on lines +1 to +9
// Code generated by MockGen. DO NOT EDIT.
// Source: ./interface.go
//
// Generated by this command:
//
// mockgen -source=./interface.go -destination=./mock/interface_generated.go -package=mock
//

// Package mock is a generated GoMock package.
Copy link
Contributor

Choose a reason for hiding this comment

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

Generating the mock automatically based on the interface is really a big win.

+1

@openshift-bot
Copy link
Contributor

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

@openshift-ci openshift-ci bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 30, 2025
@aguidirh
Copy link
Contributor

@r4f4 I really like this approach and I think oc-mirror could benefit a lot from it.

Is there anything missing that we can do to have it merged ?

@r4f4
Copy link
Contributor Author

r4f4 commented Jul 30, 2025

@r4f4 I really like this approach and I think oc-mirror could benefit a lot from it.

Is there anything missing that we can do to have it merged ?

Other than rebasing, I think it depends on what we want out of this PR. I just did it for one test file as an example but there still a lot of work to do it for the rest.

@aguidirh
Copy link
Contributor

aguidirh commented Aug 4, 2025

Got it @r4f4, so maybe we can get this merged and use it as an example to migrate the older tests (it does not need to be all at once) and when creating new ones.

What do you think about it @lmzuccarelli ?

@lmzuccarelli
Copy link
Contributor

@r4f4 - could you rebase and once passing we can merge

@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2025
@openshift-bot
Copy link
Contributor

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

@openshift-ci openshift-ci bot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Oct 2, 2025
@r4f4
Copy link
Contributor Author

r4f4 commented Oct 2, 2025

/remove-lifecycle rotten

@openshift-ci openshift-ci bot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 2, 2025
@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 28, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2025
@openshift-ci
Copy link

openshift-ci bot commented Nov 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: r4f4

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 4, 2025
@openshift-ci
Copy link

openshift-ci bot commented Nov 9, 2025

@r4f4: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/lint 9e26d86 link true /test lint
ci/prow/v1-sanity 9e26d86 link true /test v1-sanity
ci/prow/integration 9e26d86 link true /test integration
ci/prow/unit 9e26d86 link true /test unit
ci/prow/sanity 9e26d86 link true /test sanity
ci/prow/v1-unit 9e26d86 link true /test v1-unit

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 9, 2025
@openshift-merge-robot
Copy link
Contributor

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants