Skip to content

Commit

Permalink
variables + logs on functional test
Browse files Browse the repository at this point in the history
  • Loading branch information
scrungus committed Jul 4, 2024
1 parent 5c629fb commit 1ae088f
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions tools/functional_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,21 +21,26 @@ check_http_status() {
fi
}

# Set variables
CHART_NAME="coral-credits"
RELEASE_NAME=$CHART_NAME
NAMESPACE=$CHART_NAME

# Install the CaaS operator from the chart we are about to ship
# Make sure to use the images that we just built
helm upgrade coral-credits ./charts \
helm upgrade $RELEASE_NAME ./charts \
--dependency-update \
--namespace coral-credits \
--namespace $NAMESPACE \
--create-namespace \
--install \
--wait \
--timeout 10m \
--set-string image.tag=${GITHUB_SHA::7}

# Wait for rollout
kubectl rollout status deployment/coral-credits -n coral-credits --timeout=300s -w
kubectl rollout status deployment/$RELEASE_NAME -n $NAMESPACE --timeout=300s -w
# Port forward in the background
kubectl port-forward -n coral-credits svc/coral-credits 8080:8080 &
kubectl port-forward -n $NAMESPACE svc/$RELEASE_NAME 8080:8080 &

# Wait for port to be open
echo "Waiting for port 8080 to be available..."
Expand Down Expand Up @@ -63,6 +68,17 @@ for i in {1..10}; do
done

echo "Failed to get correct HTTP status after 10 attempts"
# Get pod logs on failure

# Construct the selector
SELECTOR="app.kubernetes.io/name=$CHART_NAME,app.kubernetes.io/instance=$RELEASE_NAME"

# Get the pod name
POD_NAME=$(kubectl get pods -n $NAMESPACE -l $SELECTOR -o jsonpath="{.items[0].metadata.name}")

# Get the logs
kubectl logs -n $NAMESPACE $POD_NAME

exit 1

#TODO(tylerchristie) check more things

0 comments on commit 1ae088f

Please sign in to comment.