File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments