From 4dfd95b59f802ac286868c30cc21a114ab74919f Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 8 Mar 2025 15:02:13 +0100 Subject: [PATCH 1/2] Produce binlog for test step --- azure-pipelines-official.yml | 16 ++++++++++++++++ azure-pipelines.yml | 15 +++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 0eaf0a7168..7fd19f8e04 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -138,6 +138,16 @@ extends: name: Build displayName: Build + # Both the Build and Test steps produces binlog named Build.binlog (https://github.com/dotnet/arcade/issues/15611) + # We want to publish both binlogs. + # So, as a hack, we build, rename, test, rename again. + - task: PowerShell@2 + displayName: 'Rename Build.binlog to BuildStep.binlog' + inputs: + targetType: inline + script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\BuildStep.binlog" + + - ${{ if eq(parameters.SkipTests, False) }}: # -ci is allowing to import some environment variables and some required configurations # -nobl avoids overwriting build binlog with binlog from tests @@ -148,6 +158,12 @@ extends: name: Test displayName: Test + - task: PowerShell@2 + displayName: 'Rename Build.binlog to TestStep.binlog' + inputs: + targetType: inline + script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog" + - task: CopyFiles@2 displayName: 'Copy binlogs' inputs: diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7ab31f8fe6..7617fd8c25 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -93,6 +93,15 @@ stages: name: Build displayName: Build + # Both the Build and Test steps produces binlog named Build.binlog (https://github.com/dotnet/arcade/issues/15611) + # We want to publish both binlogs. + # So, as a hack, we build, rename, test, rename again. + - task: PowerShell@2 + displayName: 'Rename Build.binlog to BuildStep.binlog' + inputs: + targetType: inline + script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\BuildStep.binlog" + - ${{ if eq(parameters.SkipTests, False) }}: # -ci is allowing to import some environment variables and some required configurations # -nobl avoids overwriting build binlog with binlog from tests @@ -103,6 +112,12 @@ stages: name: Test displayName: Test + - task: PowerShell@2 + displayName: 'Rename Build.binlog to TestStep.binlog' + inputs: + targetType: inline + script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog" + # This step is only helpful for diagnosing some issues with vstest/test host that would not appear # through the console or trx - task: PublishBuildArtifacts@1 From efb33f531b2292755802e81603b12d7ae301746d Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 8 Mar 2025 16:47:26 +0100 Subject: [PATCH 2/2] Always rename for consistency --- azure-pipelines-official.yml | 3 ++- azure-pipelines.yml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-official.yml b/azure-pipelines-official.yml index 7fd19f8e04..e8e43685a9 100644 --- a/azure-pipelines-official.yml +++ b/azure-pipelines-official.yml @@ -146,7 +146,7 @@ extends: inputs: targetType: inline script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\BuildStep.binlog" - + condition: always() - ${{ if eq(parameters.SkipTests, False) }}: # -ci is allowing to import some environment variables and some required configurations @@ -163,6 +163,7 @@ extends: inputs: targetType: inline script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog" + condition: always() - task: CopyFiles@2 displayName: 'Copy binlogs' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7617fd8c25..17e3fe29aa 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -101,6 +101,7 @@ stages: inputs: targetType: inline script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\BuildStep.binlog" + condition: always() - ${{ if eq(parameters.SkipTests, False) }}: # -ci is allowing to import some environment variables and some required configurations @@ -117,6 +118,7 @@ stages: inputs: targetType: inline script: Copy-Item -Path "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\Build.binlog" -Destination "$(BUILD.SOURCESDIRECTORY)\artifacts\log\$(_BuildConfig)\TestStep.binlog" + condition: always() # This step is only helpful for diagnosing some issues with vstest/test host that would not appear # through the console or trx