-
Notifications
You must be signed in to change notification settings - Fork 7
TEST: MacOS #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
TEST: MacOS #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds macOS-specific functionality for handling MSSQL cursor fetch operations and introduces a new pipeline job to run Python tests on macOS.
- Modified fetchone() in mssql_python/cursor_mac.py to handle SQL_NO_DATA.
- Added a new 'PytestOnMacOS' job in eng/pipelines/pr-validation-pipeline.yml to enable testing on macOS.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
mssql_python/cursor_mac.py | Added a branch in fetchone() to return None for SQL_NO_DATA conditions. |
eng/pipelines/pr-validation-pipeline.yml | Introduced a new macOS pipeline job to install dependencies, start Dockerized SQL Server, build bindings, and run pytest. |
for i in {1..30}; do | ||
docker exec sql2022 /opt/mssql-tools/bin/sqlcmd -U SA -P $(DB_PASSWORD) -Q "SELECT 1" && break | ||
sleep 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fixed 30-iteration loop for SQL Server startup may not be sufficient in slower environments. Consider making the wait time or iteration count configurable or implement a dynamic check for server readiness.
for i in {1..30}; do | |
docker exec sql2022 /opt/mssql-tools/bin/sqlcmd -U SA -P $(DB_PASSWORD) -Q "SELECT 1" && break | |
sleep 2 | |
MAX_WAIT_TIME=60 # Maximum wait time in seconds | |
POLL_INTERVAL=2 # Polling interval in seconds | |
ELAPSED_TIME=0 | |
until docker exec sql2022 /opt/mssql-tools/bin/sqlcmd -U SA -P $(DB_PASSWORD) -Q "SELECT 1"; do | |
if [ $ELAPSED_TIME -ge $MAX_WAIT_TIME ]; then | |
echo "SQL Server did not become ready within $MAX_WAIT_TIME seconds." | |
exit 1 | |
fi | |
sleep $POLL_INTERVAL | |
ELAPSED_TIME=$((ELAPSED_TIME + POLL_INTERVAL)) |
Copilot uses AI. Check for mistakes.
… bewithgaurav/mac_pipeline
DRAFT PR: Not for Review