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

Local tests v999 #21

Merged
merged 3 commits into from
Oct 7, 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
33 changes: 3 additions & 30 deletions .github/workflows/_integration-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
TF_VAR_BTP_NEW_SUBACCOUNT_NAME: keda-registry-test-${{ github.sha }}-${{ github.run_attempt }}

8 changes: 0 additions & 8 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion test/btp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Overview

This integration test verifies if the Keda Manager works in a semi-production environment.

## How to use

Expand Down
1 change: 1 addition & 0 deletions test/btp/hack/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 9 additions & 9 deletions test/btp/tf/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 = <<EOT
clientid=${local.providerServiceManagerCredentials.clientid}
clientsecret=${local.providerServiceManagerCredentials.clientsecret}
Expand Down
Loading