@@ -496,70 +496,30 @@ jobs:
496
496
displayName: Run Tests
497
497
timeoutInMinutes: ${{ variables.runTestsTimeout }}
498
498
499
- - ${{ if eq(parameters.targetOS, 'windows') }} :
500
-
501
- # Don't use CopyFiles@2 as it encounters permissions issues because it indexes all files in the source directory graph.
502
- - powershell : |
503
- function CopyWithRelativeFolders($sourcePath, $targetFolder, $filter) {
504
- Get-ChildItem -Path $sourcePath -Filter $filter -Recurse | ForEach-Object {
505
- $targetPath = Join-Path $targetFolder (Resolve-Path -Relative $_.FullName)
506
- New-Item -ItemType Directory -Path (Split-Path -Parent $targetPath) -Force | Out-Null
507
- Copy-Item $_.FullName -Destination $targetPath -Force
508
- Write-Host "Copied $_ to $targetPath"
509
- }
510
- }
511
-
512
- $targetFolder = "$(Build.ArtifactStagingDirectory)/BuildLogs/"
513
- New-Item -ItemType Directory -Path $targetFolder -Force | Out-Null
514
-
515
- cd "$(sourcesPath)"
516
-
517
- CopyWithRelativeFolders "artifacts/log/" $targetFolder "*"
518
-
519
- if (Test-Path "artifacts/scenario-tests/") {
520
- CopyWithRelativeFolders "artifacts/scenario-tests/" $targetFolder "*.binlog"
521
- echo "##vso[task.setvariable variable=hasScenarioTestResults]true"
522
- }
523
-
524
- if (Test-Path "artifacts/TestResults/*") {
525
- CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.binlog"
526
- CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.diff"
527
- CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "Updated*.txt"
528
- CopyWithRelativeFolders "artifacts/TestResults/" $targetFolder "*.trx"
529
- }
530
- displayName: Prepare BuildLogs staging directory and check assets
531
- continueOnError: true
532
- condition: succeededOrFailed()
533
-
534
- - ${{ else }} :
535
-
536
- # Don't use CopyFiles@2 as it encounters permissions issues because it indexes all files in the source directory graph.
537
- - script : |
538
- set -ex
539
-
540
- targetFolder=$(Build.ArtifactStagingDirectory)/BuildLogs/
541
- mkdir -p ${targetFolder}
542
-
543
- cd "$(sourcesPath)"
544
-
545
- find artifacts/log/ -exec cp --parents {} ${targetFolder} \;
546
-
547
- if [ -d "artifacts/scenario-tests/" ]; then
548
- find artifacts/scenario-tests/ -type f -name "*.binlog" -exec cp --parents {} ${targetFolder} \;
549
- echo "##vso[task.setvariable variable=hasScenarioTestResults]true"
550
- fi
551
-
552
- if [ -d "artifacts/TestResults/" ]; then
553
- find artifacts/TestResults/ -type f -name "*.binlog" -exec cp --parents {} ${targetFolder} \;
554
- find artifacts/TestResults/ -type f -name "*.diff" -exec cp --parents {} ${targetFolder} \;
555
- find artifacts/TestResults/ -type f -name "Updated*.txt" -exec cp --parents {} ${targetFolder} \;
556
- find artifacts/TestResults/ -type f -name "*.trx" -exec cp --parents {} ${targetFolder} \;
557
- fi
558
-
559
- if [[ "${{ parameters.buildSourceOnly }}" == "True" ]]; then
560
- find artifacts/prebuilt-report/ -exec cp --parents {} ${targetFolder} \;
561
- fi
562
- displayName: Prepare BuildLogs staging directory and check assets
499
+ - task : CopyFiles@2
500
+ displayName : Prepare BuildLogs staging directory
501
+ inputs :
502
+ SourceFolder : ' $(sourcesPath)'
503
+ Contents : |
504
+ artifacts/log/**
505
+ artifacts/scenario-tests/**/*.binlog
506
+ artifacts/TestResults/**/*.binlog
507
+ artifacts/TestResults/**/*.diff
508
+ artifacts/TestResults/**/Updated*.txt
509
+ artifacts/TestResults/**/*.trx
510
+ artifacts/TestResults/**/*.xml
511
+ TargetFolder : ' $(Build.ArtifactStagingDirectory)/BuildLogs'
512
+ CleanTargetFolder : true
513
+ continueOnError : true
514
+ condition : succeededOrFailed()
515
+
516
+ - ${{ if eq(parameters.buildSourceOnly, 'True') }} :
517
+ - task : CopyFiles@2
518
+ displayName : Copy prebuilt-report to BuildLogs
519
+ inputs :
520
+ SourceFolder : ' $(sourcesPath)'
521
+ Contents : artifacts/prebuilt-report/**
522
+ TargetFolder : ' $(Build.ArtifactStagingDirectory)/BuildLogs'
563
523
continueOnError : true
564
524
condition : succeededOrFailed()
565
525
0 commit comments