From f6b9244db57cc73cfbe2377e9a1787cf77ce612e Mon Sep 17 00:00:00 2001 From: cuisongliu Date: Thu, 3 Oct 2024 00:20:43 +0800 Subject: [PATCH] test(main): add e2e test and controller test Signed-off-by: cuisongliu --- .github/workflows/test.yml | 6 +++--- e2e/automq_cluster_test.go | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b52fbe6..47643ef 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,9 +37,9 @@ jobs: - name: Verify sealos run: | wget https://github.com/labring/sealos/releases/download/v5.0.0/sealos_5.0.0_linux_amd64.tar.gz - tar -zxvf sealos_5.0.0_linux_amd64.tar.gz /tmp/sealos - sudo chmod a+x /tmp/sealos - sudo mv /tmp/sealos /usr/bin/ + tar -zxvf sealos_5.0.0_linux_amd64.tar.gz sealos + sudo chmod a+x sealos + sudo mv sealos /usr/bin/ sudo sealos version - name: Remove containerd && docker uses: labring/sealos-action@v0.0.7 diff --git a/e2e/automq_cluster_test.go b/e2e/automq_cluster_test.go index a54f94a..e2aec64 100644 --- a/e2e/automq_cluster_test.go +++ b/e2e/automq_cluster_test.go @@ -132,7 +132,7 @@ var _ = BeforeSuite(func() { usingCluster := false By("bootstrapping test environment") testEnv = &envtest.Environment{ - CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")}, + CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")}, ErrorIfCRDPathMissing: true, UseExistingCluster: &usingCluster, // The BinaryAssetsDirectory is only required if you want to run the tests directly @@ -140,7 +140,7 @@ var _ = BeforeSuite(func() { // default path defined in controller-runtime which is /usr/local/kubebuilder/. // Note that you must have the required binaries setup under the bin directory to perform // the tests directly. When we run make test it will be setup and used automatically. - BinaryAssetsDirectory: filepath.Join("..", "..", "bin", "k8s", + BinaryAssetsDirectory: filepath.Join("..", "bin", "k8s", fmt.Sprintf("1.28.0-%s-%s", runtime.GOOS, runtime.GOARCH)), }