Skip to content

Commit

Permalink
feat: use new slo actions
Browse files Browse the repository at this point in the history
  • Loading branch information
polRk committed Oct 24, 2024
1 parent 0c88eea commit ed9f1c6
Showing 1 changed file with 47 additions and 18 deletions.
65 changes: 47 additions & 18 deletions .github/workflows/slo.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
name: SLO
name: slo

on:
pull_request:
branches:
- master
- release-*
workflow_dispatch:
inputs:
github_pull_request_number:
required: true

jobs:
test-slo:
concurrency:
group: slo-${{ github.ref }}
ydb-slo-action-init:
if: (!contains(github.event.pull_request.labels.*.name, 'no slo'))

name: Run YDB SLO Tests
runs-on: ubuntu-latest
name: SLO test

permissions:
checks: write
issues: write
contents: read
pull-requests: write
strategy:
matrix:
sdk:
- id: database_sql
name: database-sql
path: ./database/sql
label: database/sql
- id: native_query
name: native-query
path: ./native/query
label: native/query
- id: native_table
name: native-table
path: ./native/table
label: native/table
- id: gorm
name: gorm
path: ./gorm
label: gorm
- id: xorm
name: xorm
path: ./xorm
label: xorm

concurrency:
group: slo-${{ github.ref }}-${{matrix.sdk.name}}

steps:
- name: Checkout repository
Expand All @@ -33,13 +57,18 @@ jobs:
- name: Build workload
run: |
cd ./tests/slo
go build -o .bin/native_query_linux_amd64 -ldflags "-X \"main.ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}\" -X \"main.label=native/query\" -X \"main.jobName=native-query\"" ./native/query
chmod +x .bin/native_query_linux_amd64
go build -o .bin/${{matrix.sdk.id}}_linux_amd64 -ldflags "-X \"main.ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}\" -X \"main.label=${{matrix.sdk.label}}\" -X \"main.jobName=${{matrix.sdk.name}}\"" ${{matrix.sdk.path}}
chmod +x .bin/${{matrix.sdk.id}}_linux_amd64
- name: Run SLO
uses: ydb-platform/slo-tests@v2
continue-on-error: true
- name: Inititialize YDB SLO
uses: ydb-platform/ydb-slo-action/init@main
with:
GITHUB_TOKEN: ${{ secrets.YDB_PLATFORM_BOT_TOKEN_REPO }}
WORKLOAD_RUNNER: "./tests/slo/.bin/native_query_linux_amd64 create grpc://localhost:2135 /Root/testdb && ./tests/slo/.bin/native_query_linux_amd64 run grpc://localhost:2135 /Root/testdb -prom-pgw localhost:9091 -report-period 500 -time 60 && ./tests/slo/.bin/native_query_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb"
CHAOS_TEST_RUNNER: "sleep 90"
github_pull_request_number: ${{ github.event.inputs.github_pull_request_number }}
github_token: ${{ secrets.GITHUB_TOKEN }}
sdk_name: ${{ matrix.sdk.name }}

- name: Run SLO Tests
run: |
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 create grpc://localhost:2135 /Root/testdb
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 run grpc://localhost:2135 /Root/testdb -prom-pgw localhost:9091 -report-period 500 -time 60
./tests/slo/.bin/${{matrix.sdk.id}}_linux_amd64 cleanup grpc://localhost:2135 /Root/testdb

0 comments on commit ed9f1c6

Please sign in to comment.