Skip to content

Commit

Permalink
performance tests
Browse files Browse the repository at this point in the history
675bb6344beb71c0e2232216f323cb10d9ea5149
  • Loading branch information
oke11o committed Jun 21, 2024
1 parent 9cb91f5 commit 1f3931d
Show file tree
Hide file tree
Showing 50 changed files with 2,644 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .changes/v0.5.27.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## v0.5.27 - 2024-06-18
### Added
* Performance test on release
25 changes: 25 additions & 0 deletions .github/actions/setup-yc/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: 'Setup YC tools'
description: 'Setup and configure required tools'
runs:
using: "composite"
steps:
- name: Check secret is set
shell: bash
run: |
if [[ -z "$YC_LT_AUTHORIZED_KEY_JSON" ]]; then echo "YC_LT_AUTHORIZED_KEY_JSON is empty" && exit 1; else echo "YC_LT_AUTHORIZED_KEY_JSON is set"; fi
- name: install utilities
shell: bash
run: |
sudo DEBIAN_FRONTEND=noninteractive apt update
sudo DEBIAN_FRONTEND=noninteractive apt install -y curl jq
sudo curl -f -s -LO https://storage.yandexcloud.net/yandexcloud-yc/install.sh
sudo bash install.sh -i /usr/local/yandex-cloud -n
sudo ln -sf /usr/local/yandex-cloud/bin/yc /usr/local/bin/yc
- name: configure yc cli
shell: bash
run: |
echo "$YC_LT_AUTHORIZED_KEY_JSON" > key.json
yc config profile create sa-profile
yc config set service-account-key ./key.json
yc config set format json
yc config set folder-id "$YC_LT_FOLDER_ID"
83 changes: 69 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ on:
- master
- dev

env:
YC_LT_FOLDER_ID: b1gacohsvc2kc4d76tu5
YC_LT_AUTHORIZED_KEY_JSON: ${{ secrets.YC_LOADTESTING_CI_AUTHORIZED_KEY_JSON }}
YC_LT_TEST_AGENT_FILTER: "name = 'agent-pandora-perf-medium'"
YC_LT_TEST_EXTRA_DESCRIPTION: "GitHub Actions workflow - ${{github.run_id}}"
YC_LT_SKIP_TEST_CHECK: "1"
YC_LT_DATA_BUCKET: ${{ secrets.YC_LT_DATA_BUCKET }}
YC_LT_OUTPUT_DIR: ${{github.workspace}}/performance-test/output

jobs:
run-unit-tests:
name: Unit Tests
Expand All @@ -19,7 +28,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu, macOS]
os: [ubuntu]
env:
OS: ${{ matrix.os }}-latest
GO: ${{ matrix.go-version }}
Expand All @@ -28,18 +37,64 @@ jobs:
- name: Checkout code
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
cache: true

- name: Test
run: go test -race -coverprofile unit.txt -covermode atomic ./...
- name: Parse to Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: 161082234
run: |
cat <<EOF > imbalance.txt
## Performance tests
- pandora-perf-grpc-300inst-sleep0ms: 12344
- pandora-perf-grpc-3000inst-sleep0ms: 15555
EOF
sed G imbalance.txt > imbalance.md
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v3
- name: Update release
id: update_release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG_NAME: v0.5.27.alpha13
with:
file: ./unit.txt
flags: unit,${{ matrix.os }},go-${{ matrix.go-version }}
name: unit
body_path: ./imbalance.md
is_append_body: true

# build-and-upload:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup-yc
# - name: Install Go
# uses: actions/setup-go@v3
# with:
# go-version: 1.21.x
# cache: true
# - name: Test
# run: go test -race -covermode atomic ./...
# - name: Build
# run: |
# export GOOS=linux
# export CGO_ENABLED=0
# go build -o pandora_perf_2
# - name: Upload
# run: |
# source performance-test/automation/_functions.sh && source performance-test/automation/_variables.sh; yc_s3_upload ./pandora_perf_2 pandora-perf ${YC_LT_DATA_BUCKET}
#
# test-pandora-perf:
# needs: [ build-and-upload ]
# runs-on: ubuntu-latest
# concurrency: { group: loadtesting }
# steps:
# - uses: actions/checkout@v4
# - uses: ./.github/actions/setup-yc
# - name: Run Test HTTP-300inst-sleep0ms
# run: |
# stripped_tag="${{ github.event.release.tag_name }}"
# STRIPPED_TAG=${stripped_tag:1}
# YC_LT_VERBOSE=2 YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-300inst-sleep0ms
# - name: Upload Artifacts GRPC 300inst-sleep0ms
# uses: actions/upload-artifact@v4
# with:
# name: pandora-perf-grpc-300inst-sleep0ms
# path: ${{ env.YC_LT_OUTPUT_DIR }}
127 changes: 127 additions & 0 deletions .github/workflows/yc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
name: Performance tests

on:
release:
types: [ created ]
env:
YC_LT_FOLDER_ID: b1gacohsvc2kc4d76tu5
YC_LT_AUTHORIZED_KEY_JSON: ${{ secrets.YC_LOADTESTING_CI_AUTHORIZED_KEY_JSON }}
YC_LT_TEST_AGENT_FILTER: "name = 'agent-pandora-perf-medium'"
YC_LT_TEST_EXTRA_DESCRIPTION: "GitHub Actions workflow - ${{github.run_id}}"
YC_LT_SKIP_TEST_CHECK: "1"
YC_LT_DATA_BUCKET: ${{ secrets.YC_LT_DATA_BUCKET }}
YC_LT_OUTPUT_DIR: ${{github.workspace}}/performance-test/output

jobs:
build-and-upload:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-yc
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: 1.21.x
cache: true
- name: Test
run: go test -race -covermode atomic ./...
- name: Build
run: |
export GOOS=linux
export CGO_ENABLED=0
go build -o pandora_perf_2
- name: Upload
run: |
source performance-test/automation/_functions.sh && source performance-test/automation/_variables.sh; yc_s3_upload ./pandora_perf_2 pandora-perf ${YC_LT_DATA_BUCKET}
test-pandora-perf:
needs: [ build-and-upload ]
runs-on: ubuntu-latest
concurrency: { group: loadtesting }
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-yc
- name: Run Test HTTP-300inst-sleep0ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-300inst-sleep0ms-overflow-false
- name: Run Test HTTP-2000inst-sleep0ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-2000inst-sleep0ms-overflow-false
- name: Run Test HTTP-2000inst-sleep50ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-2000inst-sleep50ms-overflow-false
- name: Run Test HTTP-300inst-sleep0ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-300inst-sleep0ms-overflow-true
- name: Run Test HTTP-2000inst-sleep0ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-2000inst-sleep0ms-overflow-true
- name: Run Test HTTP-2000inst-sleep50ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-http-uri-2000inst-sleep50ms-overflow-true
- name: Run Test GRPC-2000inst-sleep50ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep0ms-overflow-false
- name: Run Test GRPC-2000inst-sleep50ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep50ms-overflow-false
- name: Run Test GRPC-300inst-sleep0ms-overflow-false
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-300inst-sleep0ms-overflow-false
- name: Run Test GRPC-2000inst-sleep50ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep0ms-overflow-true
- name: Run Test GRPC-2000inst-sleep50ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep50ms-overflow-true
- name: Run Test GRPC-300inst-sleep0ms-overflow-true
run: |
stripped_tag="${{ github.event.release.tag_name }}"
STRIPPED_TAG=${stripped_tag:1}
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-300inst-sleep0ms-overflow-true
- name: Upload Artifacts GRPC 300inst-sleep0ms
uses: actions/upload-artifact@v4
with:
name: pandora-perf-grpc-300inst-sleep0ms
path: ${{ env.YC_LT_OUTPUT_DIR }}

- name: Parse to Release 2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_ID: 161082234
run: |
cat <<EOF > imbalance.md
## Performance tests
EOF
find $YC_LT_OUTPUT_DIR -name 'summary.json' -exec jq -r '"- \(.details.name): **\(.summary.imbalance_point.rps // "0" | tonumber)**"' {} \; | sort >> imbalance.md
- name: Update release
id: update_release
uses: tubone24/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body_path: ./imbalance.md
is_append_body: true
Loading

0 comments on commit 1f3931d

Please sign in to comment.