Skip to content

Commit f64a106

Browse files
committed
Add script to sync expected output
1 parent d9d2532 commit f64a106

File tree

1 file changed

+18
-25
lines changed

1 file changed

+18
-25
lines changed

bin/sync_expected_output.ps1

Lines changed: 18 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,27 @@ $ErrorActionPreference = 'Stop'
5757
# Get git ref name
5858
$ref = Get-GitRef
5959

60-
# # Run the workflow
61-
# Write-Host 'Queue workflow'
62-
# $workflow = 'record.yml'
63-
# Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null }
60+
# Run the workflow
61+
Write-Host 'Queue workflow'
62+
$workflow = 'record.yml'
63+
Invoke-Command { & gh workflow run $workflow --ref $ref | Out-Null }
6464

65-
# # Wait for a few seconds for the workflow to get created
66-
# Write-Host 'Wait a few seconds...'
67-
# Start-Sleep -Seconds 5
65+
# Wait for a few seconds for the workflow to get created
66+
Write-Host 'Wait a few seconds...'
67+
Start-Sleep -Seconds 5
6868

69-
# # Lookup the run id (it is not perfect because of the APIs...)
70-
# Write-Host 'Lookup run id'
71-
# $runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 100 --json databaseId --jq '.[].databaseId' }
69+
# Lookup the run id (it is not perfect because of the APIs...)
70+
Write-Host 'Lookup run id'
71+
$runId = Invoke-Command { & gh run list --workflow $workflow --branch $ref --limit 100 --json databaseId --jq '.[].databaseId' }
7272

73-
# # Wait for the workflow to finish
74-
# Write-Host "Wait for workflow $runId to complete"
75-
# Invoke-Command { & gh run watch $runId --exit-status }
73+
# Wait for the workflow to finish
74+
Write-Host "Wait for workflow $runId to complete"
75+
Invoke-Command { & gh run watch $runId --exit-status }
7676

77-
# # Download the artifacts in a temp folder
78-
# Write-Host 'Download artifacts'
79-
# $tempFolder = New-TemporaryFolder
80-
# Invoke-Command { & gh run download $runId --dir $tempFolder }
81-
82-
83-
# TEMP
84-
$tempFolder = '/var/folders/0p/xh302z2x64b64_4l9xc5n7bm0000gn/T/959ec25f-986e-48b1-b6a8-155cd7ba62fe'
85-
86-
Write-Host $tempFolder
87-
$runId = 2748946582
77+
# Download the artifacts in a temp folder
78+
Write-Host 'Download artifacts'
79+
$tempFolder = New-TemporaryFolder
80+
Invoke-Command { & gh run download $runId --dir $tempFolder }
8881

8982
# Iterate over the test projects
9083
Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
@@ -93,7 +86,7 @@ Get-ChildItem -Path $testProjectsPath -Directory | ForEach-Object {
9386
if (Test-Path $artifactPath -PathType 'Container') {
9487
# Copy artifact to the expected output folder
9588
$destinationPath = Join-Path $testProjectsPath $_.BaseName '_expected'
96-
Copy-Item -Path $artifactPath -Destination $destinationPath -Recurse | Out-Null
89+
Copy-Item -Path (Join-Path $artifactPath '*') -Destination $destinationPath -Recurse -Force | Out-Null
9790
}
9891

9992
# Ignore test project

0 commit comments

Comments
 (0)