- Maven 3
- JDK 17
- K6 (install according to manual)
- Get candidates (should be read from json file)
- Make vote (by passport id) (no double vote allowed)
- Get voting results
mvn clean install
- Use
run.bat
script in project root folder or - Use Docker compose:
docker-compose up
http://localhost:8090/swagger-ui.html
- Get candidates
curl http://localhost:8090/candidates
- Get voting results
curl http://localhost:8090/votings
- Make vote
curl -X POST http://localhost:8090/votings/3434 \
-H "Content-Type: application/json" \
-d "{ \"name\": \"Andrei\", \"passportId\": \"MP345353634543\"}"
cd func-tests
./gradlew clean build
Check tests report at ./func-tests/build/spock-reports/index.html
cd load-tests
k6 run script.js
- Start InfluxDB and Grafana (according to https://k6.io/blog/k6-loves-grafana/)
git clone https://github.com/grafana/k6 && cd k6
git submodule update --init
docker-compose up -d influxdb grafana
Grafana available via http://localhost:3000
Add datasource with next params:
URL: http://localhost:8086 Access: Browser Database: mydb HTTP Method: GET
- Run load test with sending data to Grafana
k6 run -o influxdb=http://localhost:8086/mydb script.js
- Import dashboard to Grafana from file
./load-tests/k6-grafana-dashboard.json
and get results