Skip to content

🌱 (ci): Fix mock for alpha update e2e tests #4938

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

Merged

Conversation

camilamacedo86
Copy link
Member

The mock is doing inserts instead of replaces
We want a simple mock to ensure a scenario without conflicts

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86

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

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 19, 2025
@camilamacedo86 camilamacedo86 force-pushed the test-alpha-update-fix-mock branch from 07b5c5e to 5230ffb Compare July 19, 2025 18:56
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 19, 2025
typesFile := filepath.Join(projectDir, "api", "v1", "testoperator_types.go")
err := pluginutil.InsertCode(
Copy link
Member Author

Choose a reason for hiding this comment

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

In the POC we are replacing the code
@vitorfloriano

return ctrl.Result{}, err
}

log.Info("testOperator reconciled")`
Copy link
Member Author

Choose a reason for hiding this comment

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

KISS and leave in a const for we check out
@vitorfloriano

if kbc != nil {
kbc.Destroy()
}
_ = os.RemoveAll(kbc.Dir)
Copy link
Member Author

Choose a reason for hiding this comment

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

We should always remove the directory
If we call Destroy it will remove the image
@vitorfloriano

Size int32 `+"`json:\"size,omitempty\"`",
)
Expect(err).NotTo(HaveOccurred())
controllerFile := filepath.Join(projectDir, "internal", "controller", "testoperator_controller.go")
err = pluginutil.InsertCode(
Copy link
Member Author

@camilamacedo86 camilamacedo86 Jul 19, 2025

Choose a reason for hiding this comment

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

We need to replace the TODO
and log . See that the log format changed from one to another
c/c @vitorfloriano

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 19, 2025
@camilamacedo86
Copy link
Member Author

I am moving forward here to unblock @vitorfloriano in : #4936

@k8s-ci-robot k8s-ci-robot merged commit 574a3da into kubernetes-sigs:master Jul 19, 2025
22 checks passed
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants