-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test script to convert all wikis that are present.
- Loading branch information
1 parent
f2cdc65
commit b1a39fb
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#build the project | ||
dotnet build ".\AzureDevOps.WikiPDFExport\azuredevops-export-wiki.csproj" | ||
|
||
#get the test folders | ||
$wikis = Get-ChildItem -Recurse .\AzureDevOps.WikiPDFExport.Test\Tests -Depth 0 | ?{ $_.PSIsContainer } | ||
|
||
$results = @() | ||
|
||
#todo: read the previous result file to compare deltas | ||
#todo: find a way to compare pdfs to find differences | ||
|
||
#iterate over each wiki in the test folder | ||
foreach($wiki in $wikis) | ||
{ | ||
Write-Output "Running: $($wiki.FullName)" | ||
|
||
#run the converter | ||
$output = dotnet run --project ".\AzureDevOps.WikiPDFExport\azuredevops-export-wiki.csproj" -- -p $wiki.FullName -o ".\tests\$($wiki.Name).pdf" > $null | ||
|
||
#extrac the time | ||
$export = $output | ? {$_ -match 'Export done in (\d+):(\d+):(\d+).(\d+)'} | ||
$null = $export -match 'Export done in (\d+):(\d+):(\d+).(\d+)' | ||
$hours = $matches[1] | ||
$minutes = $matches[2] | ||
$seconds = $matches[3] | ||
$millis = $matches[4] | ||
|
||
Write-Output "$wiki.Name: $($hours):$($minutes):$($seconds):$($millis)" | ||
|
||
#persist the time for later comparision | ||
$obj = [PSCustomObject]@{ | ||
Name = $wiki.Name | ||
Hours = $hours | ||
Minutes = $minutes | ||
Seconds = $seconds | ||
Millis = $millis | ||
} | ||
|
||
$results += $obj | ||
} | ||
|
||
#save the new results | ||
$results | ConvertTo-Json | Set-Content -Path .\tests\results.json |
Empty file.