-
Notifications
You must be signed in to change notification settings - Fork 87
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
✨ Add pivoting test based on the e2e test framework #232
Conversation
1dd185c
to
3b3af6e
Compare
/test-v1a5-e2e |
8670126
to
d44d27d
Compare
/test-v1a5-e2e |
f1bdf04
to
a365924
Compare
19bb77f
to
3b22f17
Compare
/test-v1a5-e2e |
5 similar comments
/test-v1a5-e2e |
/test-v1a5-e2e |
/test-v1a5-e2e |
/test-v1a5-e2e |
/test-v1a5-e2e |
/test-integration |
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.
This is great effort and basement for all other upcoming e2e tests after this, good job @namnx228! I have few comments/suggestions/questions inline:
@@ -0,0 +1,3894 @@ | |||
--- |
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.
Clarification question: there is no way of using single calico manifest for both Ubuntu and Centos tests?
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.
There is a way to do that which is the same as https://github.com/metal3-io/metal3-dev-env/blob/54abb30bb076e237de68b804d3bffe52235ccdb9/vm-setup/roles/v1aX_integration_test/tasks/verify.yml#L75
However, I think we should do it in another patch to avoid adding more complexity to this PR.
fmt.Sprintf("IRONIC_HOST=%s", ironicHost), | ||
fmt.Sprintf("IRONIC_HOST_IP=%s", ironicHost), |
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.
what is the diff between these two?
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 they are the same, but it is required by deploy.sh
: https://github.com/metal3-io/metal3-dev-env/blob/54abb30bb076e237de68b804d3bffe52235ccdb9/vm-setup/roles/v1aX_integration_test/tasks/move.yml#L122
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.
Strange, in fact they are the same and are coming from m3-dev-env
test/e2e/pivoting_test.go
Outdated
err := cmd.Start() | ||
Expect(err).To(BeNil(), "Fail to deploy Ironic") | ||
err = cmd.Wait() | ||
Expect(err).To(BeNil(), "Fail to deploy Ironic") |
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.
same
} | ||
func removeIronicDeployment() { | ||
deploymentName := os.Getenv("NAMEPREFIX") + "-ironic" | ||
ironicNamespace := os.Getenv("IRONIC_NAMESPACE") |
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 do also suggest we take all vars like these here and in all other funcs so we could define them at the top once and re-use them (if applicable) later, since some of them redefined twice in different funcs, i.e IRONIC_NAMESPACE
, BMOPATH
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 agree that some variables are redefined some times in this PR. However, I think it is not too bad since these variables are mostly in type string, not big objects.I kind of reluctant to use global variables if we only need them in one test to avoid unnecessary access to these variables from other tests. Therefore, I would use local variables in this case.
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 meant to define them in the pivoting_test.go
not in e2e_suite_test.go
or somewhere else, do you still think it would be accessible by other tests?
/test-v1a5-centos-e2e |
go.mod
Outdated
@@ -3,7 +3,7 @@ module github.com/metal3-io/cluster-api-provider-metal3 | |||
go 1.16 | |||
|
|||
require ( | |||
github.com/Microsoft/go-winio v0.5.0 // indirect | |||
// github.com/Microsoft/go-winio v0.5.0 // indirect |
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 you need to run go mod tidy
to get rid of these dependency updates, since just uncommenting did not help.
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.
Oh, ok. I commented to test if the code can work without that module, then I forgot to actually delete it ^^
} | ||
func removeIronicDeployment() { | ||
deploymentName := os.Getenv("NAMEPREFIX") + "-ironic" | ||
ironicNamespace := os.Getenv("IRONIC_NAMESPACE") |
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 meant to define them in the pivoting_test.go
not in e2e_suite_test.go
or somewhere else, do you still think it would be accessible by other tests?
@furkatgofurov7 Yes, even when we define the global variables in the |
5ae22db
to
5ccc097
Compare
/test-v1a5-centos-e2e |
5ccc097
to
fe97fe6
Compare
/test-v1a5-centos-e2e |
fe97fe6
to
4067f84
Compare
/test-v1a5-e2e |
Add some check to ensure that pivoting is successful Use go.mod and go.sum from master Fix golint error Fix go dependency More fix on Go dependency Fix Temporary disable log The rest of pivoting test now can run fix Fix `clusterctl init` without checking all deployments running Fix the lint problem Force update on the BMO repo Change order No longer getting stuck Make pivoting become a step Fix golint error Fix Fix fix fix Install BMO in v1alpha5 Fix Add labels to BMO CRDs in v1alpha5 fix fix Pass the CI Remove the use of variables in the config file Fix undeclared variables Fix Fix Fix to pass the unit and lint test Address comments
4067f84
to
cc3afbe
Compare
/test-v1a5-e2e |
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 am happy with these changes, we can think of combining calico manifests into a single one and use that for both Ubuntu/CentOS e2e test runs in the future patches.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: furkatgofurov7, Rozzii 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 |
/lgtm |
What this PR does / why we need it:
This PR adds the pivoting test based on the e2e test framework.