test: update slo tests #356
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SLO | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
github_pull_request_number: | |
required: true | |
slo_workload_duration_seconds: | |
default: '600' | |
required: false | |
slo_workload_read_max_rps: | |
default: '1000' | |
required: false | |
slo_workload_write_max_rps: | |
default: '100' | |
required: false | |
jobs: | |
ydb-slo-action: | |
if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) | |
name: Run YDB SLO Tests | |
runs-on: ubuntu-latest | |
concurrency: | |
group: slo-${{ github.ref }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install NodeJS | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 'lts/Hydrogen' | |
cache: 'npm' | |
- name: Install dependencies | |
run: | | |
npm ci | |
npm ci --prefix slo-workload | |
npm run build | |
- name: Initialize YDB SLO | |
uses: ydb-platform/ydb-slo-action/init@main | |
with: | |
github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
workload_name: nodejs | |
ydb_database_node_count: 5 | |
- name: Prepare SLO Database | |
run: | | |
npm start --prefix slo-workload -- create grpc://localhost:2135 /Root/testdb | |
- name: Run SLO Tests | |
env: | |
REF: '${{ github.head_ref || github.ref }}' | |
run: | | |
npm start --prefix slo-workload -- run grpc://localhost:2135 /Root/testdb \ | |
--prom-pgw http://localhost:9091 \ | |
--report-period 250 \ | |
--time ${{inputs.slo_workload_duration_seconds || 600}} \ | |
--read-rps ${{inputs.slo_workload_read_max_rps || 1000}} \ | |
--write-rps ${{inputs.slo_workload_write_max_rps || 100}} \ | |
--read-timeout 1000 \ | |
--write-timeout 1000 | |
- if: always() | |
name: Cleanup SLO Database | |
run: | | |
npm start --prefix slo-workload -- cleanup grpc://localhost:2135 /Root/testdb | |
- if: always() | |
name: Store ydb chaos testing logs | |
run: | | |
docker logs ydb-chaos > chaos-ydb.log | |
- if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nodejs-chaos-ydb.log | |
path: ./chaos-ydb.log | |
retention-days: 1 |