-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI/CD Adding automatic pipeline tests (#153)
* Support for pipelines endpoint * pipelines * Adding assert * Adding lock * Refactor initialization * Cleanup * yaml update * Using async initialize * Cleanup * throwing if retries consumed * Removing TestClassData * Renames
- Loading branch information
Showing
9 changed files
with
185 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
trigger: none | ||
pr: | ||
branches: | ||
include: | ||
- master | ||
- releases/* | ||
|
||
pool: | ||
vmImage: 'windows-latest' | ||
|
||
steps: | ||
- pwsh: | | ||
Write-Host "Downloading Cosmos Emulator - $env:EMULATORMSIURL" -ForegroundColor green | ||
Invoke-WebRequest "$env:EMULATORMSIURL" -OutFile "$env:temp\azure-cosmosdb-emulator.msi" | ||
Write-Host "Finished Downloading Cosmos Emulator - $env:temp\azure-cosmosdb-emulator.msi" -ForegroundColor green | ||
dir "$env:temp" | ||
choco install lessmsi | ||
choco upgrade lessmsi | ||
mkdir "$env:temp\Azure Cosmos DB Emulator" | ||
lessmsi x "$env:temp\azure-cosmosdb-emulator.msi" "$env:temp\Azure Cosmos DB Emulator\" | ||
Write-Host "Starting Cosmos DB Emulator" -ForegroundColor green | ||
Start-Process "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe" "/NoExplorer /NoUI /DisableRateLimiting /PartitionCount=100 /Consistency=Strong /enableRio /overrides=sqlAllowGroupByClause:true" -Verb RunAs | ||
Import-Module "$env:temp\Azure Cosmos DB Emulator\SourceDir\Azure Cosmos DB Emulator\PSModules\Microsoft.Azure.CosmosDB.Emulator" | ||
Get-Item env:* | Sort-Object -Property Name | ||
for ($i=0; $i -lt 10; $i++) { | ||
$status=Get-CosmosDbEmulatorStatus | ||
if ($status -ne "Running") { | ||
sleep 30; | ||
Write-Host "Cosmos DB Emulator Status: $status" -ForegroundColor yellow | ||
} else { | ||
break; | ||
} | ||
} | ||
- task: DotNetCoreCLI@2 | ||
displayName: Build | ||
inputs: | ||
command: build | ||
projects: '**/*.csproj' | ||
- script: dotnet test ./src/DocumentDB.ChangeFeedProcessor.IntegrationTests/DocumentDB.ChangeFeedProcessor.IntegrationTests.csproj --logger trx | ||
displayName: 'Running tests' | ||
- task: PublishTestResults@2 | ||
condition: succeededOrFailed() | ||
inputs: | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
trigger: none | ||
pr: | ||
branches: | ||
include: | ||
- master | ||
- releases/* | ||
|
||
strategy: | ||
matrix: | ||
windows: | ||
imageName: 'windows-latest' | ||
|
||
pool: | ||
vmImage: $(imageName) | ||
|
||
steps: | ||
- task: DotNetCoreCLI@2 | ||
displayName: Build | ||
inputs: | ||
command: build | ||
projects: '**/*.csproj' | ||
arguments: '--configuration Release' | ||
- script: dotnet test ./src/DocumentDB.ChangeFeedProcessor.UnitTests/DocumentDB.ChangeFeedProcessor.UnitTests.csproj --logger trx | ||
displayName: 'Running tests' | ||
- task: PublishTestResults@2 | ||
condition: succeededOrFailed() | ||
inputs: | ||
testRunner: VSTest | ||
testResultsFiles: '**/*.trx' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.