Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 149 additions & 0 deletions Build/azuredevops/test/uitest-integration-stage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
parameters:
Copy link
Member Author

Choose a reason for hiding this comment

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

converted from json export to yml

- name: BinariesDirectory
type: string
default: '$(Drop)/binaries'
- name: CleanupProcesses
type: string
default: 'devenv, vshub, microsoft.vshub.server.httphost, python, ipy, microsoft.pythontools.analyzer, vstest.executionengine.x86, vstest.discoveryengine.x86'
- name: Drop
type: string
default: '$(System.ArtifactsDirectory)/$(DefinitionName)'
- name: TestFilterCriteria
type: string
default: 'Priority=0'
- name: UITestNames
type: string
default: ''

steps:
- task: ExtractFiles@1
displayName: Extract files
condition: succeeded()
inputs:
archiveFilePatterns: '${{ parameters.Drop }}/TestData/TestData.zip'
destinationFolder: '${{ parameters.Drop }}/TestData'
cleanDestinationFolder: false
overwriteExistingFiles: false

- task: PowerShell@2
displayName: Cleanup
condition: succeeded()
continueOnError: true
timeoutInMinutes: 5
inputs:
targetType: inline
arguments: '${{ parameters.CleanupProcesses }}'
script: |
param ([string[]]$names)
$running = Get-Process -Name $names -ErrorAction SilentlyContinue
while ($running) {
Write-Host 'Killing:'
$running
try {
$running | Stop-Process -Force
} catch {
}
Start-Sleep -Seconds 3
$running = Get-Process -Name $names -ErrorAction SilentlyContinue
}
errorActionPreference: stop
failOnStderr: true

- task: CopyFiles@2
displayName: Copy TestData into binaries
condition: succeeded()
continueOnError: true
inputs:
SourceFolder: '${{ parameters.Drop }}/TestData'
Contents: '**'
TargetFolder: '${{ parameters.BinariesDirectory }}/TestData'
CleanTargetFolder: 'true'
OverWrite: 'false'
flattenFolders: 'false'
preserveTimestamp: 'false'
retryCount: '0'

- task: CopyFiles@2
displayName: Copy runsettings to binary folder
condition: succeeded()
inputs:
SourceFolder: '${{ parameters.BinariesDirectory }}/TestData'
Contents: 'default.runsettings'
TargetFolder: '${{ parameters.BinariesDirectory }}'
CleanTargetFolder: 'false'
OverWrite: 'false'
flattenFolders: 'false'
preserveTimestamp: 'false'
retryCount: '0'

- task: PowerShell@2
displayName: Skip Verification
condition: succeeded()
inputs:
targetType: inline
script: |
reg import "${{ parameters.BinariesDirectory }}\TestData\EnableSkipVerification.reg"
errorActionPreference: stop
failOnStderr: false

- task: VSTest@2
displayName: '[MultiConfiguration] Run UI Test ${{ parameters.UITestNames }}'
Copy link
Contributor

Choose a reason for hiding this comment

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

The VSTest@2 is the task they provided to tag our tests as part of their global tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure yet.. I think they do support vstest but I think this is all going to change after i check it in

condition: succeeded()
continueOnError: true
inputs:
testSelector: testAssemblies
testAssemblyVer2: '${{ parameters.UITestNames }}UITestsRunner.dll'
tcmTestRun: '$(test.RunId)'
searchFolder: '${{ parameters.BinariesDirectory }}'
resultsFolder: '$(Agent.TempDirectory)/TestResults'
testFiltercriteria: '${{ parameters.TestFilterCriteria }}'
runOnlyImpactedTests: false
runAllTestsAfterXBuilds: 50
uiTests: true
vstestLocationMethod: version
vsTestVersion: latest
runSettingsFile: '${{ parameters.BinariesDirectory }}/default.runsettings'
overrideTestrunParameters: '-TargetFrameworkVersion .NETFramework,Version=v4.7.2'
runInParallel: false
runTestsInIsolation: false
codeCoverageEnabled: true
distributionBatchType: basedOnExecutionTime
batchingBasedOnAgentsOption: autoBatchSize
customBatchSizeValue: 10
batchingBasedOnExecutionTimeOption: customTimeBatchSize
customRunTimePerBatchValue: 300
dontDistribute: false
testRunTitle: '${{ parameters.UITestNames }} UI Tests'
publishRunAttachments: true
failOnMinTestsNotRun: false
minimumExpectedTests: 1
diagnosticsEnabled: true
collectDumpOn: onAbortOnly
rerunFailedTests: true
rerunType: basedOnTestFailurePercentage
rerunFailedThreshold: 50
rerunFailedTestCasesMaxLimit: 5
rerunMaxAttempts: 2

- task: PowerShell@2
displayName: Cleanup
condition: succeeded()
timeoutInMinutes: 5
inputs:
targetType: inline
arguments: '${{ parameters.CleanupProcesses }}'
script: |
param ([string[]]$names)
$running = Get-Process -Name $names -ErrorAction SilentlyContinue
while ($running) {
Write-Host 'Killing:'
$running
try {
$running | Stop-Process -Force
} catch {
}
Start-Sleep -Seconds 3
$running = Get-Process -Name $names -ErrorAction SilentlyContinue
}
errorActionPreference: stop
failOnStderr: true
2 changes: 1 addition & 1 deletion Python/Tests/Core.UI/TestExplorerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void RunAllUnittestProject(PythonVisualStudioApp app) {
var sln = app.CopyProjectForTest(@"TestData\TestExplorerUnittest.sln");
app.OpenProject(sln);

RunAllTests(app, AllUnittests);
RunAllTests(app, AllUnittests, Path.GetFileNameWithoutExtension(sln));
}

public void RunAllUnittestWorkspace(PythonVisualStudioApp app) {
Expand Down
2 changes: 2 additions & 0 deletions Python/Tests/PythonToolsUITestsRunner/TestExplorerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,14 @@ public void DebugPytestWorkspace() {
_vs.RunTest(nameof(PythonToolsUITests.TestExplorerTests.DebugPytestWorkspace));
}

[Ignore]
[TestMethod, Priority(UITestPriority.P0)]
[TestCategory("Installed")]
public void DebugUnittestProject() {
_vs.RunTest(nameof(PythonToolsUITests.TestExplorerTests.DebugUnittestProject));
}

[Ignore]
Copy link
Member Author

Choose a reason for hiding this comment

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

test debugging is flaky for some reason. disable for now

[TestMethod, Priority(UITestPriority.P0)]
[TestCategory("Installed")]
public void DebugUnittestWorkspace() {
Expand Down
Loading