未验证 提交 2401db9e 编写于 作者: R Rikki Gibson 提交者: GitHub

improve vscode tests perf (#43767)

上级 03a3801a
......@@ -125,6 +125,8 @@
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
"-filePath",
"${file}",
"-msbuildEngine",
"dotnet",
"-framework",
"netcoreapp3.1",
"-filter",
......@@ -142,6 +144,8 @@
"${workspaceRoot}/scripts/vscode-run-tests.ps1",
"-filePath",
"${file}",
"-msbuildEngine",
"dotnet",
"-framework",
"netcoreapp3.1"
],
......
param (
[Parameter(Mandatory = $true)][string]$filePath,
[string]$msbuildEngine = "vs"
[string]$msbuildEngine = "vs",
[string]$framework = ""
)
Set-StrictMode -version 3.0
......@@ -12,7 +13,8 @@ $fileInfo = Get-ItemProperty $filePath
$projectFileInfo = Get-ProjectFile $fileInfo
if ($projectFileInfo) {
$buildTool = InitializeBuildTool
$buildArgs = "$($buildTool.Command) -v:m -m -p:UseRoslynAnalyzers=false -p:GenerateFullPaths=true $($projectFileInfo.FullName)"
$frameworkArg = if ($framework -ne "") { " -p:TargetFramework=$framework" } else { "" }
$buildArgs = "$($buildTool.Command) -v:m -m -p:UseRoslynAnalyzers=false -p:GenerateFullPaths=true$frameworkArg $($projectFileInfo.FullName)"
Write-Host "$($buildTool.Path) $buildArgs"
Exec-Console $buildTool.Path $buildArgs
......
param (
[Parameter(Mandatory = $true)][string]$filePath,
[Parameter(Mandatory = $false)][string]$framework,
[Parameter(Mandatory = $false)][string]$filter
[string]$msbuildEngine = "vs",
[string]$framework = $null,
[string]$filter = ""
)
Set-StrictMode -version 3.0
......@@ -9,6 +10,10 @@ $ErrorActionPreference = "Stop"
. (Join-Path $PSScriptRoot "../eng/build-utils.ps1")
# Run a build
. (Join-Path $PSScriptRoot "./vscode-build.ps1") -filePath $filePath -framework $framework -msbuildEngine $msbuildEngine
Write-Output ""
$fileInfo = Get-ItemProperty $filePath
$projectFileInfo = Get-ProjectFile $fileInfo
if ($projectFileInfo) {
......@@ -23,9 +28,9 @@ if ($projectFileInfo) {
$resultsPath = Resolve-Path (New-Item -ItemType Directory -Force -Path $resultsPath) -Relative
# Remove old run logs with the same prefix
Remove-Item (Join-Path $resultsPath "$logFilePrefix*.html")
Remove-Item (Join-Path $resultsPath "$logFilePrefix*.html") -ErrorAction SilentlyContinue
$invocation = "$dotnetPath test $projectDir" + $filterArg + $frameworkArg + " --logger `"html;LogFilePrefix=$logfilePrefix`" --results-directory $resultsPath"
$invocation = "$dotnetPath test $projectDir" + $filterArg + $frameworkArg + " --logger `"html;LogFilePrefix=$logfilePrefix`" --results-directory $resultsPath --no-build"
Write-Output "> $invocation"
Invoke-Expression $invocation
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册