-
Notifications
You must be signed in to change notification settings - Fork 69
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
fix: Refactor E2E tests #1463
fix: Refactor E2E tests #1463
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
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 checked out this branch and ran a successful batch of virtualization tests, no objections from me.
8194697
to
e6b8141
Compare
This comment was marked as outdated.
This comment was marked as outdated.
Tried running locally, failed for 2 tests, I will retry again:
|
@@ -24,17 +31,24 @@ func CreateBackupForNamespaces(ocClient client.Client, veleroNamespace, backupNa | |||
SnapshotMoveData: &snapshotMoveData, | |||
}, | |||
} | |||
err := ocClient.Create(context.Background(), &backup) | |||
return backup, err | |||
return ocClient.Create(context.Background(), &backup) |
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.
Curious, Why did we do this refactor ?
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 was thinking about #1240 to make these functions more simple (but did not change nothing on them, except for not returning a backup and not having backup as a parameter anymore)
@shubham-pampattiwar do you have the logs of error of each failed test? |
I have results only on the one that timed out:
|
@shubham-pampattiwar this is because |
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
bb938a9
to
c9db884
Compare
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
If running E2E tests against operator created from `make deploy-olm`, remember its image expires, which may cause **Subscription Config Suite Test** to fail. | ||
If running E2E tests against operator created from `make deploy-olm`, remember its image expires, which may cause tests to fail. | ||
|
||
When running Virtual Machine backup/restore tests on IBM Cloud, it is better to manually install OpenShift Virtualization operator, instead of automatically installing it through `make test-e2e`. Because this may cause the error of Virtual Machines never starting to run. Example test log: |
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.
Is it fixable? Let's open an issue?
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 virt test checks if virt operator is installed https://github.com/openshift/oadp-operator/blob/master/tests/e2e/virt_backup_restore_suite_test.go#L142
if yes, continues; otherwise, installs and configure it for you
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 could also patch the StorageProfile automatically, but for now I guess manual setup is the only way to make it work. I can work on this in another pull request.
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
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
for followup
|
||
// Subscription Config environment variables are passed to controller-manager Pod | ||
// https://github.com/operator-framework/operator-lifecycle-manager/blob/d8500d88932b17aa9b1853f0f26086f6ee6b35f9/doc/design/subscription-config.md | ||
os.Setenv(scenario.envVar.Name, scenario.envVar.Value) |
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.
Would be cool if this could undo the setenv
originalValue, _ := os.LookupEnv("MY_VAR") // Store original value (if exists)
defer func() {
if originalValue != "" {
os.Setenv("MY_VAR", originalValue) // Restore original value
} else {
os.Unsetenv("MY_VAR") // Remove if newly created
}
}()
os.Setenv("MY_VAR", "new_value")
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 was not as necessary in subscription suite test e2e because env is set in operator controller pod.
Now this is a unit test, setting env here could maybe change current terminal env and break things like git
which reads from env proxy settings.
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.
|
||
// Subscription Config environment variables are passed to controller-manager Pod | ||
// https://github.com/operator-framework/operator-lifecycle-manager/blob/d8500d88932b17aa9b1853f0f26086f6ee6b35f9/doc/design/subscription-config.md | ||
os.Setenv(scenario.envVar.Name, scenario.envVar.Value) |
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.
originalValue, _ := os.LookupEnv("MY_VAR") // Store original value (if exists)
defer func() {
if originalValue != "" {
os.Setenv("MY_VAR", originalValue) // Restore original value
} else {
os.Unsetenv("MY_VAR") // Remove if newly created
}
}()
os.Setenv("MY_VAR", "new_value")
Signed-off-by: Mateus Oliveira <msouzaol@redhat.com>
@mateusoliveira43: all tests passed! 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. |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mateusoliveira43, mrnold, shubham-pampattiwar, sseago 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 |
Why the changes were made
k8s.io/utils/pointer
libraryHow to test the changes made
Check CI logs and run tests and E2E tests locally.