diff --git a/grabdish/inventory-helidon/deploy.sh b/grabdish/inventory-helidon/deploy.sh index 0c0967ecd..d35c3386e 100755 --- a/grabdish/inventory-helidon/deploy.sh +++ b/grabdish/inventory-helidon/deploy.sh @@ -27,4 +27,4 @@ else kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/inventory-helidon-deployment-$CURRENTTIME.yaml) -n msdataworkshop fi -kubectl create -f inventory-service.yaml -n msdataworkshop \ No newline at end of file +# kubectl create -f inventory-service.yaml -n msdataworkshop \ No newline at end of file diff --git a/grabdish/inventory-helidon/undeploy.sh b/grabdish/inventory-helidon/undeploy.sh index c77cde7a7..017ca9abb 100755 --- a/grabdish/inventory-helidon/undeploy.sh +++ b/grabdish/inventory-helidon/undeploy.sh @@ -7,4 +7,4 @@ echo delete inventory-helidon deployment... kubectl delete deployment inventory-helidon -n msdataworkshop -kubectl delete service inventory -n msdataworkshop +# kubectl delete service inventory -n msdataworkshop diff --git a/grabdish/utils/func-test.sh b/grabdish/utils/func-test.sh index af4a15c95..3774fae83 100755 --- a/grabdish/utils/func-test.sh +++ b/grabdish/utils/func-test.sh @@ -59,7 +59,7 @@ function addInventoryTest() { # Show order and wait for status "no inventory" placeOrderTest $ORDER_ID -sleep 5 +sleep 10 showOrderTest $ORDER_ID 'failed inventory does not exist' @@ -73,6 +73,6 @@ ORDER_ID=$(($ORDER_ID + 1)) placeOrderTest "$ORDER_ID" -sleep 5 +sleep 10 showOrderTest "$ORDER_ID" 'success inventory exists' diff --git a/grabdish/utils/java-builds.sh b/grabdish/utils/java-builds.sh index 52cc6a221..9a2b8f603 100755 --- a/grabdish/utils/java-builds.sh +++ b/grabdish/utils/java-builds.sh @@ -10,7 +10,7 @@ BUILDS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon" # Provision Repos while ! state_done JAVA_REPOS; do - for b in $BUILDS; do + for b in $BUILDS; do oci artifacts container repository create --compartment-id "$(state_get COMPARTMENT_OCID)" --display-name "$(state_get RUN_NAME)/$b" --is-public true done state_set_done JAVA_REPOS @@ -43,9 +43,9 @@ done # Build all the images (no push) except frontend-helidon (requires Jaeger) while ! state_done JAVA_BUILDS; do - for b in $BUILDS; do + for b in $BUILDS; do cd $GRABDISH_HOME/$b - time ./build.sh + time ./build.sh &>> $GRABDISH_LOG/build-$b.log done state_set_done JAVA_BUILDS -done \ No newline at end of file +done diff --git a/grabdish/utils/main-setup.sh b/grabdish/utils/main-setup.sh index 3c515d5e8..23427eb39 100755 --- a/grabdish/utils/main-setup.sh +++ b/grabdish/utils/main-setup.sh @@ -473,5 +473,5 @@ done # Export state file for local development cd $GRABDISH_HOME -rm ~/grabdish-state.tgz +rm -f ~/grabdish-state.tgz tar -czf ~/grabdish-state.tgz state diff --git a/grabdish/utils/main-test.sh b/grabdish/utils/main-test.sh index 70c7d53ce..85965c6f2 100755 --- a/grabdish/utils/main-test.sh +++ b/grabdish/utils/main-test.sh @@ -23,8 +23,25 @@ export TEST_UI_PASSWORD=`kubectl get secret frontendadmin -n msdataworkshop --te echo 'TEST_LOG: #####################################' # WALKTHROUGH +echo "TEST_LOG: #### Testing Lab2: Walkthrough" + +# Undeploy to make it rerunable +./undeploy.sh +SERVICES="inventory-python inventory-nodejs inventory-dotnet inventory-go inventory-helidon-se" +for s in $SERVICES; do + cd $GRABDISH_HOME/$s + ./undeploy.sh || true +done + +# Wait for Pods to stop +while test 0 -lt `kubectl get pods -n msdataworkshop | egrep 'frontend-helidon|inventory-|order-helidon|supplier-helidon-se' | wc -l`; do + echo "Waiting for pods to stop..." + sleep 10 +done + # Deploy the java services echo "TEST_LOG: #### Testing Lab2: Walkthrough" +cd $GRABDISH_HOME ./deploy.sh while test 4 -gt `kubectl get pods -n msdataworkshop | egrep 'frontend-helidon|inventory-helidon|order-helidon|supplier-helidon-se' | grep "1/1" | wc -l`; do @@ -57,6 +74,20 @@ else exit fi + +# Delete all order (to make it rerunable) +function deleteallorders() { + echo '{"serviceName": "order", "commandName": "deleteallorders", "orderId": -1, "orderItem": "", "deliverTo": ""}' +} + +if wget --http-user grabdish --http-password "$TEST_UI_PASSWORD" --no-check-certificate --post-data "$(deleteallorders)" \ + --header='Content-Type: application/json' "$(state_get FRONTEND_URL)/placeorder" -O $GRABDISH_LOG/order; then + echo "TEST_LOG: $TEST_STEP deleteallorders succeeded" +else + echo "TEST_LOG_FAILED: $TEST_STEP deleteallorders failed" +fi + + # Functional test on order 66/67 utils/func-test.sh Walkthrough 66 diff --git a/grabdish/utils/non-java-builds.sh b/grabdish/utils/non-java-builds.sh index 92c06b634..a980a19d4 100755 --- a/grabdish/utils/non-java-builds.sh +++ b/grabdish/utils/non-java-builds.sh @@ -9,7 +9,7 @@ BUILDS="inventory-python inventory-nodejs inventory-dotnet inventory-go inventor # Provision Repos while ! state_done NON_JAVA_REPOS; do - for b in $BUILDS; do + for b in $BUILDS; do oci artifacts container repository create --compartment-id "$(state_get COMPARTMENT_OCID)" --display-name "$(state_get RUN_NAME)/$b" --is-public true done state_set_done NON_JAVA_REPOS @@ -32,9 +32,10 @@ done # Build all the images (no push) except frontend-helidon (requires Jaeger) while ! state_done NON_JAVA_BUILDS; do - for b in $BUILDS; do + for b in $BUILDS; do cd $GRABDISH_HOME/$b - time ./build.sh + time ./build.sh &>> $GRABDISH_LOG/build-$b.log & done + wait state_set_done NON_JAVA_BUILDS -done \ No newline at end of file +done