Skip to content

Conversation

@rolfbjarne
Copy link
Member

Use 'ExecuteTask' to execute a task instead of 'Assert.IsTrue (task.Execute ())',
because 'ExecuteTask' has much better failure reporting.

….IsTrue (task.Execute ())'

Use 'ExecuteTask' to very a task execution instead of 'Assert.IsTrue
(task.Execute ())', because 'ExecuteTask' has much better failure reporting.
@rolfbjarne rolfbjarne requested a review from Copilot January 23, 2026 00:32
@rolfbjarne rolfbjarne changed the title [tests] Use 'ExecuteTask' to very a task execution instead of 'Assert.IsTrue (task.Execute ())' [tests] Use 'ExecuteTask' to execute a task instead of 'Assert.IsTrue (task.Execute ())' Jan 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates MSBuild task tests to consistently run tasks via TestBase.ExecuteTask to improve failure diagnostics in test output.

Changes:

  • Extend TestBase.ExecuteTask with an optional message parameter to add context to assertion failures.
  • Replace direct Assert.IsTrue/IsFalse (task.Execute ()) usage across multiple task tests with ExecuteTask(...).
  • Simplify some tests by letting ExecuteTask assert success/failure and expected error counts.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TestHelpers/TestBase.cs Adds optional message parameter to ExecuteTask and includes it in assertion messages.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/PropertyListEditorTaskTests.cs Switches to ExecuteTask for success/failure execution assertions.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ParseBundlerArgumentsTests.cs Uses ExecuteTask and supplies per-variation context via the new message parameter.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs Replaces direct Execute() assertions and error-count checks with ExecuteTask.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/LocalizationStringTest.cs Uses ExecuteTask (task, 1) for expected-failure execution.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetPropertyListValueTaskTests.cs Uses ExecuteTask for expected success/failure paths.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/GetBundleNameTaskTests.cs Uses ExecuteTask and relies on it for error-count validation.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/DetectSdkLocationsTaskTests.cs Uses ExecuteTask (task, 1) to assert expected failure and error count.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CreateBindingResourceTaskTests.cs Switches to ExecuteTask for task execution (currently introduces a name-hiding compile issue).
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/ComputeCodesignItemsTaskTests.cs Replaces direct Execute() assertions with ExecuteTask.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CollectITunesArtworkTaskTests.cs Uses ExecuteTask for both expected failure and success paths.
tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/CollectBundleResourcesTaskTests.cs Uses ExecuteTask and removes redundant manual checks of Execute() return value.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #424e9a4] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne enabled auto-merge (squash) January 23, 2026 07:42
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #424e9a4] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #424e9a4] Build passed (Build macOS tests) ✅

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #424e9a4] Tests on macOS X64 - Mac Sonoma (14) passed 💻

All tests on macOS X64 - Mac Sonoma (14) passed.

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #424e9a4] Tests on macOS M1 - Mac Monterey (12) passed 💻

All tests on macOS M1 - Mac Monterey (12) passed.

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #424e9a4] Tests on macOS arm64 - Mac Sequoia (15) passed 💻

All tests on macOS arm64 - Mac Sequoia (15) passed.

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #424e9a4] Tests on macOS M1 - Mac Ventura (13) passed 💻

All tests on macOS M1 - Mac Ventura (13) passed.

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

💻 [CI Build #424e9a4] Tests on macOS arm64 - Mac Tahoe (26) passed 💻

All tests on macOS arm64 - Mac Tahoe (26) passed.

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🚀 [CI Build #424e9a4] Test results 🚀

Test results

✅ All tests passed on VSTS: test results.

🎉 All 119 tests passed 🎉

Tests counts

✅ cecil: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 6 tests passed. Html Report (VSDrops) Download
✅ linker: All 44 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 9 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (MacCatalyst): All 11 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (macOS): All 9 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ monotouch (tvOS): All 9 tests passed. [attempt 5] Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ windows: All 3 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 424e9a4ddf22911101e07652a1199824358a7dc7 [PR build]

@rolfbjarne rolfbjarne merged commit 673249b into main Jan 23, 2026
50 of 51 checks passed
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.

4 participants