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

feat(tests): isolated integration tests #4823

Merged
merged 29 commits into from
Nov 20, 2023
Merged

Conversation

pmalek
Copy link
Member

@pmalek pmalek commented Oct 11, 2023

What this PR does / why we need it:

This PR tries to introduce a concept of isolated integration tests. The basic principles of those are:


  • An extension of this new proposal could be a merge of the existing system of integration tests and the new one where based on the test Feature labels we'll be able to use a shared kong instance (installed once in kong namespace) or a dedicated one (installed per Feature in its own dedicated namespace)

Special notes for your reviewer:

Added a separate section in TESTING.md

So far the new suite is in the test/integration/isolated.


What do we gain by this change in terms of numbers?

Non scientific comparison of relevant test suites:

NOTE: this moved the tests around, from the above mentioned suite, to isolated-dbless-expression-router suite (which run for: 6m0s) but the change is that in the isolated suite tests can run in parallel without any interference so the more tests we add there the more benefits we'll see.

@codecov
Copy link

codecov bot commented Oct 11, 2023

Codecov Report

Attention: 32 lines in your changes are missing coverage. Please review.

Comparison is base (d12fbef) 77.9% compared to head (24da4ba) 76.8%.
Report is 26 commits behind head on main.

Files Patch % Lines
internal/util/test/controller_manager.go 42.4% 15 Missing and 4 partials ⚠️
internal/util/test/kustomize_consts.go 75.8% 4 Missing and 3 partials ⚠️
internal/cmd/rootcmd/run.go 0.0% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #4823     +/-   ##
=======================================
- Coverage   77.9%   76.8%   -1.2%     
=======================================
  Files        168     170      +2     
  Lines      18899   19050    +151     
=======================================
- Hits       14736   14637     -99     
- Misses      3336    3583    +247     
- Partials     827     830      +3     

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

@pmalek pmalek force-pushed the isolated-integration-tests branch 4 times, most recently from 1b24e8c to 3125c2f Compare October 13, 2023 08:57
@pmalek pmalek self-assigned this Oct 13, 2023
@pmalek pmalek added this to the Fixit 2023 milestone Oct 13, 2023
@pmalek pmalek force-pushed the isolated-integration-tests branch 5 times, most recently from c19c20e to bc288cb Compare October 13, 2023 16:50
@pmalek pmalek marked this pull request as ready for review October 13, 2023 16:50
@pmalek pmalek requested a review from a team as a code owner October 13, 2023 16:50
@pmalek pmalek force-pushed the isolated-integration-tests branch 3 times, most recently from 6bccf5e to 51364b4 Compare October 17, 2023 14:38
Copy link
Contributor

@czeslavo czeslavo left a comment

Choose a reason for hiding this comment

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

🎖️ I like the idea very much, especially the structure it can enforce and the flexibility it gives us in terms of injecting various dependencies into a test body. That promotes writing concise and well-readable test cases (or at least makes that easier).

I took a first pass of the review. Will take another tomorrow. 🖖

TESTING.md Outdated Show resolved Hide resolved
TESTING.md Outdated Show resolved Hide resolved
internal/cmd/rootcmd/signal.go Outdated Show resolved Hide resolved
internal/util/test/crds.go Outdated Show resolved Hide resolved
internal/util/test/repo.go Outdated Show resolved Hide resolved
internal/util/test/rbacs.go Outdated Show resolved Hide resolved
test/integration/consts/consts.go Outdated Show resolved Hide resolved
test/integration/consts/consts.go Outdated Show resolved Hide resolved
test/integration/isolated/examples_udproute_test.go Outdated Show resolved Hide resolved
@pmalek pmalek requested a review from czeslavo October 18, 2023 12:30
go.mod Outdated Show resolved Hide resolved
.github/workflows/_integration_tests.yaml Outdated Show resolved Hide resolved
internal/util/test/controller_manager.go Outdated Show resolved Hide resolved
internal/util/test/controller_manager.go Outdated Show resolved Hide resolved
internal/util/test/controller_manager.go Outdated Show resolved Hide resolved
test/internal/helpers/gatewayapi.go Show resolved Hide resolved
test/internal/helpers/gatewayapi.go Show resolved Hide resolved
test/internal/helpers/gatewayapi.go Show resolved Hide resolved
test/internal/helpers/gatewayapi.go Outdated Show resolved Hide resolved
test/internal/helpers/gatewayapi.go Outdated Show resolved Hide resolved
programmer04
programmer04 previously approved these changes Nov 15, 2023
test/integration/isolated/suite_test.go Show resolved Hide resolved
Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

This looks great, @pmalek!

I have one question though - we are running in isolation the UDPRoute tests only. Which other tests do you think we can run in such an isolated environment? Do we have something we should avoid?

test/conformance/suite_test.go Show resolved Hide resolved
test/integration/isolated/name.go Outdated Show resolved Hide resolved
test/internal/testlabels/labels.go Outdated Show resolved Hide resolved
@pmalek
Copy link
Member Author

pmalek commented Nov 15, 2023

@mlavacca

I have one question though - we are running in isolation the UDPRoute tests only. Which other tests do you think we can run in such an isolated environment? Do we have something we should avoid?

I don't have everything written down because at the time I put up this PR I wasn't sure everyone would be on board with this approach but hey! It seems now that we're mostly OK with this we can plan ahead.

My very high level plan for this is:

@mlavacca
Copy link
Member

@mlavacca

I have one question though - we are running in isolation the UDPRoute tests only. Which other tests do you think we can run in such an isolated environment? Do we have something we should avoid?

I don't have everything written down because at the time I put up this PR I wasn't sure everyone would be on board with this approach but hey! It seems now that we're mostly OK with this we can plan ahead.

My very high level plan for this is:

I like this plan, sounds good to me 👍

mlavacca
mlavacca previously approved these changes Nov 16, 2023
Copy link
Member

@mlavacca mlavacca left a comment

Choose a reason for hiding this comment

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

🚀

programmer04
programmer04 previously approved these changes Nov 16, 2023
@pmalek pmalek mentioned this pull request Nov 16, 2023
2 tasks
@pmalek
Copy link
Member Author

pmalek commented Nov 16, 2023

@randmonkey and @programmer04 Feel free to respond to the still opened conversations and close them if you feel they have been addressed.

randmonkey
randmonkey previously approved these changes Nov 17, 2023
tao12345666333
tao12345666333 previously approved these changes Nov 17, 2023
Co-authored-by: Jakub Warczarek <jakub.warczarek@konghq.com>
@pmalek
Copy link
Member Author

pmalek commented Nov 20, 2023

#4847 can be considered a follow up to this PR.

When this gets merged we're already going to use a version of e2e-framework which will contain the fix.


Another follow up could be #4849 which removes the hardcoded FF and would make tests read those from env (as it's currently the case in the standard integration test suite).

@programmer04 programmer04 changed the title Isolated integration tests feat(tests): isolated integration tests Nov 20, 2023
@programmer04 programmer04 merged commit 63253d7 into main Nov 20, 2023
36 of 37 checks passed
@programmer04 programmer04 deleted the isolated-integration-tests branch November 20, 2023 13:59
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.

6 participants