Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Restore Kubernetes Integration tests #25624

Merged
merged 5 commits into from
May 12, 2023
Merged

Restore Kubernetes Integration tests #25624

merged 5 commits into from
May 12, 2023

Conversation

tigrato
Copy link
Contributor

@tigrato tigrato commented May 4, 2023

This PR re-enables the Kubernetes integration tests using a KinD (Kubernetes in Docker) cluster.

New steps have been introduced to GitHub's Integrations (Non-Root) Action that configures the KinD cluster using
helm/kind-action and do some network configurations allowing the container where tests run to connect to the KinD control plane.

This PR also fixes some of the tests and fixes a bug that affected joining operations when the target service was a legacy Kubernetes proxy.

Some improvements will be introduced in future patches to improve the logic and reduce the time required for the tests to run.

Fixes #25539

@tigrato tigrato force-pushed the tigrato/enable-kind branch 19 times, most recently from f0eeb9d to 2fbbbe8 Compare May 5, 2023 11:30
@tigrato tigrato closed this May 5, 2023
@tigrato tigrato force-pushed the tigrato/enable-kind branch from 2fbbbe8 to 7be72ff Compare May 5, 2023 11:31
@tigrato tigrato reopened this May 5, 2023
@tigrato tigrato force-pushed the tigrato/enable-kind branch 8 times, most recently from a742c41 to ceb7b04 Compare May 5, 2023 12:48
INTEGRATION_KUBE_REGEX := ^.*Kube.*
.PHONY: integration-root
integration-kube: FLAGS ?= -v -race
integration-kube: PACKAGES = $(shell go list ./... | grep 'integration\([^s]\|$$\)')
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use grep -w integration - that ends up picking the same set of package as the more complicated regex. But I'm not sure if this is future-proofing against some other package names. I notice there is an integrationv1 package that gets selected since it is within an integration package that might otherwise have been missed with grep -w.

...

Ah, I see it was copied from the integration-root target and a variation of the integration target. I wonder what the logic should be. Perhaps we should just be doing go list ./integration/... - lib/auth/integration seems to be the integration service and nothing to do with integration tests, and integrations/lib/testing/integration seems to be an integration test that make integration skips deliberately.

Any idea exactly which tests should be run here?

Copy link
Contributor

Choose a reason for hiding this comment

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

The thought occurred to me just now that we should probably be using build tags to determine which tests to run rather than grep. Perhaps there is a reason we do not do that already, so maybe we just stick to the current way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the issue about using build tags is that it requires special configuration on the editor in order to LSP load those files correctly and local testing becomes more difficult.

tigrato added 3 commits May 11, 2023 11:15
This PR re-enables the Kubernetes integrations tests using a KinD
(Kubernetes in Docker) cluster.

New steps have been introduced to GitHub's Integrations (Non-Root)
Action that configure the KinD cluster using
[`helm/kind-action`](https://github.com/helm/kind-action) and do some
network configurations allowing the container where tests run to connect
to the KinD control plane.

This PR also fixes some of the tests and fixes a bug that affected
joining operations when the target service was a legacy kubernetes
proxy. Some improvements will be introduced in future patches to improve
the logic and reduce the time required for the tests to run.

Fixes #25539
@tigrato tigrato force-pushed the tigrato/enable-kind branch 3 times, most recently from 49b9af9 to 82b08c4 Compare May 12, 2023 13:39
@tigrato tigrato force-pushed the tigrato/enable-kind branch from 82b08c4 to ec37d32 Compare May 12, 2023 13:51
@tigrato tigrato enabled auto-merge May 12, 2023 16:25
@tigrato tigrato added this pull request to the merge queue May 12, 2023
Merged via the queue into master with commit 32d8d5f May 12, 2023
@tigrato tigrato deleted the tigrato/enable-kind branch May 12, 2023 16:59
@public-teleport-github-review-bot

@tigrato See the table below for backport results.

Branch Result
branch/v13 Failed

tigrato added a commit that referenced this pull request Jun 27, 2023
This fixes an issue with verifying the cluster as being local when
legacy proxy mode is used. Previsouly to this commit, all clusters in
legacy mode were considered non-local which results in inconsistent
behavior.

This PR partially backports #25624
github-merge-queue bot pushed a commit that referenced this pull request Jun 27, 2023
This fixes an issue with verifying the cluster as being local when
legacy proxy mode is used. Previsouly to this commit, all clusters in
legacy mode were considered non-local which results in inconsistent
behavior.

This PR partially backports #25624
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restore Kubernetes Integration tests
4 participants