Skip to content

Commit 8ada81e

Browse files
committed
Checkpoint
1 parent 59c70c0 commit 8ada81e

File tree

3 files changed

+43
-10
lines changed

3 files changed

+43
-10
lines changed

external/resources/yaml/carts-and-orders.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -571,12 +571,3 @@ manual-orders:
571571
type: STRING
572572
included.items[n].meta.timestamps.updated_at:
573573
type: STRING
574-
575-
576-
577-
578-
579-
580-
581-
582-

external/runbooks/manual-orders.epcc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ actions:
3333
short: "The number of distinct products"
3434
start-date:
3535
type: STRING
36-
default: '{{ now | date_modify "-2160h" | date "2006-01-02" }}'
36+
# Default is 6 months ago
37+
default: '{{ now | date_modify "-4320h" | date "2006-01-02" }}'
3738
description:
3839
short: "The earliest date of the order"
3940
end-date:

external/runbooks/run-all-runbooks.sh

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,47 @@ set -x
1313
#Let's test that epcc command works after an embarrassing bug that caused it to panic :(
1414
epcc
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+
1657
echo "Starting Rule Promotions Runbook"
1758
epcc reset-store .+
1859
epcc runbooks run rule-promotions-how-to create-prequisites

0 commit comments

Comments
 (0)