forked from phoenix/litellm-mirror
(ci/cd) show load test info on release
This commit is contained in:
parent
982c17a326
commit
95aa7a7dc9
2 changed files with 26 additions and 1 deletions
16
.github/workflows/interpret_load_test.py
vendored
16
.github/workflows/interpret_load_test.py
vendored
|
@ -1,4 +1,6 @@
|
||||||
import csv
|
import csv
|
||||||
|
import os
|
||||||
|
from github import Github
|
||||||
|
|
||||||
|
|
||||||
def csv_to_markdown(csv_file):
|
def csv_to_markdown(csv_file):
|
||||||
|
@ -52,6 +54,18 @@ def interpret_results(csv_file):
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
csv_file = "load_test_stats.csv" # Change this to the path of your CSV file
|
csv_file = "load_test_stats.csv" # Change this to the path of your CSV file
|
||||||
interpret_results(csv_file)
|
interpreted_results_str = interpret_results(csv_file)
|
||||||
markdown_table = csv_to_markdown(csv_file)
|
markdown_table = csv_to_markdown(csv_file)
|
||||||
print(markdown_table)
|
print(markdown_table)
|
||||||
|
|
||||||
|
# Update release body with interpreted results
|
||||||
|
github_token = os.getenv("GITHUB_TOKEN")
|
||||||
|
g = Github(github_token)
|
||||||
|
repo = g.get_repo(
|
||||||
|
"BerriAI/litellm"
|
||||||
|
) # Replace with your repository's username and name
|
||||||
|
latest_release = repo.get_latest_release()
|
||||||
|
print("got latest release: ", latest_release)
|
||||||
|
latest_release.update_release(
|
||||||
|
body=latest_release.body + "\n\n" + interpreted_results_str
|
||||||
|
)
|
||||||
|
|
11
.github/workflows/load_test.yml
vendored
11
.github/workflows/load_test.yml
vendored
|
@ -8,6 +8,15 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v1
|
uses: actions/checkout@v1
|
||||||
|
- name: Setup Python
|
||||||
|
uses: actions/setup-python@v2
|
||||||
|
with:
|
||||||
|
python-version: '3.x'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install PyGithub
|
||||||
- name: Run Load Test
|
- name: Run Load Test
|
||||||
id: locust_run
|
id: locust_run
|
||||||
uses: BerriAI/locust-github-action@master
|
uses: BerriAI/locust-github-action@master
|
||||||
|
@ -24,6 +33,8 @@ jobs:
|
||||||
python ".github/workflows/interpret_load_test.py"
|
python ".github/workflows/interpret_load_test.py"
|
||||||
interpreted_results=$(cat load_test_interpreted_results.txt)
|
interpreted_results=$(cat load_test_interpreted_results.txt)
|
||||||
echo "::set-output name=interpreted_results::$interpreted_results"
|
echo "::set-output name=interpreted_results::$interpreted_results"
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
working-directory: ${{ github.workspace }}
|
working-directory: ${{ github.workspace }}
|
||||||
- name: Upload CSV as Asset to Latest Release
|
- name: Upload CSV as Asset to Latest Release
|
||||||
uses: xresloader/upload-to-github-release@v1
|
uses: xresloader/upload-to-github-release@v1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue