-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathazure-pipelines-emulator.yml
More file actions
45 lines (43 loc) · 1.84 KB
/
Copy pathazure-pipelines-emulator.yml
File metadata and controls
45 lines (43 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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'