Skip to content

Commit 6303c69

Browse files
committed
test pass issues
1 parent 021c089 commit 6303c69

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

azure-pipelines.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,41 @@ jobs:
357357
grep -A 10 -B 2 "PASSWORD" testapp/settings.py
358358
displayName: Verify PASSWORD replacement
359359
360+
- script: |
361+
echo "=== Debugging SQL Server Connection ==="
362+
echo "Container status:"
363+
docker ps
364+
echo ""
365+
echo "Container logs (last 20 lines):"
366+
docker logs $(docker ps -q --filter ancestor=mcr.microsoft.com/mssql/server:2022-latest) | tail -20
367+
echo ""
368+
echo "Testing network connectivity to SQL Server:"
369+
timeout 10 bash -c 'echo > /dev/tcp/localhost/1433' && echo "Port 1433 is accessible" || echo "Port 1433 is not accessible"
370+
echo ""
371+
echo "ODBC drivers available:"
372+
odbcinst -q -d
373+
echo ""
374+
echo "Testing basic pyodbc connection (before Django):"
375+
python -c "
376+
import pyodbc
377+
import os
378+
password = os.environ.get('TestAppPassword', 'Unknown')
379+
print(f'Using password length: {len(password)}')
380+
try:
381+
conn_str = 'DRIVER={ODBC Driver 17 for SQL Server};SERVER=localhost;UID=sa;PWD=' + password
382+
conn = pyodbc.connect(conn_str, timeout=10)
383+
cursor = conn.cursor()
384+
cursor.execute('SELECT 1')
385+
result = cursor.fetchone()
386+
print(f'Direct pyodbc connection successful: {result}')
387+
conn.close()
388+
except Exception as e:
389+
print(f'Direct pyodbc connection failed: {e}')
390+
"
391+
env:
392+
TestAppPassword: $(TestAppPassword)
393+
displayName: Debug SQL Server connectivity
394+
360395
- script: tox -e $(tox.env)
361396
displayName: Run tox
362397

0 commit comments

Comments
 (0)