Oro Commerce k6 Performance Testing
Oro ships a stock k6 harness (oro/performance-tests) exercising the storefront from outside: browsing, login, listing/search/detail, shopping list, checkout. Plain JavaScript, k6 as a single Go binary or the grafana/k6 image, with named custom metrics you can gate individually.
The Three-Script Pipeline
performance/scripts/, in this fixed order against a cleared cache — step 1 primes what steps 2 and 3 measure, so out of order inflates the numbers.
warmingUpTheApp.js— 1 VU / 60s /THRESHOLD_95=3000. Primes OPcache, Doctrine metadata, layout cache, search index.storefrontTests.js— browse flow (home, listing, search, detail, login). Typical 1 VU / 600s /THRESHOLD_95=850.checkoutTest.js— authenticated checkout from a shopping list. NeedsSL_ID,SHIPPING_METHOD,PAYMENT_METHOD.
Do not reuse the load-run threshold (850 ms) for the warm-up — first-touch is always slower and the run will fail on cold caches.
Environment Variables
All via -e KEY=VALUE. Every script takes BASE_URL, USERNAME, PASSWORD, VU, DURATION and THRESHOLD_95 (3000 warm-up, 850 load); checkoutTest.js adds SL_ID, SHIPPING_METHOD (fixed_product_5) and PAYMENT_METHOD (payment_term_1). Values and defaults: references/v6.1.md.
Hero Run Command (Docker)
docker run --rm --network host -u "$(id -u):$(id -g)" \
-v "${PWD}/performance:/home/k6/performance" -w /home/k6/performance \
grafana/k6:latest run \
-e BASE_URL="https://oro.docker.local" \
-e USERNAME="AmandaRCole@example.org" \
-e PASSWORD="AmandaRCole@example.org" \
-e VU=1 -e DURATION=60s -e THRESHOLD_95=3000 \
scripts/warmingUpTheApp.js
--network host lets k6 reach localhost and compose services; -u $(id -u):$(id -g) keeps summary.html from landing root-owned. Every flag: references/docker-invocation.md.
Custom Oro Metrics
The scripts emit 14 named metrics beyond the k6 defaults, so options.thresholds can gate each one rather than a single global p95. List and examples: references/custom-metrics.md.
Reports
handleSummary() writes summary.html via k6-reporter — per-group timings, VU curves, threshold badges — alongside the stdout summary.
Key Pitfalls
- Load testing without warming up — cold caches inflate mean and p95 for everything.
warmingUpTheApp.jsatTHRESHOLD_95=3000first, always. - Docker without
-u $(id -u):$(id -g)—summary.htmllands root-owned in the mounted volume; later runs cannot overwrite it and you cannot delete it withoutsudo. - A single global
THRESHOLD_95— a slow listing hides behind a fast login in the aggregate. Threshold the named metrics. - Default
--network bridgeagainst localhost — the container cannot reach host compose services. Use--network host, or attach it to the compose network.
See Also
In references/: custom-metrics.md (the 14 named metrics) · docker-invocation.md (flag by flag, network modes, ownership) · default-metrics.md (the 9 built-ins and derived KPIs) · install.md · v6.1.md · v7.0.md