Skip to content

Add v1alpha2 CLI e2e test suite#1006

Open
efiacor wants to merge 3 commits into
kptdev:mainfrom
Nordix:cli_e2e_v1alpha2
Open

Add v1alpha2 CLI e2e test suite#1006
efiacor wants to merge 3 commits into
kptdev:mainfrom
Nordix:cli_e2e_v1alpha2

Conversation

@efiacor
Copy link
Copy Markdown
Contributor

@efiacor efiacor commented May 26, 2026

Title

Add v1alpha2 CLI e2e test suite


Description

  • What changed: Added a parallel CLI e2e test suite targeting v1alpha2 CRD-based PackageRevisions. New test entry point (TestPorchV1Alpha2), 8 golden-file test cases under testdata-v1alpha2/, and a make test-e2e-cli-v1alpha2 target.
  • Why it's needed: v1alpha2 is the migration target and all CLI commands now have v1alpha2 dispatch. We need e2e coverage for the CLI path exercising v1alpha2 CRDs end-to-end, separate from the existing v1alpha1 suite so v1alpha1 can be cleanly stripped later.
  • How it works: Reuses the existing CliTestSuite framework unchanged. A separate testdata-v1alpha2/ directory holds test cases that pass --api-version=v1alpha2 to all rpkg commands and --v1alpha2 to repo register. When v1alpha1 is dropped, delete testdata/ + cli_e2e_test.go and rename testdata-v1alpha2/testdata/.

Related Issue(s)

  • N/A

Type of Change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Documentation
  • Tests
  • Other: ________

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

Testing Instructions (Optional)

  1. make run-in-kind-v1alpha2 to deploy porch with v1alpha2 CRD support
  2. UPDATE_GOLDEN_FILES=1 E2E=1 go test -v -failfast -run TestPorchV1Alpha2 ./test/e2e/cli to capture actual golden output
  3. Re-run without UPDATE_GOLDEN_FILES to verify tests pass

Additional Notes (Optional)

  • Known issues: Golden file expected values are initial estimates based on code analysis. First run against a live cluster with UPDATE_GOLDEN_FILES=1 is required to capture actual output (UIDs, timestamps, exact error strings).
  • Further improvements: Add rpkg-nested-package and rpkg-unready test cases once confirmed applicable to v1alpha2.
  • Review notes: push/pull commands pass --api-version=v1alpha2 for UX consistency even though it's currently a no-op (PRR stays at v1alpha1).

AI Disclosure

  • I have used AI in the creation of this PR.

If so, please describe how:

  • Kiro to scaffold the test suite structure, generate golden-file test cases, and write the Makefile target.
  • The author has fully verified all code.

@efiacor efiacor self-assigned this May 26, 2026
Copilot AI review requested due to automatic review settings May 26, 2026 07:33
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a parallel CLI end-to-end test suite that exercises the porchctl rpkg v1alpha2 dispatch path against v1alpha2 CRD-backed PackageRevision objects, using golden-file test cases and a dedicated make target.

Changes:

  • Introduces a new v1alpha2 CLI e2e test entry point (TestPorchV1Alpha2) that runs against testdata-v1alpha2/.
  • Adds 8 new golden-file CLI e2e scenarios under test/e2e/cli/testdata-v1alpha2/.
  • Adds make test-e2e-cli-v1alpha2 to run only the v1alpha2 CLI e2e suite.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
test/e2e/cli/cli_e2e_v1alpha2_test.go New v1alpha2 CLI e2e test entry point targeting testdata-v1alpha2/.
test/e2e/cli/testdata-v1alpha2/rpkg-clone/config.yaml v1alpha2 golden test for rpkg clone flows.
test/e2e/cli/testdata-v1alpha2/rpkg-copy/config.yaml v1alpha2 golden test for rpkg copy flow.
test/e2e/cli/testdata-v1alpha2/rpkg-get/config.yaml v1alpha2 golden test for rpkg get and --show-kptfile behaviors.
test/e2e/cli/testdata-v1alpha2/rpkg-init/config.yaml v1alpha2 golden test for rpkg init including duplicate-package error case.
test/e2e/cli/testdata-v1alpha2/rpkg-init-deploy/config.yaml v1alpha2 golden test for deployment repos + rpkg init.
test/e2e/cli/testdata-v1alpha2/rpkg-lifecycle/config.yaml v1alpha2 golden test for propose/approve/reject/delete lifecycle scenarios.
test/e2e/cli/testdata-v1alpha2/rpkg-push/config.yaml v1alpha2 golden test for pull/edit/push workflow.
test/e2e/cli/testdata-v1alpha2/rpkg-upgrade/config.yaml v1alpha2 golden test for upstream upgrade workflow.
make/testing.mk Adds test-e2e-cli-v1alpha2 make target to run only the v1alpha2 suite.

Comment thread test/e2e/cli-v1alpha2/cli_e2e_test.go
Comment thread test/e2e/cli-v1alpha2/testdata/rpkg-init/config.yaml Outdated
Comment thread test/e2e/cli-v1alpha2/testdata/rpkg-clone/config.yaml Outdated
Comment thread test/e2e/cli/cli_e2e_v1alpha2_test.go Outdated
Comment thread make/testing.mk Outdated
@efiacor efiacor marked this pull request as draft May 26, 2026 09:53
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 3c9d426 to e81e3e4 Compare May 26, 2026 10:54
Copilot AI review requested due to automatic review settings May 26, 2026 16:37
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Comment thread test/e2e/cli-v1alpha2/testdata/rpkg-clone/config.yaml
Comment thread test/e2e/cli/cluster.go Outdated
Comment thread test/e2e/cli/cluster.go Outdated
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from e0cc806 to e3ff325 Compare May 26, 2026 17:10
Copilot AI review requested due to automatic review settings May 26, 2026 21:17
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 406b188 to 3630aad Compare May 26, 2026 21:17
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.

Comment thread test/e2e/cli/cluster.go Outdated
Comment thread test/e2e/cli-v1alpha2/cli_e2e_test.go
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 3630aad to 256df6d Compare May 27, 2026 08:30
Copilot AI review requested due to automatic review settings May 27, 2026 09:18
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 256df6d to 142121f Compare May 27, 2026 09:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.

Comment thread test/e2e/cli-v1alpha2/testdata/rpkg-clone/config.yaml
Comment thread test/e2e/cli/suite.go Outdated
Comment thread test/e2e/cli/cluster.go Outdated
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 142121f to 69b440d Compare May 27, 2026 09:43
Copilot AI review requested due to automatic review settings May 27, 2026 10:49
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 69b440d to 7a612d0 Compare May 27, 2026 10:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 22 out of 22 changed files in this pull request and generated 5 comments.

Comment thread test/e2e/cli/suite.go Outdated
Comment thread test/e2e/cli/suite.go
Comment thread test/e2e/cli/cluster.go Outdated
Comment thread test/e2e/cli/cluster.go
Comment thread test/e2e/cli-v1alpha2/cli_e2e_test.go
@efiacor efiacor marked this pull request as ready for review June 2, 2026 09:39
efiacor added 3 commits June 3, 2026 13:28
Add a standalone CLI e2e test suite for v1alpha2 in test/e2e/cli-v1alpha2/.
Runs in complete isolation from the v1alpha1 CLI tests with its own CI job.

Reuses the existing CliTestSuite framework from test/e2e/cli/ via import.
Test cases exercise all v1alpha2-dispatched CLI commands end-to-end:
- rpkg-init, rpkg-lifecycle, rpkg-get, rpkg-clone, rpkg-copy
- rpkg-push, rpkg-upgrade, rpkg-init-deploy

CI: added matrix entry 'Porch CLI E2E Tests (v1alpha2)' using
run-in-kind-v1alpha2 deployment target.

Makefile: added test-e2e-cli-v1alpha2 target.

Golden file values are initial estimates; run with UPDATE_GOLDEN_FILES=1
against a live v1alpha2 cluster to capture actual output.

Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
- Add waitForReady/waitForPublished config fields for async v1alpha2 ops
- Add KubectlWaitForPackageRevisionReady with generation + PRR visibility checks
- Add KubectlWaitForPackageRevisionPublished for revision number resolution
- Add KubectlDeleteNamespaceV1Alpha2 with v1alpha2 finalizer removal
- Add DeleteNamespaceFunc to CliTestSuite for v1alpha2 cleanup override
- Strip uid from yaml normalizer (dynamic field like resourceVersion)
- Update rpkg-clone, rpkg-copy, rpkg-init, rpkg-init-deploy, rpkg-push, rpkg-upgrade
- Add rpkg-nested-package test case
- Skip rpkg-get (revision/latest display gaps), rpkg-lifecycle (webhook gap),
  rpkg-push-on-render-failure, rpkg-unready (server-side render semantics)

Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
Signed-off-by: Fiachra Corcoran <fiachra.corcoran@est.tech>
@efiacor efiacor force-pushed the cli_e2e_v1alpha2 branch from 7a612d0 to bb137b9 Compare June 3, 2026 12:42
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 3, 2026

Deploy Preview for kpt-porch ready!

Name Link
🔨 Latest commit bb137b9
🔍 Latest deploy log https://app.netlify.com/projects/kpt-porch/deploys/6a20215209bb6a0008922135
😎 Deploy Preview https://deploy-preview-1006--kpt-porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants