Skip to content

Commit

Permalink
Run restore.cmd during integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Aug 27, 2019
1 parent 9e581a0 commit cd02308
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
16 changes: 8 additions & 8 deletions azure-pipelines-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
36 changes: 22 additions & 14 deletions eng/format-verifier.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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) {
Expand All @@ -59,6 +65,8 @@ catch {
exit -1
}
finally {
Set-Location $currentLocation

Remove-Item $repoPath -Force -Recurse
Write-Output "$(Get-Date) - Deleted $repoName."
}

0 comments on commit cd02308

Please sign in to comment.