Skip to content

Commit eae5995

Browse files
authored
Parallel Non-Java Build, Rerun-able Auto Test, Minor Fixes (#110)
* TryParallel * wait * separate logs * NotJavaBuilds * Rerun-able AutoTest * Temporary Workaround for #107 * Update func-test.sh * Update func-test.sh
1 parent 7519cb1 commit eae5995

File tree

7 files changed

+45
-13
lines changed

7 files changed

+45
-13
lines changed

grabdish/inventory-helidon/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ else
2727
kubectl apply -f <(istioctl kube-inject -f $SCRIPT_DIR/inventory-helidon-deployment-$CURRENTTIME.yaml) -n msdataworkshop
2828
fi
2929

30-
kubectl create -f inventory-service.yaml -n msdataworkshop
30+
# kubectl create -f inventory-service.yaml -n msdataworkshop

grabdish/inventory-helidon/undeploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ echo delete inventory-helidon deployment...
77

88
kubectl delete deployment inventory-helidon -n msdataworkshop
99

10-
kubectl delete service inventory -n msdataworkshop
10+
# kubectl delete service inventory -n msdataworkshop

grabdish/utils/func-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function addInventoryTest() {
5959
# Show order and wait for status "no inventory"
6060
placeOrderTest $ORDER_ID
6161

62-
sleep 5
62+
sleep 10
6363

6464
showOrderTest $ORDER_ID 'failed inventory does not exist'
6565

@@ -73,6 +73,6 @@ ORDER_ID=$(($ORDER_ID + 1))
7373

7474
placeOrderTest "$ORDER_ID"
7575

76-
sleep 5
76+
sleep 10
7777

7878
showOrderTest "$ORDER_ID" 'success inventory exists'

grabdish/utils/java-builds.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ BUILDS="frontend-helidon order-helidon supplier-helidon-se inventory-helidon"
1010

1111
# Provision Repos
1212
while ! state_done JAVA_REPOS; do
13-
for b in $BUILDS; do
13+
for b in $BUILDS; do
1414
oci artifacts container repository create --compartment-id "$(state_get COMPARTMENT_OCID)" --display-name "$(state_get RUN_NAME)/$b" --is-public true
1515
done
1616
state_set_done JAVA_REPOS
@@ -43,9 +43,9 @@ done
4343

4444
# Build all the images (no push) except frontend-helidon (requires Jaeger)
4545
while ! state_done JAVA_BUILDS; do
46-
for b in $BUILDS; do
46+
for b in $BUILDS; do
4747
cd $GRABDISH_HOME/$b
48-
time ./build.sh
48+
time ./build.sh &>> $GRABDISH_LOG/build-$b.log
4949
done
5050
state_set_done JAVA_BUILDS
51-
done
51+
done

grabdish/utils/main-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,5 +473,5 @@ done
473473

474474
# Export state file for local development
475475
cd $GRABDISH_HOME
476-
rm ~/grabdish-state.tgz
476+
rm -f ~/grabdish-state.tgz
477477
tar -czf ~/grabdish-state.tgz state

grabdish/utils/main-test.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,25 @@ export TEST_UI_PASSWORD=`kubectl get secret frontendadmin -n msdataworkshop --te
2323
echo 'TEST_LOG: #####################################'
2424

2525
# WALKTHROUGH
26+
echo "TEST_LOG: #### Testing Lab2: Walkthrough"
27+
28+
# Undeploy to make it rerunable
29+
./undeploy.sh
30+
SERVICES="inventory-python inventory-nodejs inventory-dotnet inventory-go inventory-helidon-se"
31+
for s in $SERVICES; do
32+
cd $GRABDISH_HOME/$s
33+
./undeploy.sh || true
34+
done
35+
36+
# Wait for Pods to stop
37+
while test 0 -lt `kubectl get pods -n msdataworkshop | egrep 'frontend-helidon|inventory-|order-helidon|supplier-helidon-se' | wc -l`; do
38+
echo "Waiting for pods to stop..."
39+
sleep 10
40+
done
41+
2642
# Deploy the java services
2743
echo "TEST_LOG: #### Testing Lab2: Walkthrough"
44+
cd $GRABDISH_HOME
2845
./deploy.sh
2946

3047
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
5774
exit
5875
fi
5976

77+
78+
# Delete all order (to make it rerunable)
79+
function deleteallorders() {
80+
echo '{"serviceName": "order", "commandName": "deleteallorders", "orderId": -1, "orderItem": "", "deliverTo": ""}'
81+
}
82+
83+
if wget --http-user grabdish --http-password "$TEST_UI_PASSWORD" --no-check-certificate --post-data "$(deleteallorders)" \
84+
--header='Content-Type: application/json' "$(state_get FRONTEND_URL)/placeorder" -O $GRABDISH_LOG/order; then
85+
echo "TEST_LOG: $TEST_STEP deleteallorders succeeded"
86+
else
87+
echo "TEST_LOG_FAILED: $TEST_STEP deleteallorders failed"
88+
fi
89+
90+
6091
# Functional test on order 66/67
6192
utils/func-test.sh Walkthrough 66
6293

grabdish/utils/non-java-builds.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BUILDS="inventory-python inventory-nodejs inventory-dotnet inventory-go inventor
99

1010
# Provision Repos
1111
while ! state_done NON_JAVA_REPOS; do
12-
for b in $BUILDS; do
12+
for b in $BUILDS; do
1313
oci artifacts container repository create --compartment-id "$(state_get COMPARTMENT_OCID)" --display-name "$(state_get RUN_NAME)/$b" --is-public true
1414
done
1515
state_set_done NON_JAVA_REPOS
@@ -32,9 +32,10 @@ done
3232

3333
# Build all the images (no push) except frontend-helidon (requires Jaeger)
3434
while ! state_done NON_JAVA_BUILDS; do
35-
for b in $BUILDS; do
35+
for b in $BUILDS; do
3636
cd $GRABDISH_HOME/$b
37-
time ./build.sh
37+
time ./build.sh &>> $GRABDISH_LOG/build-$b.log &
3838
done
39+
wait
3940
state_set_done NON_JAVA_BUILDS
40-
done
41+
done

0 commit comments

Comments
 (0)