diff --git a/.github/workflows/_integration-tests.yaml b/.github/workflows/_integration-tests.yaml index f1c6cebd..1dd5cc7d 100644 --- a/.github/workflows/_integration-tests.yaml +++ b/.github/workflows/_integration-tests.yaml @@ -34,7 +34,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-kyma with: - path: "tests/btp/bin" + path: "test/btp/bin" - name: Create btp account with kyma enable run: | . ./set-tf-envs.sh @@ -43,32 +43,5 @@ jobs: echo "SUBACC_ID=$(terraform -chdir=../tf output -raw subaccount_id)" >> $GITHUB_ENV env: BTP_ENV: ${{ secrets.BTP_INTEGRATION_TEST }} - TF_VAR_BTP_NEW_SUBACCOUNT_NAME: keda-manager-test-${{ github.sha }}-${{ github.run_attempt }} - - - name: Generate access - run: | - sudo ln -sf bash /bin/sh - . ./set-tf-envs.sh - mkdir -p tmp - CLUSTERROLE=cluster-admin make service-account-kubeconfig - env: - BTP_ENV: ${{ secrets.BTP_INTEGRATION_TEST }} - - - name: Run integration test - run: make -C hack/ci integration-test-on-cluster - env: - IMG: ${{ inputs.image }} - - - uses: ./.github/actions/setup-btp - if: always() - with: - path: "tests/btp/bin" - - - name: Force delete btp account - if: always() - run: | - . ./set-tf-envs.sh - ../bin/btp login --url $TF_VAR_BTP_BACKEND_URL --user $TF_VAR_BTP_BOT_USER --password $TF_VAR_BTP_BOT_PASSWORD --idp $TF_VAR_BTP_CUSTOM_IAS_TENANT --subdomain $TF_VAR_BTP_GLOBAL_ACCOUNT - ../bin/btp delete accounts/subaccount ${SUBACC_ID} --global-account ${TF_VAR_BTP_GLOBAL_ACCOUNT} --force-delete true --confirm true - env: - BTP_ENV: ${{ secrets.BTP_INTEGRATION_TEST }} \ No newline at end of file + TF_VAR_BTP_NEW_SUBACCOUNT_NAME: keda-registry-test-${{ github.sha }}-${{ github.run_attempt }} + \ No newline at end of file diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index dafe6967..2a67bf6d 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -5,15 +5,7 @@ on: branches: [ "main", "release-*" ] jobs: -# builds: -# uses: ./.github/workflows/_build.yaml -# -# upgrades: -# needs: builds -# uses: ./.github/workflows/_upgrade-tests.yaml - integrations: - #needs: builds uses: ./.github/workflows/_integration-tests.yaml with: image: europe-docker.pkg.dev/kyma-project/dev/keda-manager:PR-515 \ No newline at end of file diff --git a/test/btp/README.md b/test/btp/README.md index 3f8d6169..83552368 100644 --- a/test/btp/README.md +++ b/test/btp/README.md @@ -2,7 +2,6 @@ ## Overview -This integration test verifies if the Keda Manager works in a semi-production environment. ## How to use diff --git a/test/btp/hack/Makefile b/test/btp/hack/Makefile index b02aeae6..14db90a9 100644 --- a/test/btp/hack/Makefile +++ b/test/btp/hack/Makefile @@ -4,6 +4,7 @@ service-account-kubeconfig: ../bin/kyma alpha access --clusterrole ${CLUSTERROLE} --kubeconfig ../tf/kubeconfig.yaml --name ci-workflow-sa --time 1h --output tmp/sa-kubeconfig.yaml @echo "Service-account based kubeconfig generated" + .PHONY cleanup-tf-force: cleanup-tf-force: rm -rf ../tf/*.txt diff --git a/test/btp/tf/main.tf b/test/btp/tf/main.tf index 21f1df70..6b6d29f5 100644 --- a/test/btp/tf/main.tf +++ b/test/btp/tf/main.tf @@ -33,19 +33,19 @@ module "kyma" { BTP_BOT_PASSWORD = var.BTP_BOT_PASSWORD } -#data "btp_subaccount_service_binding" "provider_sm" { - # count = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? 0 : 1 - #subaccount_id = var.BTP_PROVIDER_SUBACCOUNT_ID - #name = "provider-sm-binding" -#} +data "btp_subaccount_service_binding" "provider_sm" { + count = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? 0 : 1 + subaccount_id = var.BTP_PROVIDER_SUBACCOUNT_ID + name = "provider-sm-binding" +} -#locals { -# providerServiceManagerCredentials = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? null : jsondecode(one(data.btp_subaccount_service_binding.provider_sm).credentials) -#} +locals { + providerServiceManagerCredentials = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? null : jsondecode(one(data.btp_subaccount_service_binding.provider_sm).credentials) +} resource "local_file" "provider_sm" { - #ount = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? 0 : 1 + count = var.BTP_PROVIDER_SUBACCOUNT_ID == null ? 0 : 1 content = <