Files
calendar/tests/performance/load/booking.js
T
Anik Dhabal BabuGitHubDevin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>Volnei Munhoz
a22ca4758c test: Performance tests suite (#21226)
* fix: add org email into ics

* perf test

* update

* fix: address bot comments on performance tests

- Add validation to randomSleep function to ensure min <= max
- Replace new Date().getTime() with Date.now() for better performance
- Move hardcoded test credentials to environment variables
- Add HTTP timeout to requests in helpers.js
- Improve DOM element checking to be less brittle
- Fix spike test sleep duration from 0.01s to 0.1s
- Make GitHub workflow BASE_URL configurable with inputs
- Fix README filename reference from booking_flow.js to booking.js
- Add documentation for new environment variables

Co-Authored-By: anik@cal.com <adhabal2002@gmail.com>

* Add script and small sec check

* chore: fix script path

* chore: fix script path

* chore: change default url

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Volnei Munhoz <volnei.munhoz@gmail.com>
2025-08-26 09:16:19 -03:00

25 lines
757 B
JavaScript

import { sleep } from "k6";
import { THRESHOLDS } from "../utils/config.js";
import { viewBookingPage } from "../utils/helpers.js";
export const options = {
stages: [
{ duration: "2m", target: 500 }, // Ramp up to 500 VUs over 2 minutes
{ duration: "3m", target: 1000 }, // Ramp up to 1000 VUs over 3 minutes
{ duration: "5m", target: 2000 }, // Ramp up to 2000 VUs over 5 minutes
{ duration: "10m", target: 2000 }, // Stay at 2000 VUs for 10 minutes
{ duration: "3m", target: 0 }, // Ramp down to 0 VUs over 3 minutes
],
thresholds: {
http_req_failed: THRESHOLDS.HTTP_ERRORS,
http_req_duration: THRESHOLDS.RESPONSE_TIME.LOAD.p95,
},
};
export default function () {
viewBookingPage("pro", "30min");
sleep(0.1);
}