Skip to content

[feat i2g]setup e2e test for migration tool#4739

Open
shuqz wants to merge 2 commits into
kubernetes-sigs:mainfrom
shuqz:i2g-e2e
Open

[feat i2g]setup e2e test for migration tool#4739
shuqz wants to merge 2 commits into
kubernetes-sigs:mainfrom
shuqz:i2g-e2e

Conversation

@shuqz
Copy link
Copy Markdown
Collaborator

@shuqz shuqz commented May 14, 2026

Description

  • add a vanilla test case, which just compares generated gateway manifest with expected, supposed to be a fast fail is anything changes in migration tool logic
  • add an end-to-end test for the lbc-migrate tool, validating the full ingress-to-gateway migration workflow: (i will add more test cases later but now it is one ingress manifest in builder.go)
  1. creates an IngressGroup with 2 members (3 backend services, health checks, user tags)
    and verifies the ingress ALB serves traffic correctly
  2. runs lbc-migrate --dry-run, applies generated manifests, verifies the
    gateway.k8s.aws/dry-run annotation prevents ALB creation, and validates the dry-run plan annotation
  3. removes the dry-run annotation, waits for the gateway ALB to provision, then compares:
    - Listener ports and protocols
    - Listener rules compared in priority order; conditions within each rule matched by field type
    - Target group count and types
    - Tags on LB, listener rules, and target groups (user tags + migrated-from tag)
    - Default rule action types
  4. Traffic verification — confirms identical HTTP responses from both ALBs
  5. Resource count verification — asserts exactly the expected number of Gateway, HTTPRoute,
    LoadBalancerConfiguration, TargetGroupConfiguration, and ListenerRuleConfiguration resources are created

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
------------------------------
ingress to gateway migration should produce expected gateway manifests from file input
/Users/shuqz/go/src/github.com/sigs.k8s.io/shuqz-aws-load-balancer-controller/test/e2e/ingress2gateway/migration_test.go:60
  STEP: setup sandbox namespace @ 05/14/26 16:34:47.636
  STEP: running lbc-migrate with --file input @ 05/14/26 16:34:49.482
  STEP: comparing output against golden file @ 05/14/26 16:34:49.608
  STEP: teardown sandbox namespace @ 05/14/26 16:34:49.613
• [8.152 seconds]
------------------------------
ingress to gateway migration should migrate an IngressGroup with multiple paths, tags, and health checks through dry-run and full cutover
/Users/shuqz/go/src/github.com/sigs.k8s.io/shuqz-aws-load-balancer-controller/test/e2e/ingress2gateway/migration_test.go:83
  STEP: setup sandbox namespace @ 05/14/26 16:34:55.788
  STEP: creating backend services @ 05/14/26 16:34:55.827
  STEP: creating IngressGroup (2 members) @ 05/14/26 16:34:58.143
  STEP: waiting for Ingress ALB to be provisioned @ 05/14/26 16:34:58.207
  {"level":"info","ts":1778801702.261599,"msg":"ingress DNS populated","dns":"k8s-e2emigi2ge2eaf00b-3ce3159a2f-1979745003.us-west-2.elb.amazonaws.com"}
  {"level":"info","ts":1778801702.478559,"msg":"waiting for ingress ALB to be available"}
  STEP: verifying traffic to ingress ALB @ 05/14/26 16:38:04.384
  {"level":"info","ts":1778801884.3848152,"msg":"waiting for LB DNS to be resolvable","dns":"k8s-e2emigi2ge2eaf00b-3ce3159a2f-1979745003.us-west-2.elb.amazonaws.com"}
  STEP: verifying dry-run-plan annotation on primary member only @ 05/14/26 16:38:04.506
  STEP: running lbc-migrate tool @ 05/14/26 16:38:04.607
  STEP: verifying migration output files exist @ 05/14/26 16:38:06.741
  STEP: applying generated Gateway manifests (dry-run mode) @ 05/14/26 16:38:06.742
  STEP: verifying generated resource counts @ 05/14/26 16:38:08.302
  STEP: verifying Gateway has dry-run annotation @ 05/14/26 16:38:08.466
  STEP: waiting for Gateway dry-run-plan annotation @ 05/14/26 16:38:08.466
  STEP: verifying NO ALB is created for dry-run Gateway @ 05/14/26 16:38:08.484
  STEP: removing dry-run annotation to trigger real reconciliation @ 05/14/26 16:39:08.485
  STEP: waiting for Gateway ALB to be provisioned @ 05/14/26 16:39:08.528
  {"level":"info","ts":1778801952.7843359,"msg":"waiting for gateway ALB to be available"}
  STEP: comparing ALB configurations: listeners, rules, and target groups @ 05/14/26 16:41:59.41
  STEP: comparing ALB configurations: tags @ 05/14/26 16:41:59.663
  STEP: verifying traffic to Gateway ALB @ 05/14/26 16:42:00.281
  {"level":"info","ts":1778802120.281466,"msg":"waiting for LB DNS to be resolvable","dns":"k8s-i2ge2eaf-e2emiggr-f36dbdb3cd-1457840818.us-west-2.elb.amazonaws.com"}
  STEP: teardown sandbox namespace @ 05/14/26 16:42:00.394
• [513.037 seconds]
------------------------------

Ran 2 of 2 Specs in 521.202 seconds
SUCCESS! -- 2 Passed | 0 Failed | 0 Pending | 0 Skipped
PASS


  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: shuqz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 14, 2026
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 14, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.23%. Comparing base (22cdb42) to head (49fcd0d).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4739      +/-   ##
==========================================
+ Coverage   56.09%   56.23%   +0.13%     
==========================================
  Files         388      389       +1     
  Lines       30932    31043     +111     
==========================================
+ Hits        17352    17456     +104     
- Misses      12566    12575       +9     
+ Partials     1014     1012       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants