Add script to sync expected output

This commit is contained in:
Yoann Chaudet
2022-07-27 13:18:49 -07:00
parent d9d253201f
commit f64a106cc1
+18 -25
View File
@@ -57,34 +57,27 @@ $ErrorActionPreference = 'Stop'
# Get git ref name # Get git ref name
$ref = Get-GitRef $ref = Get-GitRef
# # Run the workflow # Run the workflow
# Write-Host 'Queue workflow' Write-Host 'Queue workflow'
# $workflow = 'record.yml' $workflow = 'record.yml'
# Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null } Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null }
# # Wait for a few seconds for the workflow to get created # Wait for a few seconds for the workflow to get created
# Write-Host 'Wait a few seconds...' Write-Host 'Wait a few seconds...'
# Start-Sleep -Seconds 5 Start-Sleep -Seconds 5
# # Lookup the run id (it is not perfect because of the APIs...) # Lookup the run id (it is not perfect because of the APIs...)
# Write-Host 'Lookup run id' Write-Host 'Lookup run id'
# $runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 100 --json databaseId --jq '.[].databaseId' } $runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 100 --json databaseId --jq '.[].databaseId' }
# # Wait for the workflow to finish # Wait for the workflow to finish
# Write-Host "Wait for workflow $runId to complete" Write-Host "Wait for workflow $runId to complete"
# Invoke-Command { & gh run watch $runId --exit-status } Invoke-Command { & gh run watch $runId --exit-status }
# # Download the artifacts in a temp folder # Download the artifacts in a temp folder
# Write-Host 'Download artifacts' Write-Host 'Download artifacts'
# $tempFolder = New-TemporaryFolder $tempFolder = New-TemporaryFolder
# Invoke-Command { & gh run download $runId --dir $tempFolder } Invoke-Command { & gh run download $runId --dir $tempFolder }
# TEMP
$tempFolder = '/var/folders/0p/xh302z2x64b64_4l9xc5n7bm0000gn/T/959ec25f-986e-48b1-b6a8-155cd7ba62fe'
Write-Host $tempFolder
$runId = 2748946582
# Iterate over the test projects # Iterate over the test projects
Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object { Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
@@ -93,7 +86,7 @@ Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
if (Test-Path $artifactPath -PathType 'Container') { if (Test-Path $artifactPath -PathType 'Container') {
# Copy artifact to the expected output folder # Copy artifact to the expected output folder
$destinationPath = Join-Path $testProjectsPath $_.BaseName '_expected' $destinationPath = Join-Path $testProjectsPath $_.BaseName '_expected'
Copy-Item -Path $artifactPath -Destination $destinationPath -Recurse | Out-Null Copy-Item -Path (Join-Path $artifactPath '*') -Destination $destinationPath -Recurse -Force | Out-Null
} }
# Ignore test project # Ignore test project