@@ -13,6 +13,47 @@ set -x
1313# Let's test that epcc command works after an embarrassing bug that caused it to panic :(
1414epcc
1515
16+ echo " Starting Manual Orders Runbook"
17+ epcc reset-store .+
18+ epcc aliases clear
19+ sleep 1.5
20+ NUMBER_OF_ORDERS=$( epcc get orders --output-jq .meta.results.total)
21+ epcc runbooks run manual-orders create-orders --number-of-accounts 3 --number-of-products 4 --number-of-orders 7
22+ epcc runbooks run manual-orders create-orders --number-of-accounts 3 --number-of-products 4 --number-of-orders 6
23+
24+ # Allow for eventual consistency.
25+ sleep 1.5
26+ NUMBER_OF_ORDERS_NOW=$( epcc get orders --output-jq .meta.results.total)
27+
28+ EXPECTED_DIFF=13
29+ ACTUAL_DIFF=$(( NUMBER_OF_ORDERS_NOW - NUMBER_OF_ORDERS))
30+
31+ if [ " $ACTUAL_DIFF " -eq " $EXPECTED_DIFF " ]; then
32+ echo " ✅ Correct number of orders added: $ACTUAL_DIFF "
33+ else
34+ echo " ❌ Expected to add $EXPECTED_DIFF orders, but added $ACTUAL_DIFF "
35+ exit 1
36+ fi
37+
38+ # Check number of accounts
39+ NUM_ACCOUNTS=$( epcc get accounts --output-jq .meta.results.total)
40+ if [ " $NUM_ACCOUNTS " -eq 3 ]; then
41+ echo " ✅ Correct number of accounts: 3"
42+ else
43+ echo " ❌ Expected 3 accounts, but found $NUM_ACCOUNTS "
44+ exit 1
45+ fi
46+
47+ # Check number of products
48+ NUM_PRODUCTS=$( epcc get pcm-products --output-jq .meta.results.total)
49+ if [ " $NUM_PRODUCTS " -eq 4 ]; then
50+ echo " ✅ Correct number of products: 4"
51+ else
52+ echo " ❌ Expected 4 products, but found $NUM_PRODUCTS "
53+ exit 1
54+ fi
55+
56+
1657echo " Starting Rule Promotions Runbook"
1758epcc reset-store .+
1859epcc runbooks run rule-promotions-how-to create-prequisites
0 commit comments