-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
113 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: SLO tests | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
workflow_dispatch: | ||
inputs: | ||
github_pull_request_number: | ||
required: true | ||
description: '' | ||
slo_workload_duration_seconds: | ||
default: '600' | ||
required: false | ||
description: '' | ||
slo_workload_read_max_rps: | ||
default: '1000' | ||
required: false | ||
description: '' | ||
slo_workload_write_max_rps: | ||
default: '100' | ||
required: false | ||
description: '' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | ||
RUST_VERSION_OLD: "1.68.0" | ||
RUST_VERSION_NEW: "1.81.0" | ||
|
||
jobs: | ||
ydb-slo-action-init: | ||
if: (!contains(github.event.pull_request.labels.*.name, 'no slo')) | ||
|
||
name: Run YDB SLO Tests | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
example: | ||
- native | ||
rust_version: | ||
- "RUST_VERSION_OLD" | ||
- "RUST_VERSION_NEW" | ||
|
||
concurrency: | ||
group: slo-${{ github.ref }}-${{ matrix.example }} | ||
cancel-in-progress: true | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Install rust | ||
uses: dtolnay/rust-toolchain@v1 | ||
with: | ||
toolchain: ${{ env[matrix.rust_version] }} | ||
components: clippy | ||
|
||
- name: Rust version | ||
id: rust_version_step | ||
run: | | ||
rustc --version | ||
cargo --version | ||
echo "CARGO_INCREMENTAL=$CARGO_INCREMENTAL" | ||
echo "::set-output name=version::$(rustc --version | cut -d ' ' -f 2)" | ||
- name: Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
|
||
- name: Inititialize 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: ${{ matrix.example }} | ||
ydb_database_node_count: 5 | ||
|
||
- name: Prepare SLO Database | ||
run: | | ||
cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb testingTable create | ||
- name: Run SLO Tests | ||
env: | ||
REF: '${{ github.head_ref || github.ref }}' | ||
run: | | ||
cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb testingTable run \ | ||
-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 || true | ||
- if: always() | ||
name: Cleanup SLO Database | ||
run: | | ||
cargo run --example ${{ matrix.example }} grpc://localhost:2135 /Root/testdb testingTable cleanup | ||
- 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: ${{ matrix.workload }}-chaos-ydb.log | ||
path: ./chaos-ydb.log | ||
retention-days: 1 |