Files
calendar/tests/performance/spike/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
680 B
JavaScript

import { sleep } from "k6";
import { THRESHOLDS } from "../utils/config.js";
import { viewBookingPage } from "../utils/helpers.js";
export const options = {
stages: [
{ duration: "1m", target: 500 }, // Baseline load
{ duration: "2m", target: 5000 }, // Rapid spike to 5000 VUs
{ duration: "5m", target: 5000 }, // Stay at 5000 VUs
{ duration: "2m", target: 500 }, // Scale back to baseline
{ duration: "1m", target: 0 }, // Scale down to 0
],
thresholds: {
http_req_failed: THRESHOLDS.HTTP_ERRORS,
http_req_duration: THRESHOLDS.RESPONSE_TIME.SPIKE.p95,
},
};
export default function () {
viewBookingPage("pro", "30min");
sleep(0.1);
}