Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 26, 2025

Added CI pipeline job to build and verify public samples, with optimizations for performance and code quality improvements based on review feedback.

Changes Made

Added WindowsSamples CI Job

  • New job in azure-pipelines.yml to build samples on Windows (Release and Debug configurations)
  • Runs after main Windows build completes
  • Installs Windows SDK for UWP/WinUI samples

Created eng/build-samples.ps1 Script

  • Reusable PowerShell script that developers can run locally
  • Iterates through all solution files in samples/public
  • Provides build summary with success/failure counts

Added Solution File

  • samples/public/mstest-runner/Simple1/Simple1.sln

Simplified Path Handling (Review feedback from @nohwnd)

  • Changed from Join-Path to simple string interpolation with forward slashes
  • $samplesFolder = "$repoRoot/samples/public" instead of nested Join-Path calls
  • . "$PSScriptRoot/common/tools.ps1" using forward slashes
  • $dotnetPath = "$dotnetRoot/dotnet.exe" using forward slashes

Improved Parameter Type (Review feedback from @nohwnd)

  • Changed [bool]$TreatWarningsAsErrors = $false to [switch]$TreatWarningsAsErrors
  • Better for interactive use - users can now use -TreatWarningsAsErrors flag
  • More idiomatic PowerShell pattern

Restored MSTestRunnerWinUI.sln (Comment from @Evangelink)

  • File was accidentally deleted and has been restored

Enabled TreatWarningsAsErrors (Comment from @Youssef1313 / @Evangelink)

  • Added -TreatWarningsAsErrors flag to CI pipeline arguments for stricter validation

Solutions Built in CI (11 total)

  1. BlankUwpNet9App
  2. BlankWinUINet9App
  3. DemoMSTestSdk
  4. TestingPlatformSamples
  5. CustomReportExtension
  6. EnsureTestFramework
  7. MSTestProjectWithExplicitMain
  8. MSTestRunnerWinUI
  9. NativeAotRunner (TestProject1)
  10. RunInDocker
  11. Simple1

Note: The runner_vs_vstest folder contains performance comparison projects (1K, 10K, 100K tests) that are not included in CI builds as they don't have a solution file and are intended for local performance testing only.

Benefits

  • Prevents sample breakage: Samples validated on every CI run
  • Developer-friendly: Script can be run locally with .\eng\build-samples.ps1
  • Cleaner code: Forward slashes work in PowerShell on all platforms
  • Better UX: Switch parameters are more intuitive for boolean flags
  • Stricter validation: Warnings treated as errors in CI

Testing

Original prompt

This section details on the original issue you should resolve

<issue_title>Public samples are not built in CI</issue_title>
<issue_description>Our public samples are not built in CI. We should fix that.</issue_description>

<agent_instructions>Create a new leg for the unofficial build pipeline that will ensure the projects in folder samples are built and working. Let's do this with windows release only</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix CI to ensure public samples are built Add samples build verification to CI pipeline Oct 26, 2025
Copilot AI requested a review from Evangelink October 26, 2025 09:59
Copilot finished work on behalf of Evangelink October 26, 2025 09:59
Copy link
Member

@Evangelink Evangelink left a comment

Choose a reason for hiding this comment

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

Let's also make the full powershell building all examples a script inside eng folder so that it can be run locally by devs

@Evangelink
Copy link
Member

@copilot please handle comments

Copy link
Contributor Author

Copilot AI commented Oct 26, 2025

Let's also make the full powershell building all examples a script inside eng folder so that it can be run locally by devs

Created eng/build-samples.ps1 in commit 9203554. Developers can now run:

.\eng\build-samples.ps1 -Configuration Release

The script iterates through all sample solutions in samples/public and provides a summary of results.

Copilot AI requested a review from Evangelink October 26, 2025 10:14
Copilot finished work on behalf of Evangelink October 26, 2025 10:14
@Evangelink Evangelink marked this pull request as ready for review October 26, 2025 10:35
@Evangelink Evangelink enabled auto-merge (squash) October 26, 2025 10:35
@Evangelink
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines failed to run 1 pipeline(s).

@Evangelink
Copy link
Member

@copilot pipeline seems to be broken:

/eng/common/core-templates/job/job.yml (Line: 110, Col: 9): A mapping was not expected1188261 |  
-- | --
  | /eng/common/core-templates/job/job.yml (Line: 110, Col: 9): Unexpected value 'lit'1188261 |  
  | /eng/common/core-templates/job/job.yml (Line: 110, Col: 9): Unexpected value 'style'1188261 |  
  | /eng/common/core-templates/job/job.yml (Line: 110, Col: 9): Unexpected value 'line'1188261 |  
  | /eng/common/core-templates/job/job.yml (Line: 110, Col: 9): Unexpected value 'col'1188261 |  
  | /eng/common/core-templates/job/job.yml (Line: 110, Col: 9): Unexpected value 'type'1188261 |  
  | /eng/common/core-templates/job/job.yml: Expected a scalar value, a sequence, or a mapping

Do not update eng/common/core-templates/job/job.yml but instead fix current script so that it doesn't fail

Copy link
Contributor Author

Copilot AI commented Oct 29, 2025

@copilot pipeline seems to be broken:

...

Fixed in commit 12b1490. Removed all -ForegroundColor parameters from the PowerShell script to prevent ANSI escape sequences from interfering with YAML parsing. The script now outputs plain text while maintaining all functionality.

Copilot AI requested a review from Evangelink October 29, 2025 10:18
Copilot AI requested a review from Evangelink November 25, 2025 12:04
Copilot finished work on behalf of Evangelink November 25, 2025 12:04
Copilot AI requested a review from Evangelink November 25, 2025 13:35
Copilot finished work on behalf of Evangelink November 25, 2025 13:35
Copilot finished work on behalf of Evangelink November 25, 2025 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Public samples are not built in CI

4 participants