-
Notifications
You must be signed in to change notification settings - Fork 1.6k
π± (alpha update): add e2e tests for --force flag
#4955
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
π± (alpha update): add e2e tests for --force flag
#4955
Conversation
|
Hi @vitorfloriano. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/ok-to-test |
test/e2e/alphaupdate/update_test.go
Outdated
| ) | ||
|
|
||
| const ( | ||
| fromVersion = "v4.5.2" |
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.
Run make lint-fix to fix : File is not properly formatted (gci)
| } | ||
| fileContent := string(content) | ||
| if strings.Contains(fileContent, "<<<<<<<") && strings.Contains(fileContent, "=======") && strings.Contains(fileContent, ">>>>>>>") { | ||
| conflictMarkersFound = true |
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.
The problem here is the size of line
broke it in 2 lines ( just give a enter )
Why?
Big lines make it harder to read the code.
That is why it is a good practice to avoid using the scroll to read everything.
defauly 120 characters
test/e2e/alphaupdate/update_test.go
Outdated
| statusOutput := strings.TrimSpace(string(output)) | ||
| Expect(statusOutput).NotTo(BeEmpty(), "Working directory should have uncommitted changes from merge conflict") | ||
|
|
||
| // Reuse existing conflict marker validation |
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.
| // Reuse existing conflict marker validation |
This comment is unnecessary
When we write code, it needs to be readable in a way that we do not need comments
Like reading a history, we are able to understand what is happening in each step with function names, etc.
test/e2e/alphaupdate/update_test.go
Outdated
| validateConflictMarkers(mockProjectDir) | ||
| }) | ||
|
|
||
| It("should stop in a conflict state if --force is not used", func() { |
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.
| It("should stop in a conflict state if --force is not used", func() { | |
| It("should stop when update project from v4.5.2 to v4.7.0 without the flag force to allow manual conflicts resolution" |
This commit adds two e2e tests to verify the behavior of using the alpha update command with and without the --force flag.
9bb345c to
65375d0
Compare
| Expect(string(content)).To(ContainSubstring(controllerImplementation)) | ||
| } | ||
|
|
||
| func validateConflictMarkers(projectDir string, expectMarkers bool) { |
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.
I think it is a little overwhelming for what we need.
but lets move forward and after we improve in a follow up
camilamacedo86
left a comment
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.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: camilamacedo86, vitorfloriano 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 |
This PR adds two e2e tests to verify the behavior of using the
alpha updatecommand with and without the--forceflag.Force flag with conflicts:
v4.5.2βv4.7.0--forceStop at conflicts:
v4.5.2βv4.7.0(no--forceflag)Tests use real version differences that create genuine conflicts introduced in
v4.7.0.