Skip to content

Commit

Permalink
Split live testing YAML to allow separate live testing of services (A…
Browse files Browse the repository at this point in the history
…zure#5865)

* Update and add YAML to support live testing scenarios
  • Loading branch information
danieljurek authored and weshaggard committed Apr 18, 2019
1 parent b2d863b commit d1849bf
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 19 deletions.
20 changes: 1 addition & 19 deletions .azure-pipelines/client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@ jobs:
version: '$(DotNetCoreVersion)'

- task: DotNetCoreCLI@2
displayName: 'Build & Test (no live tests)'
condition: eq(variables['System.TeamProject'], 'public')
displayName: 'Build & Test'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
Expand All @@ -119,23 +118,6 @@ jobs:
arguments: --filter TestCategory!=Live --logger trx
publishTestResults: false

- task: DotNetCoreCLI@2
displayName: 'Build & Test (with live tests)'
condition: ne(variables['System.TeamProject'], 'public')
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
APP_CONFIG_CONNECTION: $(AppConfigConnectionString)
AZ_SERVICE_BUS_CONNECTION: $(ServiceBusConnectionString)
AZ_EVENT_HUBS_CONNECTION: $(EventHubsConnectionString)
AZ_EVENT_HUBS_STORAGE_CONNECTION: $(EventHubsStorageConnectionString)
inputs:
command: test
projects: '$(ProjectFile)'
arguments: --logger trx
publishTestResults: false

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
Expand Down
72 changes: 72 additions & 0 deletions .azure-pipelines/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# External variables:
# ProjectFile - The project to build and test. This variable is defined in pipeline web ui because we want to be able to provide it at queue time and that isn't supported in yaml yet.
# MaxParallelTestJobs - Maximum number of parallel test jobs
# AzConfigConnectionString - The connection string used for testing the AzConfig service. This is set in the pipeline web ui as it needs different values for public vs internal.
# ServiceBusConnectionString - The connection string used for testing the Service Bus service. This is set in the pipeline web ui as it needs different values for public vs internal.
# EventHubsConnectionString - The connection string to the namespace used for testing the Event Hubs service. This is set in the pipeline web ui and needs different values for public vs internal.
# EventHubsStorageConnectionString - The connection string to the storage account used for testing the Event Hubs service. This is set in the pipeline web ui and needs different values for public vs internal.

trigger:
- master

variables:
DotNetCoreVersion: '2.1.503'

jobs:
- job: 'Test'

strategy:
maxParallel: $[ variables['MaxParallelTestJobs'] ]
matrix:
Linux:
OSName: 'Linux'
OSVmImage: 'ubuntu-16.04'
Windows:
OSName: 'Windows'
OSVmImage: 'vs2017-win2016'
MacOs:
OSName: 'MacOS'
OSVmImage: 'macOS-10.13'

pool:
vmImage: '$(OSVmImage)'

steps:
- powershell: |
Invoke-WebRequest -Uri "https://github.com/Azure/azure-sdk-tools/releases/download/sdk-tools_14793/sdk-tools.zip" `
-OutFile "sdk-tools.zip" | Wait-Process; Expand-Archive -Path "sdk-tools.zip" -DestinationPath "./sdk-tools/"
workingDirectory: '$(Build.BinariesDirectory)'
displayName: 'Download Tools Archive From Github Release and Extract it'
- task: PythonScript@0
displayName: 'Run VerifyAgentOS script'
inputs:
scriptPath: '$(Build.BinariesDirectory)/sdk-tools/scripts/python/verify_agent_os.py'
arguments: $(OSName)

- task: DotNetCoreInstaller@0
displayName: 'Use .NET Core sdk $(DotNetCoreVersion)'
inputs:
version: '$(DotNetCoreVersion)'

- task: DotNetCoreCLI@2
displayName: 'Build & Test (all tests)'
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_MULTILEVEL_LOOKUP: 0
APP_CONFIG_CONNECTION: $(AppConfigConnectionString)
AZ_SERVICE_BUS_CONNECTION: $(ServiceBusConnectionString)
inputs:
command: test
projects: '$(ProjectFile)'
arguments: --logger trx
publishTestResults: false

- task: PublishTestResults@2
condition: succeededOrFailed()
inputs:
testResultsFiles: '**/*.trx'
testRunTitle: '$(OSName) DotNet $(DotNetCoreVersion)'
testResultsFormat: 'VSTest'
mergeTestResults: true

0 comments on commit d1849bf

Please sign in to comment.