Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Added load testing using artillery

rafaelsideguide7297b21dcdf5
diff --git a/apps/test-suite/README.md b/apps/test-suite/README.md
index 450a0e305..bb11c6f90 100644
--- a/apps/test-suite/README.md
+++ b/apps/test-suite/README.md
@@ -16,6 +16,22 @@ npx playwright install
npm run test
```
+## Running Load Tests with Artillery
+
+To run load tests using Artillery, follow these steps:
+
+1. Install Artillery globally if you haven't already:
+
+```bash
+npm install -g artillery
+```
+
+2. Run the load test:
+
+```bash
+artillery run load-test.yml
+```
+
## Test Results
The tests are designed to cover various aspects of the system, including:
diff --git a/apps/test-suite/load-test.yml b/apps/test-suite/load-test.yml
new file mode 100644
index 000000000..5b881ef23
--- /dev/null
+++ b/apps/test-suite/load-test.yml
@@ -0,0 +1,60 @@
+config:
+ target: "https://api.firecrawl.dev/v0" # <<< ADD HERE THE URL FOR THE STAGING ENVIRONMENT
+ phases:
+ - duration: 1
+ arrivalRate: 5
+ defaults:
+ headers:
+ Authorization: "Bearer {{ $env.TEST_API_KEY }}"
+scenarios:
+ - name: Scrape a URL
+ flow:
+ - post:
+ url: "/scrape"
+ json:
+ url: "https://www.scrapethissite.com"
+ pageOptions:
+ onlyMainContent: true
+ capture:
+ - json: "$.data.markdown"
+ as: markdown_content
+
+ # - name: Crawl a URL
+ # flow:
+ # - post:
+ # url: "/crawl"
+ # json:
+ # url: "https://mendable.ai"
+ # crawlerOptions:
+ # includes: []
+ # excludes: ["blog/*"]
+ # limit: 100
+ # pageOptions:
+ # onlyMainContent: true
+ # capture:
+ # - json: "$.jobId"
+ # as: job_id
+ # - get:
+ # url: "/crawl/status/{{ job_id }}"
+ # capture:
+ # - json: "$.status"
+ # as: crawl_status
+ # until:
+ # - condition: "equals"
+ # value: "completed"
+ # variable: "crawl_status"
+ # retry:
+ # count: 20
+ # wait: 10
+
+ # - name: Search for a query
+ # flow:
+ # - post:
+ # url: "/search"
+ # json:
+ # query: "firecrawl"
+ # pageOptions:
+ # fetchPageContent: true
+ # capture:
+ # - json: "$.data[0].markdown"
+ # as: search_markdown_content
\ No newline at end of file
diff --git a/apps/test-suite/package.json b/apps/test-suite/package.json
index 74ab7a6b8..6fb3c4e6f 100644
--- a/apps/test-suite/package.json
+++ b/apps/test-suite/package.json
@@ -3,7 +3,9 @@
"version": "1.0.0",
"description": "",
"scripts": {
- "test": "npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false"
+ "test:suite": "npx jest --detectOpenHandles --forceExit --openHandlesTimeout=120000 --watchAll=false",
+ "test:load": "artillery run load-test.yml",
+ "fly:staging": "fly deploy -c fly.staging.toml"
},
"author": "",
"license": "ISC",