@@ -134,16 +134,16 @@ jobs:
134134
135135 # TODO: Reactivate and use pytests in build
136136 # Run pytests before packaging
137- # - powershell: |
138- # Write-Host "Running pytests to validate bindings"
139- # if ("$(targetArch)" -eq "arm64") {
140- # Write-Host "Skipping pytests on Windows ARM64"
141- # } else {
142- # python -m pytest -v
143- # }
144- # displayName: 'Run pytests'
145- # env:
146- # DB_CONNECTION_STRING: 'Server=(localdb)\MSSQLLocalDB;Database=TestDB;Uid=testuser;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
137+ - powershell : |
138+ Write-Host "Running pytests to validate bindings"
139+ if ("$(targetArch)" -eq "arm64") {
140+ Write-Host "Skipping pytests on Windows ARM64"
141+ } else {
142+ python -m pytest -v
143+ }
144+ displayName: 'Run pytests'
145+ env:
146+ DB_CONNECTION_STRING: 'Server=(localdb)\MSSQLLocalDB;Database=TestDB;Uid=testuser;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
147147
148148 # Copy the built .pyd file to staging folder for artifacts
149149 - task : CopyFiles@2
@@ -321,11 +321,11 @@ jobs:
321321
322322 # TODO: Reactivate and use pytests in build
323323 # Run Pytest to ensure the bindings work correctly
324- # - script: |
325- # python -m pytest -v
326- # displayName: 'Run Pytest to validate bindings'
327- # env:
328- # DB_CONNECTION_STRING: 'Driver=ODBC Driver 18 for SQL Server;Server=localhost;Database=master;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
324+ - script : |
325+ python -m pytest -v
326+ displayName: 'Run Pytest to validate bindings'
327+ env:
328+ DB_CONNECTION_STRING: 'Driver=ODBC Driver 18 for SQL Server;Server=localhost;Database=master;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes'
329329
330330 # Build wheel package for universal2
331331 - script : |
@@ -541,24 +541,24 @@ jobs:
541541 continueOnError: false
542542
543543 # TODO: Reactivate and use pytests in build
544- # # Run tests to validate the build
545- # - script: |
546- # # Get SQL Server container IP
547- # SQLSERVER_IP=$(docker inspect sqlserver-$(targetArch) --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}')
548- # echo "SQL Server IP: $SQLSERVER_IP"
549- #
550- # docker exec \
551- # -e DB_CONNECTION_STRING="Driver=ODBC Driver 18 for SQL Server;Server=$SQLSERVER_IP;Database=TestDB;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes" \
552- # -e DB_PASSWORD="$(DB_PASSWORD)" \
553- # build-container-$(targetArch) bash -c "
554- # echo 'Running tests on manylinux2014 $(targetArch)'
555- # echo 'Architecture:' \$(uname -m)
556- # echo 'Python version:' \$(python --version)
557- # python -m pytest -v
558- # "
559- # displayName: 'Run tests in manylinux2014 $(targetArch) container'
560- # env:
561- # DB_PASSWORD: $(DB_PASSWORD)
544+ # Run tests to validate the build
545+ - script : |
546+ # Get SQL Server container IP
547+ SQLSERVER_IP=$(docker inspect sqlserver-$(targetArch) --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}')
548+ echo "SQL Server IP: $SQLSERVER_IP"
549+
550+ docker exec \
551+ -e DB_CONNECTION_STRING="Driver=ODBC Driver 18 for SQL Server;Server=$SQLSERVER_IP;Database=TestDB;Uid=SA;Pwd=$(DB_PASSWORD);TrustServerCertificate=yes" \
552+ -e DB_PASSWORD="$(DB_PASSWORD)" \
553+ build-container-$(targetArch) bash -c "
554+ echo 'Running tests on manylinux2014 $(targetArch)'
555+ echo 'Architecture:' \$(uname -m)
556+ echo 'Python version:' \$(python --version)
557+ python -m pytest -v
558+ "
559+ displayName: 'Run tests in manylinux2014 $(targetArch) container'
560+ env:
561+ DB_PASSWORD: $(DB_PASSWORD)
562562
563563 # Build manylinux wheel
564564 - script : |
0 commit comments