Skip to content

Commit 1f3931d

Browse files
committed
performance tests
675bb6344beb71c0e2232216f323cb10d9ea5149
1 parent 9cb91f5 commit 1f3931d

50 files changed

Lines changed: 2644 additions & 15 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changes/v0.5.27.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## v0.5.27 - 2024-06-18
2+
### Added
3+
* Performance test on release
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: 'Setup YC tools'
2+
description: 'Setup and configure required tools'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Check secret is set
7+
shell: bash
8+
run: |
9+
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
10+
- name: install utilities
11+
shell: bash
12+
run: |
13+
sudo DEBIAN_FRONTEND=noninteractive apt update
14+
sudo DEBIAN_FRONTEND=noninteractive apt install -y curl jq
15+
sudo curl -f -s -LO https://storage.yandexcloud.net/yandexcloud-yc/install.sh
16+
sudo bash install.sh -i /usr/local/yandex-cloud -n
17+
sudo ln -sf /usr/local/yandex-cloud/bin/yc /usr/local/bin/yc
18+
- name: configure yc cli
19+
shell: bash
20+
run: |
21+
echo "$YC_LT_AUTHORIZED_KEY_JSON" > key.json
22+
yc config profile create sa-profile
23+
yc config set service-account-key ./key.json
24+
yc config set format json
25+
yc config set folder-id "$YC_LT_FOLDER_ID"

.github/workflows/test.yml

Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ on:
1010
- master
1111
- dev
1212

13+
env:
14+
YC_LT_FOLDER_ID: b1gacohsvc2kc4d76tu5
15+
YC_LT_AUTHORIZED_KEY_JSON: ${{ secrets.YC_LOADTESTING_CI_AUTHORIZED_KEY_JSON }}
16+
YC_LT_TEST_AGENT_FILTER: "name = 'agent-pandora-perf-medium'"
17+
YC_LT_TEST_EXTRA_DESCRIPTION: "GitHub Actions workflow - ${{github.run_id}}"
18+
YC_LT_SKIP_TEST_CHECK: "1"
19+
YC_LT_DATA_BUCKET: ${{ secrets.YC_LT_DATA_BUCKET }}
20+
YC_LT_OUTPUT_DIR: ${{github.workspace}}/performance-test/output
21+
1322
jobs:
1423
run-unit-tests:
1524
name: Unit Tests
@@ -19,7 +28,7 @@ jobs:
1928
strategy:
2029
fail-fast: false
2130
matrix:
22-
os: [ubuntu, macOS]
31+
os: [ubuntu]
2332
env:
2433
OS: ${{ matrix.os }}-latest
2534
GO: ${{ matrix.go-version }}
@@ -28,18 +37,64 @@ jobs:
2837
- name: Checkout code
2938
uses: actions/checkout@v3
3039

31-
- name: Install Go
32-
uses: actions/setup-go@v3
33-
with:
34-
go-version: 1.21.x
35-
cache: true
36-
37-
- name: Test
38-
run: go test -race -coverprofile unit.txt -covermode atomic ./...
40+
- name: Parse to Release
41+
env:
42+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
RELEASE_ID: 161082234
44+
run: |
45+
cat <<EOF > imbalance.txt
46+
## Performance tests
47+
- pandora-perf-grpc-300inst-sleep0ms: 12344
48+
- pandora-perf-grpc-3000inst-sleep0ms: 15555
49+
EOF
50+
51+
sed G imbalance.txt > imbalance.md
3952
40-
- name: Upload coverage report to Codecov
41-
uses: codecov/codecov-action@v3
53+
- name: Update release
54+
id: update_release
55+
uses: tubone24/update_release@v1.0
56+
env:
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
TAG_NAME: v0.5.27.alpha13
4259
with:
43-
file: ./unit.txt
44-
flags: unit,${{ matrix.os }},go-${{ matrix.go-version }}
45-
name: unit
60+
body_path: ./imbalance.md
61+
is_append_body: true
62+
63+
# build-and-upload:
64+
# runs-on: ubuntu-latest
65+
# steps:
66+
# - uses: actions/checkout@v4
67+
# - uses: ./.github/actions/setup-yc
68+
# - name: Install Go
69+
# uses: actions/setup-go@v3
70+
# with:
71+
# go-version: 1.21.x
72+
# cache: true
73+
# - name: Test
74+
# run: go test -race -covermode atomic ./...
75+
# - name: Build
76+
# run: |
77+
# export GOOS=linux
78+
# export CGO_ENABLED=0
79+
# go build -o pandora_perf_2
80+
# - name: Upload
81+
# run: |
82+
# source performance-test/automation/_functions.sh && source performance-test/automation/_variables.sh; yc_s3_upload ./pandora_perf_2 pandora-perf ${YC_LT_DATA_BUCKET}
83+
#
84+
# test-pandora-perf:
85+
# needs: [ build-and-upload ]
86+
# runs-on: ubuntu-latest
87+
# concurrency: { group: loadtesting }
88+
# steps:
89+
# - uses: actions/checkout@v4
90+
# - uses: ./.github/actions/setup-yc
91+
# - name: Run Test HTTP-300inst-sleep0ms
92+
# run: |
93+
# stripped_tag="${{ github.event.release.tag_name }}"
94+
# STRIPPED_TAG=${stripped_tag:1}
95+
# 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
96+
# - name: Upload Artifacts GRPC 300inst-sleep0ms
97+
# uses: actions/upload-artifact@v4
98+
# with:
99+
# name: pandora-perf-grpc-300inst-sleep0ms
100+
# path: ${{ env.YC_LT_OUTPUT_DIR }}

.github/workflows/yc.yml

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
name: Performance tests
2+
3+
on:
4+
release:
5+
types: [ created ]
6+
env:
7+
YC_LT_FOLDER_ID: b1gacohsvc2kc4d76tu5
8+
YC_LT_AUTHORIZED_KEY_JSON: ${{ secrets.YC_LOADTESTING_CI_AUTHORIZED_KEY_JSON }}
9+
YC_LT_TEST_AGENT_FILTER: "name = 'agent-pandora-perf-medium'"
10+
YC_LT_TEST_EXTRA_DESCRIPTION: "GitHub Actions workflow - ${{github.run_id}}"
11+
YC_LT_SKIP_TEST_CHECK: "1"
12+
YC_LT_DATA_BUCKET: ${{ secrets.YC_LT_DATA_BUCKET }}
13+
YC_LT_OUTPUT_DIR: ${{github.workspace}}/performance-test/output
14+
15+
jobs:
16+
build-and-upload:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: ./.github/actions/setup-yc
21+
- name: Install Go
22+
uses: actions/setup-go@v3
23+
with:
24+
go-version: 1.21.x
25+
cache: true
26+
- name: Test
27+
run: go test -race -covermode atomic ./...
28+
- name: Build
29+
run: |
30+
export GOOS=linux
31+
export CGO_ENABLED=0
32+
go build -o pandora_perf_2
33+
- name: Upload
34+
run: |
35+
source performance-test/automation/_functions.sh && source performance-test/automation/_variables.sh; yc_s3_upload ./pandora_perf_2 pandora-perf ${YC_LT_DATA_BUCKET}
36+
37+
test-pandora-perf:
38+
needs: [ build-and-upload ]
39+
runs-on: ubuntu-latest
40+
concurrency: { group: loadtesting }
41+
steps:
42+
- uses: actions/checkout@v4
43+
- uses: ./.github/actions/setup-yc
44+
- name: Run Test HTTP-300inst-sleep0ms-overflow-false
45+
run: |
46+
stripped_tag="${{ github.event.release.tag_name }}"
47+
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
48+
- name: Run Test HTTP-2000inst-sleep0ms-overflow-false
49+
run: |
50+
stripped_tag="${{ github.event.release.tag_name }}"
51+
STRIPPED_TAG=${stripped_tag:1}
52+
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
53+
- name: Run Test HTTP-2000inst-sleep50ms-overflow-false
54+
run: |
55+
stripped_tag="${{ github.event.release.tag_name }}"
56+
STRIPPED_TAG=${stripped_tag:1}
57+
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
58+
- name: Run Test HTTP-300inst-sleep0ms-overflow-true
59+
run: |
60+
stripped_tag="${{ github.event.release.tag_name }}"
61+
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
62+
- name: Run Test HTTP-2000inst-sleep0ms-overflow-true
63+
run: |
64+
stripped_tag="${{ github.event.release.tag_name }}"
65+
STRIPPED_TAG=${stripped_tag:1}
66+
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
67+
- name: Run Test HTTP-2000inst-sleep50ms-overflow-true
68+
run: |
69+
stripped_tag="${{ github.event.release.tag_name }}"
70+
STRIPPED_TAG=${stripped_tag:1}
71+
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
72+
- name: Run Test GRPC-2000inst-sleep50ms-overflow-false
73+
run: |
74+
stripped_tag="${{ github.event.release.tag_name }}"
75+
STRIPPED_TAG=${stripped_tag:1}
76+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep0ms-overflow-false
77+
- name: Run Test GRPC-2000inst-sleep50ms-overflow-false
78+
run: |
79+
stripped_tag="${{ github.event.release.tag_name }}"
80+
STRIPPED_TAG=${stripped_tag:1}
81+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep50ms-overflow-false
82+
- name: Run Test GRPC-300inst-sleep0ms-overflow-false
83+
run: |
84+
stripped_tag="${{ github.event.release.tag_name }}"
85+
STRIPPED_TAG=${stripped_tag:1}
86+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-300inst-sleep0ms-overflow-false
87+
- name: Run Test GRPC-2000inst-sleep50ms-overflow-true
88+
run: |
89+
stripped_tag="${{ github.event.release.tag_name }}"
90+
STRIPPED_TAG=${stripped_tag:1}
91+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep0ms-overflow-true
92+
- name: Run Test GRPC-2000inst-sleep50ms-overflow-true
93+
run: |
94+
stripped_tag="${{ github.event.release.tag_name }}"
95+
STRIPPED_TAG=${stripped_tag:1}
96+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-2000inst-sleep50ms-overflow-true
97+
- name: Run Test GRPC-300inst-sleep0ms-overflow-true
98+
run: |
99+
stripped_tag="${{ github.event.release.tag_name }}"
100+
STRIPPED_TAG=${stripped_tag:1}
101+
YC_LT_TEST_EXTRA_LABELS="version=${STRIPPED_TAG}" ./performance-test/automation/test.sh ./performance-test/test-config/pandora-perf-grpc-300inst-sleep0ms-overflow-true
102+
- name: Upload Artifacts GRPC 300inst-sleep0ms
103+
uses: actions/upload-artifact@v4
104+
with:
105+
name: pandora-perf-grpc-300inst-sleep0ms
106+
path: ${{ env.YC_LT_OUTPUT_DIR }}
107+
108+
- name: Parse to Release 2
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
111+
RELEASE_ID: 161082234
112+
run: |
113+
cat <<EOF > imbalance.md
114+
115+
## Performance tests
116+
117+
EOF
118+
find $YC_LT_OUTPUT_DIR -name 'summary.json' -exec jq -r '"- \(.details.name): **\(.summary.imbalance_point.rps // "0" | tonumber)**"' {} \; | sort >> imbalance.md
119+
120+
- name: Update release
121+
id: update_release
122+
uses: tubone24/update_release@v1.3.1
123+
env:
124+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
with:
126+
body_path: ./imbalance.md
127+
is_append_body: true

0 commit comments

Comments
 (0)