From d6d5591148a0d68ba54994924a2f4f7e4458cbd9 Mon Sep 17 00:00:00 2001 From: Matt Cooley Date: Mon, 16 Sep 2019 06:43:53 -0700 Subject: [PATCH] Move unit test runs to hosted pools (#671) We can now run our unit tests in the Hosted VS2019 pool since bugs have been fixed in the version of Visual Studio deployed on those agents. --- build/pipelines/azure-pipelines.ci.yaml | 6 ---- build/pipelines/azure-pipelines.release.yaml | 6 ---- build/pipelines/templates/run-unit-tests.yaml | 34 +++---------------- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/build/pipelines/azure-pipelines.ci.yaml b/build/pipelines/azure-pipelines.ci.yaml index d980165..dbac958 100644 --- a/build/pipelines/azure-pipelines.ci.yaml +++ b/build/pipelines/azure-pipelines.ci.yaml @@ -41,15 +41,9 @@ jobs: - template: ./templates/run-unit-tests.yaml parameters: platform: x64 - reimageServiceConnection: essential-experiences-interactive-reimage - reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5 - reimageResourceGroup: EETestPublic - template: ./templates/run-unit-tests.yaml parameters: platform: x86 - reimageServiceConnection: essential-experiences-interactive-reimage - reimageSubscriptionId: a8f5eb47-e59c-44b4-8e42-e70811a047b5 - reimageResourceGroup: EETestPublic - template: ./templates/package-appxbundle.yaml diff --git a/build/pipelines/azure-pipelines.release.yaml b/build/pipelines/azure-pipelines.release.yaml index 8c287a4..35a301b 100644 --- a/build/pipelines/azure-pipelines.release.yaml +++ b/build/pipelines/azure-pipelines.release.yaml @@ -48,16 +48,10 @@ jobs: - template: ./templates/run-unit-tests.yaml parameters: platform: x64 - reimageServiceConnection: macool-sandbox-interactiveDesktopRS5 - reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d - reimageResourceGroup: interactiveDesktopRS5 - template: ./templates/run-unit-tests.yaml parameters: platform: x86 - reimageServiceConnection: macool-sandbox-interactiveDesktopRS5 - reimageSubscriptionId: 012a8008-c00f-45b3-9828-41ebba30141d - reimageResourceGroup: interactiveDesktopRS5 - template: ./templates/package-appxbundle.yaml diff --git a/build/pipelines/templates/run-unit-tests.yaml b/build/pipelines/templates/run-unit-tests.yaml index 2a00011..56f6096 100644 --- a/build/pipelines/templates/run-unit-tests.yaml +++ b/build/pipelines/templates/run-unit-tests.yaml @@ -1,29 +1,20 @@ -# This template contains jobs to run unit tests on the interactive test agents. +# This template contains jobs to run unit tests. parameters: platform: '' - reimageServiceConnection: '' - reimageSubscriptionId: '' - reimageResourceGroup: '' + runsettingsFileName: '' jobs: - job: UnitTests${{ parameters.platform }} displayName: UnitTests ${{ parameters.platform }} dependsOn: Build${{ parameters.platform }} + condition: succeeded() pool: - name: Essential Experiences Interactive - workspace: - clean: outputs + vmImage: windows-2019 variables: skipComponentGovernanceDetection: true steps: - checkout: none - - - powershell: Write-Host "##vso[task.setvariable variable=agentInstanceId;isOutput=true]$($env:AgentName -replace '\D+' -as [int])" - name: LogAgentStep - displayName: Log this agent's instance for later cleanup - env: - AgentName: $(Agent.Name) - task: DownloadBuildArtifacts@0 displayName: Download CalculatorUnitTests @@ -41,19 +32,4 @@ jobs: displayName: Run CalculatorUnitTests inputs: testAssemblyVer2: $(Build.ArtifactStagingDirectory)\drop\Release\${{ parameters.platform }}\CalculatorUnitTests\AppPackages\CalculatorUnitTests_Test\CalculatorUnitTests.appx - otherConsoleOptions: /Platform:${{ parameters.platform }} - -- job: CleanUpUnitTests${{ parameters.platform }} - dependsOn: UnitTests${{ parameters.platform }} - condition: and(always(), ne(dependencies.UnitTests${{ parameters.platform }}.Outputs['LogAgentStep.agentInstanceId'], '')) - pool: server - variables: - agentInstanceId: $[ dependencies.UnitTests${{ parameters.platform }}.outputs['LogAgentStep.agentInstanceId'] ] - steps: - - task: InvokeRESTAPI@1 - displayName: Reimage test machine - inputs: - connectionType: connectedServiceNameARM - azureServiceConnection: ${{ parameters.reimageServiceConnection }} - urlSuffix: subscriptions/${{ parameters.reimageSubscriptionId }}/resourceGroups/${{ parameters.reimageResourceGroup }}/providers/Microsoft.Compute/virtualMachineScaleSets/essential/reimage?api-version=2018-10-01 - body: '{ "instanceIds": ["$(agentInstanceId)"] }' \ No newline at end of file + otherConsoleOptions: /Platform:${{ parameters.platform }} \ No newline at end of file