Skip to content

Commit e64bf71

Browse files
authored
Only publish cpuprofile logs for integration tests. (#8028)
2 parents e2924a7 + 3bc238d commit e64bf71

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

azure-pipelines/test-matrix.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,24 @@ jobs:
1818
matrix:
1919
UnitTests:
2020
npmCommand: test:unit
21+
isIntegration: false
2122
CSharpIntegrationTests:
2223
npmCommand: test:integration:csharp
24+
isIntegration: true
2325
DevKitTests:
2426
npmCommand: test:integration:devkit
27+
isIntegration: true
2528
RazorTests:
2629
npmCommand: test:integration:razor
30+
isIntegration: true
2731
pool: ${{ parameters.pool }}
2832
${{ if parameters.containerName }}:
2933
container: ${{ parameters.containerName }}
3034
steps:
3135
- template: /azure-pipelines/test.yml@self
3236
parameters:
3337
dotnetVersion: ${{ parameters.dotnetVersion }}
34-
installAdditionalLinuxDependencies: true
38+
installAdditionalLinuxDependencies: ${{ parameters.installAdditionalLinuxDependencies }}
3539
npmCommand: $(npmCommand)
36-
testVSCodeVersion: ${{ parameters.testVSCodeVersion }}
40+
testVSCodeVersion: ${{ parameters.testVSCodeVersion }}
41+
isIntegration: $(isIntegration)

azure-pipelines/test.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ parameters:
88
type: string
99
- name: testVSCodeVersion
1010
type: string
11+
- name: isIntegration
12+
type: string
1113

1214
steps:
1315
- checkout: self
@@ -33,13 +35,6 @@ steps:
3335
DISPLAY: :99.0
3436
CODE_VERSION: ${{ parameters.testVSCodeVersion }}
3537

36-
- powershell: |
37-
$tempPath = [System.IO.Path]::GetTempPath()
38-
echo "Temp Path: $tempPath"
39-
Get-ChildItem -Path $tempPath -Filter *.cpuprofile | Copy-Item -Destination "$(Build.SourcesDirectory)/out/logs"
40-
displayName: 'Copy .cpuprofile files to out/logs'
41-
condition: succeededOrFailed()
42-
4338
- task: PublishTestResults@2
4439
condition: succeededOrFailed()
4540
displayName: 'Publish Test Results'
@@ -51,16 +46,28 @@ steps:
5146
mergeTestResults: true
5247
testRunTitle: $(System.StageDisplayName) $(Agent.JobName) (Attempt $(System.JobAttempt))
5348

49+
- powershell: |
50+
Write-Host "##vso[task.setvariable variable=isIntegrationVar;]${{ parameters.isIntegration }}"
51+
displayName: 'Set IsIntegration Variable'
52+
condition: succeededOrFailed()
53+
54+
- powershell: |
55+
$tempPath = [System.IO.Path]::GetTempPath()
56+
echo "Temp Path: $tempPath"
57+
Get-ChildItem -Path $tempPath -Filter *.cpuprofile | Copy-Item -Destination "$(Build.SourcesDirectory)/out/logs"
58+
displayName: 'Copy .cpuprofile files to out/logs'
59+
condition: eq(variables.isIntegrationVar, true)
60+
5461
- ${{ if eq(variables['System.TeamProject'], 'internal') }}:
5562
- task: 1ES.PublishPipelineArtifact@1
56-
condition: succeededOrFailed()
63+
condition: eq(variables.isIntegrationVar, true)
5764
displayName: 'Upload integration test logs'
5865
inputs:
5966
path: '$(Build.SourcesDirectory)/out/logs'
6067
artifact: 'Test Logs ($(System.StageDisplayName)-$(Agent.JobName)-$(System.JobAttempt))'
6168
- ${{ else }}:
6269
- task: PublishPipelineArtifact@1
63-
condition: succeededOrFailed()
70+
condition: eq(variables.isIntegrationVar, true)
6471
displayName: 'Upload integration test logs'
6572
inputs:
6673
targetPath: '$(Build.SourcesDirectory)/out/logs'

0 commit comments

Comments
 (0)