Skip to content
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

Consolidate E2E environment variables with integration varaibles #4727

Merged
merged 19 commits into from
Oct 23, 2023

Conversation

rainest
Copy link
Contributor

@rainest rainest commented Sep 25, 2023

What this PR does / why we need it:

Source E2E test environment setup variables from the same utility package used for integration. Align E2E variables with their integration counterparts.

E2E now uses separate TEST_(KONG|CONTROLLER)_(IMAGE|TAG) variables where it previously used a single TEST_KONG(_CONTROLLER)_IMAGE_OVERRIDE variable with both the repo and tag.

CI inputs still use a single value that the CI scripts split.

Which issue this PR fixes:

Fix #4593

Special notes for your reviewer:

GKE-related variables are defined by the related KTF module, and have not been changed.

License data was also using a KTF-defined variable from the Kong addon, although it isn't actually using the Kong addon. Integration does use the same var AFAIK, however, since it does use the Kong addon. I left this unchanged.

https://github.com/rainest/kubernetes-ingress-controller/actions/runs/6305128682/job/17117913357 and https://github.com/rainest/kubernetes-ingress-controller/actions/runs/6305130237/job/17119050768 have debug-enabled CI runs on a fork. GKE and Enterprise license failures are expected for the fork.

This is mostly to confirm the split script is populating the expected variables, since those variable names actually changed in E2E:

2023-09-25T22:23:58.5265037Z   TEST_CONTROLLER_IMAGE: kong/kubernetes-ingress-controller
2023-09-25T22:23:58.5265441Z   TEST_CONTROLLER_TAG: sha-d140eb7
2023-09-25T22:23:58.5265766Z   TEST_KONG_LOAD_IMAGES: true
2023-09-25T22:23:58.5266116Z   TEST_KONG_IMAGE: kong/kong-gateway-dev
2023-09-25T22:23:58.5266440Z   TEST_KONG_TAG: nightly

Other variables just got redefined at a new location.

PR Readiness Checklist:

Complete these before marking the PR as ready to review:

  • the CHANGELOG.md release notes have been updated to reflect any significant (and particularly user-facing) changes introduced by this PR

@rainest rainest requested a review from a team as a code owner September 25, 2023 23:06
@rainest rainest enabled auto-merge (squash) September 25, 2023 23:07
@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (93c1a9c) 77.6% compared to head (dca814a) 77.8%.
Report is 23 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #4727     +/-   ##
=======================================
+ Coverage   77.6%   77.8%   +0.1%     
=======================================
  Files        164     165      +1     
  Lines      18453   18477     +24     
=======================================
+ Hits       14331   14386     +55     
+ Misses      3299    3273     -26     
+ Partials     823     818      -5     

see 24 files with indirect coverage changes

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

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

One nit and conflicts to resolve.

test/e2e/features_test.go Show resolved Hide resolved
@rainest rainest requested a review from pmalek October 13, 2023 21:53
@rainest rainest added the ci/run-e2e Trigger e2e test run from PR label Oct 18, 2023
@team-k8s-bot
Copy link
Collaborator

E2E (targeted) tests with KIND-based clusters were started at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6566314300

@team-k8s-bot team-k8s-bot removed the ci/run-e2e Trigger e2e test run from PR label Oct 18, 2023
@rainest
Copy link
Contributor Author

rainest commented Oct 18, 2023

More conflicts. #4766 removed some generic E2E utilities that weren't specific to <3.4 gates. While we chose a required version newer than any of the extant gates now, we probably will have similar gates in the future, so keeping the generic functions around with nolint:unused.

Copy link
Contributor

@randmonkey randmonkey left a comment

Choose a reason for hiding this comment

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

The nolint:unused comment did not take its effect. Is there any difference between the local make lint and lint job on the CI ?

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

In order to prevent the linter fail you'd need to add

, "-U1000" to

checks = ["all", "-ST1000", "-ST1005"]

We run both staticcheck and golangci-lint as part of lint and they don't take into account the same code comment markers.

.github/workflows/_e2e_tests.yaml Show resolved Hide resolved
@pmalek
Copy link
Member

pmalek commented Oct 19, 2023

@rainest rainest added the ci/run-e2e Trigger e2e test run from PR label Oct 20, 2023
@team-k8s-bot
Copy link
Collaborator

E2E (targeted) tests with KIND-based clusters were started at https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6592767672

@team-k8s-bot team-k8s-bot removed the ci/run-e2e Trigger e2e test run from PR label Oct 20, 2023
@rainest
Copy link
Contributor Author

rainest commented Oct 20, 2023

https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6592767672/job/17914168070 Istio run now happy. Do we have a way to run GKE tests off a branch? It hopefully just needs the same thing with a static controller image (I'd neglected to add the new input splitter to both it and Istio), but https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6592767672 just skips it.

It shouldn't have additional complications given that it's just the main E2E job with GKE flipped on, but if we can run it, may as well.

Edit: https://github.com/Kong/kubernetes-ingress-controller/actions/runs/6592883775 the nightly job has a branch dispatch option, so that should get it and anything else that differs from the label variant.

@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest temporarily deployed to gcloud October 20, 2023 21:32 — with GitHub Actions Inactive
@rainest rainest merged commit d8bbfd9 into main Oct 23, 2023
344 checks passed
@rainest rainest deleted the chore/e2e-env branch October 23, 2023 02:59
rainest added a commit that referenced this pull request Oct 24, 2023
* chore(e2e) use testenv.ClusterVersion()

* chore(e2e) use testenv image/tag overrides

* chore(e2e) use testenv pull credentials

* chore(e2e) use testenv cluster info

* chore(e2e) use testenv image load flag

* chore(e2e) move Github env into testenv

* chore(e2e) remove e2e-specific envvars

* chore(e2e) update workflow envvars
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unify environment variables in tests
4 participants