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

[WIP] use cosmos db emulator #941

Closed
wants to merge 10 commits into from
25 changes: 10 additions & 15 deletions azure-pipelines.yml
Expand Up @@ -34,26 +34,21 @@ steps:
displayName: 'start minio'

- powershell: |
$downloadURL = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.4-signed.msi"
Write-Host "download mongo from $downloadURL - start"
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri $downloadURL -OutFile "mongo.msi"
Write-Host "download mongo - end"
Write-Host "install mongo - start"
Start-Process msiexec -Wait -ArgumentList @('/i', 'mongo.msi', '/quiet', '/qn', 'INSTALLLOCATION=C:\mongodb', 'ADDLOCAL=all')
$env:PATH = 'C:\mongodb\bin;' + $env:PATH
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine)
mkdir C:\data\db | out-null
mkdir C:\data\configdb | out-null
Write-Host "install mongo - end"
Start-Process -NoNewWindow mongod.exe '--bind_ip_all --dbpath="C:\data\db"'
displayName: 'install & start mongo'
$emulatorBin = "C:\Program Files\Azure Cosmos DB Emulator\CosmosDB.Emulator.exe"
if (!(Test-Path $emulatorBin)) {
Write-Error "$emulatorBin not found"
}
else {
Start-Process -NoNewWindow -FilePath $emulatorBin '/NoUI /NoExplorer'
}
displayName: 'start cosmos db emulator'

- powershell: |
go test -mod=vendor -race ./...
env:
ATHENS_MINIO_ENDPOINT: "127.0.0.1:9001"
ATHENS_MONGO_STORAGE_URL: "127.0.0.1:27017"
ATHENS_MONGO_INSECURE: "true"
ATHENS_MONGO_STORAGE_URL: "mongodb://localhost:C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==@localhost:10255/admin?ssl=true"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a thought in mind. If we are using an emulator, we might want to check if the indices when the tests start, they should not have any documents or modules in it, so that our integration tests do not give a false success.

workingDirectory: '$(modulePath)'
displayName: 'run tests'