You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: readme.md
+40-21Lines changed: 40 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,32 +36,51 @@ Once you have an order displayed in HAL Explorer, you can submit payment:
36
36
37
37
Refer to the section `The Android client` below for more information.
38
38
39
-
**3. Use the provided bash script.**
39
+
**3. Use the provided bash scripts.**
40
40
41
-
A bash script to generate traffic is provided.
42
-
By default, the script will place a single order using the first available drink option and default location; pay with the built-in demo card (`1234123412341234`); and poll until a receipt link appears.
43
-
Optionally, you can submit multiple and varied orders, force failures, and more.
41
+
Two bash scripts are provided to generate traffic. Both require `curl` and `jq`.
44
42
45
-
Usage Examples:
46
-
- Single, default order (orders first available drink using default location, pays with built-in demo card):
By default it places a single order (first available drink, default location), pays with the built-in demo card (`1234123412341234`), and polls until a receipt link appears. You can run multiple or varied scenarios, force errors, add delays, and more.
-`--scenarios <FILE>` or `--scenarios=<FILE>` — JSON file of scenarios (e.g. `scripts/order-scenarios.json`). Without `--scenario`, runs all scenarios in order; with `--scenario <NAME>`, runs only that scenario.
65
+
-`--scenario <NAME>` or `--scenario=<NAME>` — Run only the named scenario.
66
+
-`--cycle` — With `--scenarios`: repeat indefinitely (Ctrl+C to stop). Without `--scenario` cycles through all; with `--scenario` repeats that scenario.
67
+
-`--random-scenario` — With `--scenarios` and no `--scenario`: run one scenario chosen at random. With `--cycle`, pick a new random scenario each iteration.
68
+
-`--delay-max <MS>` — Random delay 0..MS milliseconds between scenario runs (default 3000). Use `--no-delay` for no delay.
69
+
-`--force-error [INVALID_CARD|DOUBLE_PAY]` — INVALID_CARD: invalid card, expect failure. DOUBLE_PAY: pay twice, second payment fails. Omitted value defaults to INVALID_CARD.
70
+
-`--base-url <URL>` — Target base URL (default `http://localhost:8080`).
Runs multiple “users” in parallel, each executing `generate-traffic.sh` with `--scenarios scripts/order-scenarios.json --random-scenario --cycle`. Output is prefixed with `[n]>` for user number `n`. A single Ctrl+C stops all users.
0 commit comments