-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: adjusted expect integration test
- Loading branch information
1 parent
af10329
commit ea4775a
Showing
1 changed file
with
54 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,44 +27,44 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/[email protected] | ||
with: | ||
cluster_name: "k8scluster" | ||
|
||
- name: Build RPC | ||
run: docker build -t rpc:1.0 -f docker/dockerfile.rpc . | ||
|
||
- name: Load Docker Image | ||
run: kind load docker-image rpc:1.0 --name k8scluster | ||
|
||
- name: Build Daemon | ||
run: docker build -t daemon:1.0 -f docker/dockerfile.daemon . | ||
|
||
- name: Load Docker Image | ||
run: kind load docker-image daemon:1.0 --name k8scluster | ||
|
||
- name: Apply main manifest | ||
run: kubectl apply -f test/manifest.yaml | ||
# - name: Create k8s Kind Cluster | ||
# uses: helm/[email protected] | ||
# with: | ||
# cluster_name: "k8scluster" | ||
# | ||
# - name: Build RPC | ||
# run: docker build -t rpc:1.0 -f docker/dockerfile.rpc . | ||
# | ||
# - name: Load Docker Image | ||
# run: kind load docker-image rpc:1.0 --name k8scluster | ||
# | ||
# - name: Build Daemon | ||
# run: docker build -t daemon:1.0 -f docker/dockerfile.daemon . | ||
# | ||
# - name: Load Docker Image | ||
# run: kind load docker-image daemon:1.0 --name k8scluster | ||
# | ||
# - name: Apply main manifest | ||
# run: kubectl apply -f test/manifest.yaml | ||
|
||
- name: Validate | ||
env: | ||
TEST_CREDENTIAL: ${{ vars.TEST_CREDENTIAL }} | ||
run: | | ||
wget https://github.com/fullstorydev/grpcurl/releases/download/v1.9.1/grpcurl_1.9.1_linux_x86_64.tar.gz | ||
tar -zxvf ./grpcurl_1.9.1_linux_x86_64.tar.gz grpcurl | ||
echo "Waiting for kafka to be ready..." | ||
while true; do | ||
pod_status=$(kubectl get pods -n demeter-kafka -o 'jsonpath={.items[*].status.conditions[?(@.type=="Ready")].status}' | grep True) | ||
if [[ -n "$pod_status" ]]; then | ||
break | ||
else | ||
echo "Kafka is not ready yet, waiting..." | ||
sleep 5 | ||
fi | ||
done | ||
# wget https://github.com/fullstorydev/grpcurl/releases/download/v1.9.1/grpcurl_1.9.1_linux_x86_64.tar.gz | ||
# tar -zxvf ./grpcurl_1.9.1_linux_x86_64.tar.gz grpcurl | ||
# | ||
# echo "Waiting for kafka to be ready..." | ||
# while true; do | ||
# pod_status=$(kubectl get pods -n demeter-kafka -o 'jsonpath={.items[*].status.conditions[?(@.type=="Ready")].status}' | grep True) | ||
# | ||
# if [[ -n "$pod_status" ]]; then | ||
# break | ||
# else | ||
# echo "Kafka is not ready yet, waiting..." | ||
# sleep 5 | ||
# fi | ||
# done | ||
echo "$TEST_CREDENTIAL" | ||
TOKEN_RESPONSE=$(curl --verbose --request POST --url https://dev-dflg0ssi.us.auth0.com/oauth/token --header 'content-type: application/json' --data "$TEST_CREDENTIAL") | ||
|
@@ -73,24 +73,24 @@ jobs: | |
echo "$TOKEN" | ||
NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}') | ||
NAMESPACE=$(./grpcurl -plaintext -H "Authorization: Bearer $TOKEN" -d '{"name": "New Namespace"}' "$NODE_IP":30950 demeter.ops.v1alpha.ProjectService.CreateProject | jq -r '.namespace') | ||
ATTEMPT=1 | ||
MAX_ATTEMPT=120 | ||
echo "Checking executation" | ||
while [ $ATTEMPT -lt $MAX_ATTEMPT ]; do | ||
if kubectl get namespace "$NAMESPACE" &> /dev/null; then | ||
echo "Namespace $NAMESPACE exists." | ||
break | ||
else | ||
echo "Namespace $NAMESPACE not found. Retrying..." | ||
sleep 2 | ||
let ATTEMPT=ATTEMPT+1 | ||
fi | ||
done | ||
if [ $ATTEMPT -eq $MAX_ATTEMPT ]; then | ||
echo "Error: Namespace $NAMESPACE not found after $MAX_ATTEMPT attempts." | ||
exit 1 | ||
fi | ||
# NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}') | ||
# NAMESPACE=$(./grpcurl -plaintext -H "Authorization: Bearer $TOKEN" -d '{"name": "New Namespace"}' "$NODE_IP":30950 demeter.ops.v1alpha.ProjectService.CreateProject | jq -r '.namespace') | ||
# ATTEMPT=1 | ||
# MAX_ATTEMPT=120 | ||
# | ||
# echo "Checking executation" | ||
# while [ $ATTEMPT -lt $MAX_ATTEMPT ]; do | ||
# if kubectl get namespace "$NAMESPACE" &> /dev/null; then | ||
# echo "Namespace $NAMESPACE exists." | ||
# break | ||
# else | ||
# echo "Namespace $NAMESPACE not found. Retrying..." | ||
# sleep 2 | ||
# let ATTEMPT=ATTEMPT+1 | ||
# fi | ||
# done | ||
# | ||
# if [ $ATTEMPT -eq $MAX_ATTEMPT ]; then | ||
# echo "Error: Namespace $NAMESPACE not found after $MAX_ATTEMPT attempts." | ||
# exit 1 | ||
# fi |