Skip to content

Commit

Permalink
test: Fix Keptn installation in integration tests (#133)
Browse files Browse the repository at this point in the history
* test: Fix Keptn installation in integration tests

Signed-off-by: TannerGabriel <[email protected]>

* Increase K3S timeout

Signed-off-by: TannerGabriel <[email protected]>

* Debug K3S installation

Signed-off-by: TannerGabriel <[email protected]>

* Set Kubeconfig env variable

Signed-off-by: TannerGabriel <[email protected]>

* Remove redundant env variable

Signed-off-by: TannerGabriel <[email protected]>

* Add kubeconfig environment variable to installation

Signed-off-by: TannerGabriel <[email protected]>
  • Loading branch information
TannerGabriel authored May 18, 2022
1 parent d795015 commit ca6cb20
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
GO111MODULE: "on"
ENABLE_E2E_TEST: true
BRANCH: ${{ github.head_ref || github.ref_name }}
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
steps:
- name: Install Go
uses: actions/[email protected]
Expand All @@ -45,16 +46,32 @@ jobs:
branch: ${{ env.BRANCH }}
path: ./dist

# Prepare K3d + Keptn environment
- name: Install and start K3s
run: curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -
run: |
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.21.12+k3s1" INSTALL_K3S_EXEC="--no-deploy traefik" K3S_KUBECONFIG_MODE="644" sh -
- name: Wait for K3s to become ready
timeout-minutes: 1
run: |
# uncomment the line below for debugging
#set -x
k3sReady=$(kubectl get node $(hostname) -ogo-template --template="{{ range .status.conditions }} {{- if eq .type \"Ready\" }}{{ .status }} {{- end }} {{- end }}" || echo "")
while [ "$k3sReady" != "True" ]; do
echo "K3s is not ready yet, sleep awhile to let things settle"
sleep 5
k3sReady=$(kubectl get node $(hostname) -ogo-template --template="{{ range .status.conditions }} {{- if eq .type \"Ready\" }}{{ .status }} {{- end }} {{- end }}" || echo "")
done;
echo "K3s ready!!!"
- name: Install Keptn
id: install_keptn
uses: keptn-sandbox/[email protected]
timeout-minutes: 10
with:
KEPTN_VERSION: ${{ matrix.keptn-version }}
KUBECONFIG: /etc/rancher/k3s/k3s.yaml
KEPTN_INSTALL_PARAMETERS: -v --endpoint-service-type=LoadBalancer
KUBECONFIG: ${{ env.KUBECONFIG }}

- name: Test connection to keptn
run: |
Expand Down

0 comments on commit ca6cb20

Please sign in to comment.