Skip to content

Produce binlog for test step #5192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: rel/3.8
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions azure-pipelines-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Comment on lines +141 to +143
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ViktorHofer I think you did mention a "better" way than the rename but I cannot recall what.

Copy link
Member

@ViktorHofer ViktorHofer Mar 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Repos usually set this in the YML to point to a different path: https://github.com/dotnet/wpf/blob/0d19d6864aa1841fb7fa4a0dbc9bdc1a2aa3eb4a/eng/pipeline-pr.yml#L195

- 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"
condition: always()

- ${{ 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
Expand All @@ -148,6 +158,13 @@ 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"
condition: always()

- task: CopyFiles@2
displayName: 'Copy binlogs'
inputs:
Expand Down
17 changes: 17 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,16 @@ 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"
condition: always()

- ${{ 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
Expand All @@ -103,6 +113,13 @@ 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"
condition: always()

# 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
Expand Down
Loading