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

test(e2e): run all test/e2e tests #8822

Merged
merged 5 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build-test-distribute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -261,10 +261,12 @@ jobs:
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "multizone", "arch": "arm64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "kubernetes", "arch": "arm64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "universal", "arch": "arm64"},
{"k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "gatewayapi", "arch": "amd64"},
{"cniNetworkPlugin": "calico", "k8sVersion": "${{ env.K8S_MAX_VERSION }}", "target": "multizone", "arch": "amd64"}
]
}
}
# You can modify the include to run one of test suites on PRs (though you'd need to then remove it)
OVERRIDE_JQ_CMD: |-
.test_e2e = false
| .test_e2e_env.include = []
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ jobs:
e2e:
# use the runner from the map, if the runner is circleci or '' then use ubuntu-latest
runs-on: ${{ contains(fromJSON('["circleci", ""]'), fromJSON(inputs.runnersByArch)[fromJSON(inputs.matrix).arch]) && 'ubuntu-latest' || fromJSON(inputs.runnersByArch)[fromJSON(inputs.matrix).arch]}}
strategy:
fail-fast: false
matrix:
parallelRunnerId: ${{ fromJSON((fromJSON(inputs.matrix).parallelism == '3' && '[0, 1, 2]') || '[0]') }}
steps:
- name: "Print parameters"
id: eval-params
Expand Down Expand Up @@ -132,7 +136,7 @@ jobs:
fi

if [[ "${{ env.E2E_PARAM_TARGET }}" == "" ]]; then
export GINKGO_E2E_LABEL_FILTERS="job-$CIRCLE_NODE_INDEX"
export GINKGO_E2E_LABEL_FILTERS="job-${{ matrix.parallelRunnerId }}"
fi
env
if [[ "${{ env.E2E_PARAM_TARGET }}" != "" ]]; then
Expand Down
9 changes: 9 additions & 0 deletions mk/e2e.new.mk
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,15 @@ test/e2e-kubernetes: $(E2E_DEPS_TARGETS) $(E2E_K8S_BIN_DEPS) ## Run kubernetes e
$(E2E_ENV_VARS) $(GINKGO_TEST_E2E) $(KUBE_E2E_PKG_LIST) || (ret=$$?; $(MAKE) test/e2e/k8s/stop/cluster/kuma-1 && exit $$ret)
$(MAKE) test/e2e/k8s/stop/cluster/kuma-1

.PHONY: test/e2e-gatewayapi
test/e2e-gatewayapi: $(E2E_DEPS_TARGETS) $(E2E_K8S_BIN_DEPS) ## Run kubernetes e2e tests. Use DEBUG=1 to more easily find issues
$(MAKE) docker/tag
$(MAKE) test/e2e/k8s/start/cluster/kuma-1
$(MAKE) test/e2e/k8s/wait/kuma-1
$(MAKE) test/e2e/k8s/load/images/kuma-1
$(E2E_ENV_VARS) $(GINKGO_TEST_E2E) ./test/e2e_env/gatewayapi || (ret=$$?; $(MAKE) test/e2e/k8s/stop/cluster/kuma-1 && exit $$ret)
$(MAKE) test/e2e/k8s/stop/cluster/kuma-1

.PHONY: test/e2e-universal
test/e2e-universal: $(E2E_DEPS_TARGETS) $(E2E_UNIVERSAL_BIN_DEPS) k3d/network/create ## Run universal e2e tests. Use DEBUG=1 to more easily find issues
$(MAKE) docker/tag/test
Expand Down
8 changes: 7 additions & 1 deletion test/e2e/ebpf/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ func TestE2E(t *testing.T) {
test.RunE2ESpecs(t, "E2E Ebpf Suite")
}

var _ = Describe("Test Cleanup eBPF", Label("job-0"), Label("arm-not-supported"), Label("legacy-k3s-not-supported"), ebpf.CleanupEbpfConfigFromNode, Ordered)
// Tests fail on github CI with:
//
// Type: "Warning",
// Object: "Pod/test-server-599d497f-t4g5q",
// Reason: "Failed",
// Message: "Error: failed to generate container \"596f3396a0f42c6a554a95d6b1599d7ed3682ba2f95ae317b307c493891dd084\" spec: failed to generate spec: path \"/sys/fs/bpf\" is mounted on \"/sys\" but it is not a shared mount",
var _ = PDescribe("Test Cleanup eBPF", Label("job-0"), Label("arm-not-supported"), Label("legacy-k3s-not-supported"), ebpf.CleanupEbpfConfigFromNode, Ordered)
11 changes: 0 additions & 11 deletions test/e2e/gateway/e2e_suite_test.go

This file was deleted.

4 changes: 3 additions & 1 deletion test/e2e/helm/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ func TestE2E(t *testing.T) {
var (
_ = Describe("Test Zone and Global with Helm chart", Label("job-2"), helm.ZoneAndGlobalWithHelmChart, Ordered)
_ = Describe("Test Zone and Global universal mode with Helm chart", Label("job-0"), helm.ZoneAndGlobalInUniversalModeWithHelmChart, Ordered)
_ = Describe("Test Global and Zone universal mode with Helm chart", Label("job-0"), helm.GlobalAndZoneInUniversalModeWithHelmChart, Ordered)
// Skipped as it fails with: error while running command: exit status 1; Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ServiceAccount "kuma-control-plane" in namespace "kuma-system" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-name" must equal "kuma-c0vo8o": current value is "kuma-8yy3uv"
// Likely something needs to be improved to be able to run this test
_ = PDescribe("Test Global and Zone universal mode with Helm chart", Label("job-0"), helm.GlobalAndZoneInUniversalModeWithHelmChart, Ordered)
_ = Describe("Test App deployment with Helm chart", Label("job-2"), helm.AppDeploymentWithHelmChart)
_ = Describe("Test upgrading with Helm chart", Label("job-2"), helm.UpgradingWithHelmChart)
)
20 changes: 9 additions & 11 deletions test/e2e/helm/kuma_helm_deploy_global_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,23 +169,21 @@ interCp:
})
})

It("should execute admin operations on Global CP", func() {
// Seems like admin operations are broken:
// error while running command: exit status 1; Error: Could not execute admin operation (could not send XDSConfigRequest: Resource not found: type="Dataplane" name="demo-client-84b6dc7cb8-wq44w.kuma-system" mesh="default")
lahabana marked this conversation as resolved.
Show resolved Hide resolved
PIt("should execute admin operations on Global CP", func() {
// given DP available on Global CP
Eventually(func(g Gomega) {
dataplanes, err := c1.GetKumactlOptions().KumactlList("dataplanes", "default")
g.Expect(err).ToNot(HaveOccurred())
// Dataplane names are generated, so we check for a partial match.
g.Expect(dataplanes).Should(ContainElement(ContainSubstring("demo-client")))
for _, dpName := range dataplanes {
if strings.Contains(dpName, "demo-client") {
_, err = c1.GetKumactlOptions().RunKumactlAndGetOutput("inspect", "dataplane", dpName, "--type", "config-dump")
Expect(err).ToNot(HaveOccurred())
}
}
}, "30s", "250ms").Should(Succeed())

podName, err := PodNameOfApp(c2, "demo-client", TestNamespace)
Expect(err).ToNot(HaveOccurred())
dataplaneName := fmt.Sprintf("%s.%s.%s.%s", Kuma2, podName, TestNamespace, Config.KumaNamespace)

// when
_, err = c1.GetKumactlOptions().RunKumactlAndGetOutput("inspect", "dataplane", dataplaneName, "--type", "config-dump")

// then
Expect(err).ToNot(HaveOccurred())
})
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package gatewayapi_test

import (
"os"
"testing"

"github.com/gruntwork-io/terratest/modules/k8s"
Expand Down Expand Up @@ -35,10 +34,6 @@ var implementation = conformanceapis.Implementation{
// TestConformance runs as a `testing` test and not Ginkgo so we have to use an
// explicit `g` to use Gomega.
func TestConformance(t *testing.T) {
// this is like job-0
if os.Getenv("CIRCLE_NODE_INDEX") != "" && os.Getenv("CIRCLE_NODE_INDEX") != "0" {
t.Skip("Conformance tests are only run on job 0")
}
if Config.IPV6 {
t.Skip("On IPv6 we run on kind which doesn't support load balancers")
}
Expand Down