Skip to content

Commit

Permalink
chore: fix helm-test
Browse files Browse the repository at this point in the history
  • Loading branch information
moshloop committed Sep 13, 2024
1 parent 03ec482 commit 316de2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/helm-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
run: "kubectl describe pods -n canary-checker"

- name: Run tests
run: ./chart/test.sh
run: ./chart/test.sh canary-checker

- name: Check logs
run: kubectl logs deploy/canary-checker -n canary-checker
10 changes: 6 additions & 4 deletions chart/test.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
!/bin/bash
#!/bin/bash

kubectl apply -f fixtures/minimal/exec_pass.yaml
ns="-n $1"

kubectl apply -f fixtures/minimal/exec_pass.yaml $ns

function get_unused_port() {
for port in $(seq 4444 65000);
Expand All @@ -12,7 +14,7 @@ function get_unused_port() {


PORT=$(get_unused_port)
kubectl port-forward svc/canary-checker $PORT:8080 &
kubectl port-forward $ns svc/canary-checker $PORT:8080 &
PID=$!
function cleanup {
echo "Cleaning up..."
Expand All @@ -23,7 +25,7 @@ trap cleanup EXIT

sleep 60

status=$(kubectl get canaries.canaries.flanksource.com exec-pass -o yaml | yq .status.status)
status=$(kubectl get $ns canaries.canaries.flanksource.com exec-pass -o yaml | yq .status.status)
echo $status
if [[ $status != "Passed" ]]; then
exit 1
Expand Down

0 comments on commit 316de2c

Please sign in to comment.