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 2655a07 commit 308f35a
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions test/SmokeTests/e2e-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,22 @@ if ($NoSetup -eq $false) {
# Wait for database to be ready
Write-Host "Waiting for database to be ready..." -ForegroundColor Yellow
Start-Sleep -Seconds 30 # Adjust the sleep duration based on your database container startup time
}

# Finally, start up the smoke test container, which will connect to the Azurite container
Write-Host "Starting $ContainerName application container" -ForegroundColor Yellow
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' `
--env 'WEBSITE_HOSTNAME=localhost:8080' `
$ImageName

if ($MSSQLTest -eq $true) {
Write-Host "Adding SQLDB_Connection environment variable" -ForegroundColor Yellow
docker run -e "SQLDB_Connection=Server=172.17.0.3,1433;Database=$dbname;User=sa;Password=$pw;" $ImageName
# 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=172.17.0.3,1433;Database=$dbname;User=sa;Password=$pw;" `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' `
--env 'WEBSITE_HOSTNAME=localhost:8080' `
$ImageName
}
else {
Write-Host "Starting $ContainerName application container" -ForegroundColor Yellow
docker run --name $ContainerName -p 8080:80 -it --add-host=host.docker.internal:host-gateway -d `
--env 'AzureWebJobsStorage=UseDevelopmentStorage=true;DevelopmentStorageProxyUri=http://host.docker.internal' `
--env 'WEBSITE_HOSTNAME=localhost:8080' `
$ImageName
}
}

if ($sleep -gt 0) {
Expand Down

0 comments on commit 308f35a

Please sign in to comment.