Backport cli e2e 1.4#2292
Conversation
* start cli e2e work * First pass done * Install oadp-cli in CI image * Fix linting * Refactor code * Add kubectl * Add TEST_CLI option to Makefile and update testing documentation - Introduced TEST_CLI variable to control CLI-based backup/restore testing in the Makefile. - Updated TESTING.md to include information about the new TEST_CLI environment variable. - Added 'cli' label to the CLI test suite for better categorization. * Manual oadp-cli build and mv * Fail cli e2e if oadp not found * Add logging before cli commands execute * fix * Tabs not spaces
* Test Refactor OADP CLI installation in CI Dockerfile and e2e tests - Removed direct installation of oadp-cli from the Dockerfile. - Introduced a new CLISetup struct to handle the cloning, building, and installation of oadp-cli in a more structured manner. - Updated e2e tests to utilize the new CLISetup for verifying OADP CLI availability and configuration. * Debug * Manual build and push to path * Cleanup * Refactor CLI binary installation process in e2e tests - Changed the installation method from moving to copying the kubectl-oadp binary to /usr/local/bin. - Updated log messages to reflect the change in operation. - Improved error messages for better clarity on failure points. * Update
…shift#2049) Prevents tests from hanging indefinitely when streaming logs from object storage. Uses 5-minute timeout with 3 retries. Signed-off-by: Michal Pryc <mpryc@redhat.com> Co-authored-by: Claude <noreply@anthropic.com>
…t#2129) The CLI backup and restore "done" checks were missing the ReadyToStart phase, causing tests to incorrectly treat backups/restores as completed before they had started. This led to false PartiallyFailed results. Extract shared phase lists and helpers (IsBackupPhaseNotDone, IsRestorePhaseNotDone) to eliminate duplication between CLI and non-CLI code paths and prevent future phase drift. Co-authored-by: Joseph <jvaikath@redhat.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| velero.BackupPhaseQueued, | ||
| velero.BackupPhaseReadyToStart, |
There was a problem hiding this comment.
This backport should use string literals for Queued and ReadyToStart, matching the oadp-1.5 branch, instead of velero.BackupPhaseQueued and velero.BackupPhaseReadyToStart.
Per PARTNERS.md, OADP 1.4 ships Velero v1.14 and OADP 1.5 ships Velero v1.16. The BackupPhaseQueued / BackupPhaseReadyToStart constants were only added to Velero in velero-io/velero@9c09d04, which is on the Velero v1.18 line (OADP 1.6). They exist in neither v1.14 nor v1.16 — which is exactly why the oadp-1.5 branch uses string literals. On the oadp-1.4 (Velero v1.14) dependency line this will fail to compile.
| velero.BackupPhaseQueued, | |
| velero.BackupPhaseReadyToStart, | |
| "Queued", | |
| "ReadyToStart", |
Note
Responses generated with Claude
|
|
||
| func NewOADPCLISetup() *CLISetup { | ||
| return &CLISetup{ | ||
| repoURL: "https://github.com/migtools/oadp-cli.git", |
There was a problem hiding this comment.
The ci-Dockerfile pins the CLI clone to oadp-1.4, but NewOADPCLISetup() still clones migtools/oadp-cli without a branch during test runtime. Because the suite calls lib.NewOADPCLISetup().Install() in BeforeAll, this can build whatever the default branch of migtools/oadp-cli is, shadowing the pinned oadp-1.4 CLI. Please mirror the oadp-1.5 pattern by adding a repoBranch field set to "oadp-1.4" and cloning with --branch oadp-1.4 --depth 1 in cloneRepo.
Note
Responses generated with Claude
Codecov Report✅ All modified and coverable lines are covered by tests. Please upload reports for the commit 95cd27e to get more accurate results. Additional details and impacted files@@ Coverage Diff @@
## oadp-1.4 #2292 +/- ##
=========================================
Coverage 34.72% 34.72%
=========================================
Files 28 28
Lines 4538 4538
=========================================
Hits 1576 1576
Misses 2787 2787
Partials 175 175 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| // backupPhasesNotDone is the shared list of backup phases that indicate a backup is still in progress. | ||
| var backupPhasesNotDone = []velero.BackupPhase{ | ||
| velero.BackupPhaseNew, | ||
| "Queued", |
There was a problem hiding this comment.
queued probably doesn't exist for 1.4...but it shouldn't be a blocker to have this
There was a problem hiding this comment.
Yep, not a blocker. Doesn't have it.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kaovilai, NicholasYancey, shubham-pampattiwar, sseago The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@NicholasYancey: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
Why the changes were made
oadp-1.4 is missing CLI integration test coverage that exists on oadp-1.6. On oadp-1.6, Prow runs
e2e-test-cli-awsto verify backup/restore viakubectl oadp. oadp-1.4 never received this because the operator side was never backported.This PR backports the CLI e2e suite and
TEST_CLIMakefile support from oadp-1.6, pins the runtime oadp-cli clone to theoadp-1.4branch inci-Dockerfile, and refactors backup and restore phase checks into shared exported helpers to support the CLI test suite on the 1.4 dependency line.The corresponding Prow job addition in openshift/release is at openshift/release#81580. The presubmit is marked optional.
How to test the changes made
On a cluster with OADP installed: