-
-
Notifications
You must be signed in to change notification settings - Fork 73
Expand file tree
/
Copy pathazure-pipelines.yml
More file actions
71 lines (59 loc) · 1.72 KB
/
azure-pipelines.yml
File metadata and controls
71 lines (59 loc) · 1.72 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
trigger:
tags:
include:
- "v*"
branches:
exclude:
- "*"
pool:
vmImage: "ubuntu-latest"
variables:
buildConfiguration: "Release"
steps:
- script: |
set -e
mkdir -p Tests
openssl rand -base64 756 > Tests/.mongo-keyfile
sudo chown 999:999 Tests/.mongo-keyfile
sudo chmod 600 Tests/.mongo-keyfile
docker compose -f docker-compose.ci.yml up -d
for i in $(seq 1 60); do
if docker compose -f docker-compose.ci.yml exec -T mongodb mongosh \
-u admin \
-p password \
--authenticationDatabase admin \
--quiet \
--eval "db.runCommand({ ping: 1 }).ok" >/dev/null 2>&1; then
break
fi
sleep 1
done
docker compose -f docker-compose.ci.yml exec -T mongodb mongosh \
-u admin \
-p password \
--authenticationDatabase admin \
--quiet \
--eval "while (!db.hello().isWritablePrimary) { sleep(1000); }"
displayName: "Start MongoDB Test Services"
- script: docker compose -f docker-compose.ci.yml ps
displayName: "Show Service Status"
- script: docker compose -f docker-compose.ci.yml logs --no-color
displayName: "Service Logs"
condition: failed()
- task: UseDotNet@2
displayName: "Use .Net SDK"
inputs:
packageType: "sdk"
version: "10.x"
- task: DotNetCoreCLI@2
displayName: "Run Tests"
inputs:
command: "test"
projects: "**/*[Tt]ests/*.csproj"
arguments: "--configuration $(buildConfiguration)"
workingDirectory: "Tests"
- script: |
docker compose -f docker-compose.ci.yml down -v
sudo rm -f Tests/.mongo-keyfile
displayName: "Stop Test Services"
condition: always()