From cd023087545ad0d872a79449163e2fd8ca5fe213 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 27 Aug 2019 10:57:52 -0700 Subject: [PATCH] Run restore.cmd during integration tests --- azure-pipelines-integration.yml | 16 +++++++-------- eng/format-verifier.ps1 | 36 ++++++++++++++++++++------------- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/azure-pipelines-integration.yml b/azure-pipelines-integration.yml index a379472e4a..003e3010cf 100644 --- a/azure-pipelines-integration.yml +++ b/azure-pipelines-integration.yml @@ -19,35 +19,35 @@ jobs: format: _repo: "https://github.com/dotnet/format" _repoName: "dotnet/format" - _sha: "b6db94c361b1ecd0558fc7429335ec01133773ed" + _sha: "4ff73616469a2aaa5ff07d11b7f6951eca83d76e" roslyn: _repo: "https://github.com/dotnet/roslyn" _repoName: "dotnet/roslyn" - _sha: "665dc224dcfefb66dce215ca0204363172b611ad" + _sha: "1bd191ea896b19e3b06a152f815f3a998e87049a" cli: _repo: "https://github.com/dotnet/cli" _repoName: "dotnet/cli" - _sha: "8d0f2a593ec98ccc1ef2141452d7dccadc34ac40" + _sha: "45f1c5f7f3275ff483c804e7c90bf61731a83e97" project-system: _repo: "https://github.com/dotnet/project-system" _repoName: "dotnet/project-system" - _sha: "80580ad27c5544f00f4abb9db930e698ce305285" + _sha: "fc3b12e47adaad6e4813dc600acf190156fecc24" msbuild: _repo: "https://github.com/Microsoft/msbuild" _repoName: "Microsoft/msbuild" - _sha: "d54d2e0180b99b7773f0fef2cdb03168f134d9aa" + _sha: "e92633a735b0e23e2cbf818d02ba89dd7a426f89" Blazor: _repo: "https://github.com/aspnet/Blazor" _repoName: "aspnet/Blazor" - _sha: "3addb6169afcae1b5c6a64de4a7cd02bd270ffed" + _sha: "7eeab316fa122b69a9bd777c93dcc78bc6a68905" EntityFrameworkCore: _repo: "https://github.com/aspnet/EntityFrameworkCore" _repoName: "aspnet/EntityFrameworkCore" - _sha: "090f385ffe4f2cd1a3e6b794523bdf574862c298" + _sha: "94f5bdf081f9a774f5d7f01bfa279bac26dab303" EntityFramework6: _repo: "https://github.com/aspnet/EntityFramework6" _repoName: "aspnet/EntityFramework6" - _sha: "936befcd88a4b58be6f35038248cd5337aca4967" + _sha: "9099ad2f6e5936ecdf549f88394b5a59fa75c869" timeoutInMinutes: 20 steps: - script: eng\integration-test.cmd -repo '$(_repo)' -sha '$(_sha)' -testPath '$(Build.SourcesDirectory)\temp' diff --git a/eng/format-verifier.ps1 b/eng/format-verifier.ps1 index cbe2a082ef..de36f2e6de 100644 --- a/eng/format-verifier.ps1 +++ b/eng/format-verifier.ps1 @@ -5,17 +5,7 @@ Param( [string]$testPath ) -function Clone-Repo([string]$repo, [string]$sha, [string]$repoPath) { - $currentLocation = Get-Location - - git.exe clone $repo $repoPath - - Set-Location $repoPath - - git.exe checkout $sha - - Set-Location $currentLocation -} +$currentLocation = Get-Location if (!(Test-Path $testPath)) { New-Item -ItemType Directory -Force -Path $testPath | Out-Null @@ -27,19 +17,35 @@ try { $repoPath = Join-Path $testPath $folderName Write-Output "$(Get-Date) - Cloning $repoName." - Clone-Repo $repo $sha $repoPath + git.exe clone $repo $repoPath + + Set-Location $repoPath + + git.exe checkout $sha Write-Output "$(Get-Date) - Finding solutions." - $solutions = Get-ChildItem -Path $repoPath -Filter *.sln -Recurse -Depth 2 | Select-Object -ExpandProperty FullName | Where-Object { $_ -match '.sln$' } + $solutions = Get-ChildItem -Filter *.sln -Recurse -Depth 2 | Select-Object -ExpandProperty FullName | Where-Object { $_ -match '.sln$' } + + if (Test-Path '.\restore.cmd') { + Write-Output "$(Get-Date) - Running restore.cmd" + $repoPath\restore.cmd + } + elseif (Test-Path '.\eng\common\Build.ps1') { + Write-Output "$(Get-Date) - Running Build.ps1 -restore" + $repoPath\eng\common\Build.ps1 -restore + } foreach ($solution in $solutions) { + $solutionPath = Split-Path $solution $solutionFile = Split-Path $solution -leaf + Set-Location $solutionPath + Write-Output "$(Get-Date) - $solutionFile - Restoring" dotnet.exe restore $solution Write-Output "$(Get-Date) - $solutionFile - Formatting" - $output = dotnet.exe run -p .\src\dotnet-format.csproj -c Release -- -w $solution -v d --dry-run | Out-String + $output = dotnet.exe run -p "$currentLocation\src\dotnet-format.csproj" -c Release -- -w $solution -v d --dry-run | Out-String Write-Output $output.TrimEnd() if ($LastExitCode -ne 0) { @@ -59,6 +65,8 @@ catch { exit -1 } finally { + Set-Location $currentLocation + Remove-Item $repoPath -Force -Recurse Write-Output "$(Get-Date) - Deleted $repoName." }