Skip to content

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

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

TEST: MacOS #80

wants to merge 16 commits into from

Conversation

bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Jun 17, 2025

DRAFT PR: Not for Review

@Copilot Copilot AI review requested due to automatic review settings June 17, 2025 12:32
Copy link
Contributor

@Copilot Copilot AI left a 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.

Comment on lines 105 to 107
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
Copy link
Preview

Copilot AI Jun 17, 2025

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.

Suggested change
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 bewithgaurav changed the title FEAT: MacOS Tests TEST: MacOS Pipelines Jun 17, 2025
@bewithgaurav bewithgaurav changed the title TEST: MacOS Pipelines TEST: MacOS Jun 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant