Skip to content

Commit f4cca91

Browse files
committed
Merge branch 'bewithgaurav/perf-check-CI' into saumya/pref-setup
2 parents fbbf9d7 + 29c8b9d commit f4cca91

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

benchmarks/perf-benchmarking.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828

2929
# Configuration
3030
CONN_STR = os.getenv("DB_CONNECTION_STRING")
31+
32+
# Ensure pyodbc connection string has ODBC driver specified
33+
if CONN_STR and 'Driver=' not in CONN_STR:
34+
CONN_STR = f"Driver={{ODBC Driver 18 for SQL Server}};{CONN_STR}"
35+
3136
NUM_ITERATIONS = 5 # Number of times to run each test for averaging
3237

3338
# SQL Queries
@@ -284,11 +289,11 @@ def main():
284289
print(f"\nRunning: {name}")
285290
print(f" Testing with pyodbc... ", end="", flush=True)
286291
pyodbc_result = run_benchmark_pyodbc(query, name, NUM_ITERATIONS)
287-
print(f" (avg: {pyodbc_result.avg_time:.4f}s)")
292+
print(f"OK (avg: {pyodbc_result.avg_time:.4f}s)")
288293

289294
print(f" Testing with mssql-python... ", end="", flush=True)
290295
mssql_python_result = run_benchmark_mssql_python(query, name, NUM_ITERATIONS)
291-
print(f" (avg: {mssql_python_result.avg_time:.4f}s)")
296+
print(f"OK (avg: {mssql_python_result.avg_time:.4f}s)")
292297

293298
all_results.append((pyodbc_result, mssql_python_result))
294299

eng/pipelines/pr-validation-pipeline.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,6 +590,19 @@ jobs:
590590
-e DB_CONNECTION_STRING="Server=$SQLSERVER_IP;Database=AdventureWorks2022;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes" \
591591
test-container-$(distroName) bash -c "
592592
source /opt/venv/bin/activate
593+
594+
echo 'Reinstalling ODBC Driver for benchmarking...'
595+
export DEBIAN_FRONTEND=noninteractive
596+
597+
# Add Microsoft repository
598+
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
599+
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | tee /etc/apt/sources.list.d/mssql-release.list
600+
apt-get update
601+
602+
# Install ODBC Driver 18
603+
ACCEPT_EULA=Y apt-get install -y msodbcsql18
604+
apt-get install -y unixodbc-dev
605+
593606
echo 'Installing pyodbc for benchmarking...'
594607
pip install pyodbc
595608
echo 'Running performance benchmarks on $(distroName)'

0 commit comments

Comments
 (0)