Skip to content
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
cbb5e93
CHORE: Make ADO pipelines public
bewithgaurav Aug 19, 2025
7d2d95e
added resources
bewithgaurav Aug 19, 2025
53db1c5
changed endpoint
bewithgaurav Aug 20, 2025
8751def
disabled self checkout
bewithgaurav Aug 20, 2025
9f31642
disabled none checkout
bewithgaurav Aug 20, 2025
87762cf
commented out explicit service connection mapping
bewithgaurav Aug 20, 2025
9fdf70f
commented out explicit service connection mapping
bewithgaurav Aug 20, 2025
c1e48e4
restored ADO SSO connection
bewithgaurav Aug 20, 2025
46a92b5
checking reasons and where builds are coming from
bewithgaurav Aug 20, 2025
e7bf48c
recreated pipeline, cleanup done
bewithgaurav Aug 20, 2025
9217d1e
readded resources
bewithgaurav Aug 20, 2025
6b9cbf0
cleanup of resources
bewithgaurav Aug 20, 2025
f1e6a22
triggering
bewithgaurav Aug 21, 2025
53e253e
triggering
bewithgaurav Aug 22, 2025
055a490
triggers changed
bewithgaurav Aug 22, 2025
db109f7
removed echo statements
bewithgaurav Aug 22, 2025
b5a5158
waiting for sql server to start
bewithgaurav Aug 22, 2025
a7ba415
waiting for sql server to start
bewithgaurav Aug 22, 2025
4411656
test pass issues
bewithgaurav Aug 22, 2025
021c089
test pass issues
bewithgaurav Aug 22, 2025
6303c69
test pass issues
bewithgaurav Aug 22, 2025
0cc50c2
test pass issues
bewithgaurav Aug 22, 2025
df96f10
test pass issues
bewithgaurav Aug 22, 2025
3748241
increase timeout for sql server
bewithgaurav Aug 25, 2025
eb3c5c1
add a test step
bewithgaurav Aug 25, 2025
c237584
add a retry auth step
bewithgaurav Aug 25, 2025
8a566f8
pull latest sql server and add extended retry for auth
bewithgaurav Aug 25, 2025
6dcad7d
switch to sql server 2019
bewithgaurav Aug 25, 2025
e0876fe
forcefully redirect localhost
bewithgaurav Aug 28, 2025
51b44e6
cleanup and ready for review
bewithgaurav Aug 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 70 additions & 6 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
trigger:
- master
- dev
- 1ES

pr:
branches:
Expand All @@ -16,9 +14,6 @@ schedules:
- dev
always: true

variables:
- group: DjangoTestApp

jobs:
- job: Windows
pool:
Expand Down Expand Up @@ -149,7 +144,7 @@ jobs:
displayName: Restart SQL Server

- powershell: |
(Get-Content -ReadCount 0 testapp\settings.py) -replace 'MyPassword42', '$(TestAppPassWord)' | Set-Content testapp\settings.py
(Get-Content -ReadCount 0 testapp\settings.py) -replace 'MyPassword42', '$(TestAppPassword)' | Set-Content testapp\settings.py
displayName: Change PASSWORD in settings.py

- powershell: |
Expand Down Expand Up @@ -266,6 +261,33 @@ jobs:
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=$(TestAppPassword)' -p 1433:1433 -d mcr.microsoft.com/mssql/server:2022-latest
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/ubuntu/22.04/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list

# Wait for SQL Server to be ready with increased timeout
echo "Waiting for SQL Server to start..."

# Extended wait for the container to be running and SQL Server service to be listening
for i in {1..60}; do
if docker logs $(docker ps -q --filter ancestor=mcr.microsoft.com/mssql/server:2022-latest) 2>&1 | grep -q "SQL Server is now ready for client connections"; then
echo "SQL Server service is ready after $i attempts ($(($i * 3)) seconds)"
break
fi
echo "Attempt $i: Waiting for SQL Server service to be ready, checking again in 3 seconds..."
sleep 3
done

# Increased wait to ensure full initialization for database operations
echo "Waiting additional 60 seconds for full SQL Server initialization..."
sleep 60

# Verify we can connect using a simple network test first
echo "Testing SQL Server connectivity..."
if ! timeout 30 bash -c 'until echo > /dev/tcp/localhost/1433; do sleep 1; done'; then
echo "Cannot connect to SQL Server on port 1433"
docker logs $(docker ps -q --filter ancestor=mcr.microsoft.com/mssql/server:2022-latest)
exit 1
fi

echo "SQL Server is ready and accepting connections"
displayName: Install SQL Server

- script: |
Expand Down Expand Up @@ -303,6 +325,41 @@ jobs:
fi
displayName: Install ODBC Driver

- script: |
# Install mssql-tools to get sqlcmd
sudo ACCEPT_EULA=Y apt-get install -y mssql-tools

# Wait for SQL Server authentication to be ready (retry loop)
echo "Waiting for SQL Server authentication to be ready..."
export PATH="$PATH:/opt/mssql-tools/bin"

# Retry authentication until SQL Server finishes its internal upgrade process
for i in {1..30}; do
echo "Authentication attempt $i of 30..."
# Force IPv4 TCP to avoid potential localhost/IPv6 resolution issues on agents
if sqlcmd -S "tcp:127.0.0.1,1433" -U sa -P "$(TestAppPassword)" -Q "SELECT 1 AS test" -l 10 >/dev/null 2>&1; then
echo "✅ SQL Server authentication successful after $i attempts!"
break
else
if [ $i -eq 30 ]; then
echo "❌ SQL Server authentication FAILED after 30 attempts!"
echo "Final attempt with verbose output:"
sqlcmd -S "tcp:127.0.0.1,1433" -U sa -P "$(TestAppPassword)" -Q "SELECT 1 AS test" -l 10
echo ""
echo "Container logs:"
docker logs $(docker ps -q --filter ancestor=mcr.microsoft.com/mssql/server:2022-latest)
exit 1
else
echo "Authentication failed (attempt $i), waiting 10 seconds before retry..."
echo "This is normal - SQL Server may still be upgrading internal databases..."
sleep 10
fi
fi
done

echo "SQL Server is fully ready for authentication!"
displayName: Wait for SQL Server Authentication

- script: |
# Since pylibmc isn't supported for Python 3.12+
# We need to install libmemcached-dev to build it - dependency for Django test suite
Expand All @@ -323,6 +380,13 @@ jobs:
sed -i 's/MyPassword42/$(TestAppPassword)/g' testapp/settings.py
displayName: Change PASSWORD in settings.py

- script: |
# Force Django DB host to IPv4 loopback to avoid IPv6 localhost resolution issues
sed -i "s|\"HOST\": \"localhost\"|\"HOST\": \"127.0.0.1\"|g" testapp/settings.py
echo "Updated DB HOST to 127.0.0.1"
grep -n "\"HOST\"" -n testapp/settings.py
displayName: Use IPv4 loopback for DB host

- script: tox -e $(tox.env)
displayName: Run tox

Expand Down
Loading