Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MSSQL smoke test #2792

Merged
merged 21 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
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
4 changes: 1 addition & 3 deletions .github/workflows/smoketest-mssql-inproc-v4.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@ jobs:
build:

runs-on: ubuntu-latest
env:
SA_PASSWORD: NotASecret!12
cgillum marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v4

- name: Run V4 .NET in-proc w/ MSSQL Smoke Test
run: test/SmokeTests/e2e-test.ps1 -DockerfilePath test/SmokeTests/BackendSmokeTests/MSSQL/Dockerfile -HttpStartPath api/DurableFunctionsHttpStart -ContainerName MSSQLApp -SetupSQLServer
shell: pwsh
shell: pwsh
20 changes: 20 additions & 0 deletions test/SmokeTests/BackendSmokeTests/generate-random-string.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Define the length of the random string
$length = 13

# Define the ASCII ranges for different character types
$uppercase_range = 65..90 # A-Z
$lowercase_range = 97..122 # a-z
$number_range = 48..57 # 0-9

# Define ASCII ranges for special characters:
# ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
$special_chars = 33..47 + 58..64 + 91..96 + 123..126 # Special characters

# Combine all the ranges
$all_chars = $uppercase_range + $lowercase_range + $number_range + $special_chars

# Generate a random string
$newString = -join ($all_chars | Get-Random -Count $length | ForEach-Object {[char]$_})

# Return the new string
return $newString
2 changes: 1 addition & 1 deletion test/SmokeTests/e2e-test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ param(
[switch]$NoValidation=$false,
[int]$Sleep=30,
[switch]$SetupSQLServer=$false,
[string]$pw="$env:SA_PASSWORD",
[string]$sqlpid="Express",
[string]$tag="2019-latest",
[int]$port=1433,
Expand Down Expand Up @@ -50,6 +49,7 @@ if ($NoSetup -eq $false) {

# Start the SQL Server docker container with the specified edition
Write-Host "Starting SQL Server $tag $sqlpid docker container on port $port" -ForegroundColor DarkYellow
$pw = & "test/SmokeTests/BackendSmokeTests/generate-random-string.ps1"
docker run --name mssql-server -e 'ACCEPT_EULA=Y' -e "MSSQL_SA_PASSWORD=$pw" -e "MSSQL_PID=$sqlpid" -p ${port}:1433 -d mcr.microsoft.com/mssql/server:$tag
Exit-OnError

Expand Down
Loading