mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
Added load testing using artillery
This commit is contained in:
parent
a480595aa7
commit
7297b21dcd
|
@ -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:
|
||||
|
|
60
apps/test-suite/load-test.yml
Normal file
60
apps/test-suite/load-test.yml
Normal file
|
@ -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
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue
Block a user