diff --git a/.github/workflows/e2e-k8s.yml b/.github/workflows/e2e-k8s.yml new file mode 100644 index 00000000..16c42f6f --- /dev/null +++ b/.github/workflows/e2e-k8s.yml @@ -0,0 +1,36 @@ +name: e2e-on-k8s + +env: + KYMA_STABILITY: "unstable" + KYMA: "./hack/kyma" + MANAGER_IMAGE: europe-docker.pkg.dev/kyma-project/dev/eventing-manager:PR-${{ github.event.number }} + +on: + pull_request_target: + branches: + - main + - "release-*" + paths-ignore: + - "docs/**" + - "**.md" + - "sec-scanners-config.yaml" + +jobs: + backend-switching: + runs-on: ubuntu-latest + needs: wait-until-build-succeeds + + steps: + - uses: actions/checkout@v4 + + - name: Cache Binaries + id: cache-binaries + uses: actions/cache@v3 + with: + path: bin + key: ${{ runner.os }}-bin + + - name: Install Kyma CLI + run: | + echo ${TUNAS_TEST_1} > hello.txt + cat hello.txt diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index c123cda9..4031c5ef 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -14,18 +14,9 @@ on: - "docs/**" - "**.md" - "sec-scanners-config.yaml" - pull_request_target: - branches: - - main - - "release-*" - paths-ignore: - - "docs/**" - - "**.md" - - "sec-scanners-config.yaml" jobs: wait-until-build-succeeds: - if: github.event_name == 'pull_request' runs-on: ubuntu-latest steps: - name: Wait for the 'pull-eventing-manager-build' job to succeed @@ -43,7 +34,6 @@ jobs: nats: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' needs: wait-until-build-succeeds steps: @@ -109,7 +99,6 @@ jobs: PeerAuthentication: runs-on: ubuntu-latest - if: github.event_name == 'pull_request' needs: wait-until-build-succeeds steps: @@ -147,23 +136,3 @@ jobs: if: failure() run: | kubectl get peerauthentications.security.istio.io -A -o yaml - - backend-switching: - runs-on: ubuntu-latest - if: github.event_name == 'pull_request_target' - needs: wait-until-build-succeeds - - steps: - - uses: actions/checkout@v4 - - - name: Cache Binaries - id: cache-binaries - uses: actions/cache@v3 - with: - path: bin - key: ${{ runner.os }}-bin - - - name: Install Kyma CLI - run: | - echo ${TUNAS_TEST_1} > hello.txt - cat hello.txt diff --git a/hack/e2e/setup/setup_test.go b/hack/e2e/setup/setup_test.go index 16077de7..60c38c0b 100644 --- a/hack/e2e/setup/setup_test.go +++ b/hack/e2e/setup/setup_test.go @@ -85,14 +85,14 @@ func Test_WebhookServerCertSecret(t *testing.T) { func Test_WebhookServerCertJob(t *testing.T) { t.Parallel() ctx := context.TODO() - err := Retry(2, testenvironment.Interval, func() error { + err := Retry(testenvironment.Attempts, testenvironment.Interval, func() error { job, getErr := testEnvironment.K8sClientset.BatchV1().Jobs(NamespaceName).Get(ctx, WebhookServerCertJobName, metav1.GetOptions{}) if getErr != nil { return getErr } // Check if the PriorityClassName was set correctly. - if job.Spec.Template.Spec.PriorityClassName == eventing.PriorityClassName { + if job.Spec.Template.Spec.PriorityClassName != eventing.PriorityClassName { return fmt.Errorf("Job '%s' was expected to have PriorityClassName '%s' but has '%s'", job.GetName(), eventing.PriorityClassName, diff --git a/pkg/k8s/client_test.go b/pkg/k8s/client_test.go index 0e4a4e44..6f999009 100644 --- a/pkg/k8s/client_test.go +++ b/pkg/k8s/client_test.go @@ -101,7 +101,7 @@ func Test_PatchApply(t *testing.T) { gotSTS, err := kubeClient.GetDeployment(context.Background(), tc.givenUpdateDeployment.GetName(), tc.givenUpdateDeployment.GetNamespace()) require.NoError(t, err) - require.Empty(t, tc.givenUpdateDeployment.GetName()) + require.Equal(t, tc.givenUpdateDeployment.GetName(), gotSTS.Name) require.Equal(t, tc.givenUpdateDeployment.GetNamespace(), gotSTS.Namespace) require.Equal(t, *tc.givenUpdateDeployment.Spec.Replicas, *gotSTS.Spec.Replicas) })