2020-06-30 18:25:45 +03:00
|
|
|
|
if(!(Test-Path -Path .\Microsoft.Azure.Cosmos)){
|
|
|
|
|
Write-Error "Please run script from root of the enlistment"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#Run the Cosmos DB SDK GA contract tests
|
2022-01-19 22:29:59 +03:00
|
|
|
|
dotnet test '.\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Microsoft.Azure.Cosmos.Tests.csproj' --filter "TestCategory=UpdateContract" --configuration Release
|
2020-06-30 18:25:45 +03:00
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFile = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Release\net6.0\Contracts\DotNetSDKAPIChanges.json"
|
2020-06-30 18:25:45 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFile)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFile -Destination ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Contracts\DotNetSDKAPI.json"
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFile)
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFolder = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Release\net6.0\BaselineTest\TestOutput\*"
|
2020-06-30 18:25:45 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFolder)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFolder -Destination ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\BaselineTest\TestBaseline" -Recurse
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFolder)
|
|
|
|
|
}
|
|
|
|
|
|
2021-05-28 23:09:23 +03:00
|
|
|
|
#Run the Cosmos DB SDK Emulator contract tests
|
2022-01-19 22:29:59 +03:00
|
|
|
|
dotnet test '.\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\Microsoft.Azure.Cosmos.EmulatorTests.csproj' --filter "TestCategory=UpdateContract" --configuration Release
|
2021-05-28 23:09:23 +03:00
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFolder = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\bin\Release\net6.0\BaselineTest\TestOutput\*"
|
2021-05-28 23:09:23 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFolder)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFolder -Destination ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.EmulatorTests\BaselineTest\TestBaseline" -Recurse
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFolder)
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-30 18:25:45 +03:00
|
|
|
|
#Run the Cosmos DB SDK Preview contract tests
|
2022-01-19 22:29:59 +03:00
|
|
|
|
dotnet test '.\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Microsoft.Azure.Cosmos.Tests.csproj' --filter "TestCategory=UpdateContract" --configuration Release -p:IsPreview=true
|
2020-06-30 18:25:45 +03:00
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFile = ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\bin\Release\net6.0\Contracts\DotNetPreviewSDKAPIChanges.json"
|
2020-06-30 18:25:45 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFile)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the preview build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFile -Destination ".\Microsoft.Azure.Cosmos\tests\Microsoft.Azure.Cosmos.Tests\Contracts\DotNetPreviewSDKAPI.json"
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFile)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#Run the Encryption SDK contract tests
|
2022-01-19 22:29:59 +03:00
|
|
|
|
dotnet test '.\Microsoft.Azure.Cosmos.Encryption\tests\Microsoft.Azure.Cosmos.Encryption.Tests\Microsoft.Azure.Cosmos.Encryption.Tests.csproj' --filter "TestCategory=UpdateContract" --configuration Release
|
2020-06-30 18:25:45 +03:00
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFile = ".\Microsoft.Azure.Cosmos.Encryption\tests\Microsoft.Azure.Cosmos.Encryption.Tests\bin\Release\net6.0\Contracts\DotNetSDKEncryptionAPIChanges.json"
|
2020-06-30 18:25:45 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFile)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFile -Destination ".\Microsoft.Azure.Cosmos.Encryption\tests\Microsoft.Azure.Cosmos.Encryption.Tests\Contracts\DotNetSDKEncryptionAPI.json"
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFile)
|
|
|
|
|
}
|
2021-09-16 15:18:15 +03:00
|
|
|
|
|
|
|
|
|
#Run the Encryption.Custom SDK contract tests
|
2022-01-19 22:29:59 +03:00
|
|
|
|
dotnet test '.\Microsoft.Azure.Cosmos.Encryption.Custom\tests\Microsoft.Azure.Cosmos.Encryption.Custom.Tests\Microsoft.Azure.Cosmos.Encryption.Custom.Tests.csproj' --filter "TestCategory=UpdateContract" --configuration Release
|
2021-09-16 15:18:15 +03:00
|
|
|
|
|
2022-01-19 22:29:59 +03:00
|
|
|
|
$updatedContractFile = ".\Microsoft.Azure.Cosmos.Encryption.Custom\tests\Microsoft.Azure.Cosmos.Encryption.Custom.Tests\bin\Release\net6.0\Contracts\DotNetSDKEncryptionCustomAPIChanges.json"
|
2021-09-16 15:18:15 +03:00
|
|
|
|
if(!(Test-Path -Path $updatedContractFile)){
|
|
|
|
|
Write-Error ("The contract file did not get updated with the build. Please fix the test to output the contract file: " + $updatedContractFile)
|
|
|
|
|
}else{
|
|
|
|
|
Copy-Item -Path $updatedContractFile -Destination ".\Microsoft.Azure.Cosmos.Encryption.Custom\tests\Microsoft.Azure.Cosmos.Encryption.Custom.Tests\Contracts\DotNetSDKEncryptionCustomAPI.json"
|
|
|
|
|
Write-Output ("Updated contract " + $updatedContractFile)
|
|
|
|
|
}
|