From 0370b28d9ab074e581131c74e496aeb71ca19a29 Mon Sep 17 00:00:00 2001 From: Camila Macedo Date: Thu, 29 Aug 2024 08:00:24 +0100 Subject: [PATCH] ci: fix e2e tests for samples The current test is not properly testing the e2e of the samples. Either we have an issue the e2e tests scaffolds for deploy-image sample but we will need to fix it in a follow up PR --- .github/workflows/test-e2e-samples.yml | 67 ++++++++++++++++++++++++++ .github/workflows/test-sample-go.yml | 33 ------------- 2 files changed, 67 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/test-e2e-samples.yml delete mode 100644 .github/workflows/test-sample-go.yml diff --git a/.github/workflows/test-e2e-samples.yml b/.github/workflows/test-e2e-samples.yml new file mode 100644 index 00000000000..b272e3296b0 --- /dev/null +++ b/.github/workflows/test-e2e-samples.yml @@ -0,0 +1,67 @@ +name: Testing E2E Sample + +on: + push: + paths-ignore: + - '**/*.md' + pull_request: + paths-ignore: + - '**/*.md' + +jobs: + e2e-tests: + runs-on: ubuntu-latest + # Pull requests from the same repository won't trigger this checks as they were already triggered by the push + if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '~1.22' + + - name: Install the latest version of kind + run: | + curl -Lo ./kind https://kind.sigs.k8s.io/dl/latest/kind-linux-amd64 + chmod +x ./kind + sudo mv ./kind /usr/local/bin/kind + + - name: Verify kind installation + run: kind version + + - name: Create kind cluster + run: kind create cluster + + - name: Prepare project-v4 + run: | + KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml" + sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH + sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH + cd testdata/project-v4/ + go mod tidy + make generate + make manifests + + - name: Testing make test-e2e for project-v4 + working-directory: testdata/project-v4/ + run: | + make test-e2e + + - name: Prepare project-v4-with-deploy-image + run: | + KUSTOMIZATION_FILE_PATH="testdata/project-v4-with-deploy-image/config/default/kustomization.yaml" + sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH + sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH + cd testdata/project-v4-with-deploy-image/ + go mod tidy + make generate + make manifests + +# Fixme: The e2e tests for deploy image are failing and we +# need to fix in a follow up +# - name: Testing make test-e2e for project-v4-with-deploy-image +# working-directory: testdata/project-v4-with-deploy-image +# run: | +# make test-e2e \ No newline at end of file diff --git a/.github/workflows/test-sample-go.yml b/.github/workflows/test-sample-go.yml deleted file mode 100644 index 76016c2e018..00000000000 --- a/.github/workflows/test-sample-go.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: run-test-e2e-for-project-v4-sample - -on: - push: - pull_request: - -jobs: - test: - name: Run on Ubuntu - runs-on: ubuntu-latest - steps: - - name: Clone the code - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '~1.22' - - - name: Create kind cluster - run: kind create cluster - - - name: Prepare the environment - run: | - KUSTOMIZATION_FILE_PATH="testdata/project-v4/config/default/kustomization.yaml" - sed -i '25s/^#//' $KUSTOMIZATION_FILE_PATH - sed -i '51s/^#//' $KUSTOMIZATION_FILE_PATH - - - name: Test - run: | - cd testdata/project-v4 - go mod tidy - make test-e2e