This repository was created for basic/intermediate learning of using K6.
- Node.js JS v16 or higher for API usage
- K6 Installation
- MongoDB for API usage -
MongoDB NOTE:
- Create a project
- Create an user and password
- Update the MONGO_URL in api/src/.env file => mongodb+srv://USER:PASSWORD@cluster0.3yi5vct.mongodb.net/UserDB?retryWrites=true&w=majority
- Should return the IDs when registering a new user
- Should return 201 when registering a new user
- Should return 400 when trying to register without email and password
- Should return 400 if the email is duplicated
campos | descrição | tipo | obrigatório |
---|---|---|---|
unique user identifier | yes | ||
password | user's password | text | yes |
- Successful registration should occur within 2 seconds
- Unsuccessful registrations should occur within 2 seconds
- Up to 100 simultaneous user registrations should be supported
- The error margin in registration should be at least 1%
- [Node.js] - development platform
- [Express] - framework where the API was built
- [MongoDB] - Database (Non-relational)
Execute the following commands to install the project's dependencies:
cd api
yarn install
yarn dev
Run k6 with the following command:
k6 run script.js
Now run a load test with more than one virtual user and a longer duration:
k6 run --vus 10 --duration 30s script.js
Running a 30-second, 10-VU load test
This project is licensed under the MIT License - see the LICENSE file for details.
Official repository: https://github.com/weareqacademy/curso-k6-basico