Skip to content

Commit

Permalink
Update e2e-test.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
bachuv authored Dec 29, 2023
1 parent 15d5e2b commit df8c3fa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/SmokeTests/e2e-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ param(
[switch]$NoValidation=$false,
[int]$Sleep=30,
[string]$additinalRunFlags="",
[switch]$MSSQLTest=$false,
[switch]$SetupSQLServer=$false,
[string]$ImageName="dfapp",
[string]$ContainerName="app",
[string]$pw="$env:SA_PASSWORD",
Expand Down Expand Up @@ -46,9 +46,10 @@ if ($NoSetup -eq $false) {
# Wait for SQL Server to be ready
Write-Host "Waiting for SQL Server to be ready..." -ForegroundColor Yellow
Start-Sleep -Seconds 30 # Adjust the sleep duration based on your SQL Server container startup time


# Get SQL Server IP Address - used to create SQLDB_Connection
Write-Host "Getting IP Address..." -ForegroundColor Yellow
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mssql-server
$serverIpAddress = docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' mssql-server

# Create the database with strict binary collation
Write-Host "Creating '$dbname' database with '$collation' collation" -ForegroundColor DarkYellow
Expand All @@ -61,7 +62,7 @@ if ($NoSetup -eq $false) {
# Finally, start up the application container, connecting to the SQL Server container
Write-Host "Starting the $ContainerName application container" -ForegroundColor Yellow
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d `
--env "SQLDB_Connection=Server=mssql-server,1433;Database=$dbname;User=sa;Password=$pw;" `
--env "SQLDB_Connection=Server=$serverIpAddress,1433;Database=$dbname;User=sa;Password=$pw;" `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' `
--env 'WEBSITE_HOSTNAME=localhost:8080' `
$ImageName
Expand Down

0 comments on commit df8c3fa

Please sign in to comment.