-
Notifications
You must be signed in to change notification settings - Fork 201
[MSBUILD SDK] Add integration tests for new msbuild sdk #3216
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
[MSBUILD SDK] Add integration tests for new msbuild sdk #3216
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive integration tests for the new MSBuild SDK, enabling self-bootstrapping test execution without manual setup. The tests cover restore, build, property evaluation, and item handling scenarios. Additionally, it introduces custom assertion extensions for MSBuild types through AwesomeAssertions to provide more natural and readable test assertions.
Key Changes
- Added integration test infrastructure with automatic MSBuild assembly resolution and custom formatters
- Created assertion extensions for
BuildOutput,BuildEventArgs, andProjectItemtypes - Enhanced
LogMessagewith formatting capabilities and help keyword support
Reviewed Changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/Azure.Functions.Sdk.Tests/Resources.resx | Added test resource file containing template content for host.json, local.settings.json, and minimal Program.cs |
| test/Azure.Functions.Sdk.Tests/ModuleInitializer.cs | Implements module initialization for MSBuild assembly resolution and custom formatters |
| test/Azure.Functions.Sdk.Tests/LogMessageTests.cs | Added Format_KnownMessage_ReturnsMessage test and minor formatting improvements |
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Restore.cs | Tests for SDK restore operations including success and failure scenarios |
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Properties.cs | Tests verifying SDK property defaults and tooling suffix calculations |
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Items.cs | Tests for SDK item metadata including local.settings.json, host.json, and package references |
| test/Azure.Functions.Sdk.Tests/Integration/SdkEndToEndTests.Build.cs | Tests for SDK build operations |
| test/Azure.Functions.Sdk.Tests/Integration/MSBuildSdkTestBase.cs | Base class providing test infrastructure including temp directory management |
| test/Azure.Functions.Sdk.Tests/Integration/MSBuildExtensions.cs | Extension methods for creating Azure Functions projects and executing build operations |
| test/Azure.Functions.Sdk.Tests/Azure.Functions.Sdk.Tests.csproj | Updated project file to include MSBuild packages and SDK file copying |
| test/Azure.Functions.Sdk.Tests/Assertions/ProjectItemAssertions.cs | Custom assertions for MSBuild ProjectItem type |
| test/Azure.Functions.Sdk.Tests/Assertions/FormatterResolver.cs | Automatically registers custom formatters for AwesomeAssertions |
| test/Azure.Functions.Sdk.Tests/Assertions/BuildOutputAssertions.cs | Custom assertions for BuildOutput including success/failure and issue checking |
| test/Azure.Functions.Sdk.Tests/Assertions/BuildEventArgsAssertions.cs | Custom assertions for BuildEventArgs including SDK message matching |
| src/Azure.Functions.Sdk/Tasks/MSBuildLogExtensions.cs | Refactored parameter names and added ToMessageImportance method, updated help keyword generation |
| src/Azure.Functions.Sdk/Targets/Azure.Functions.Sdk.targets | Changed UnsupportedTargetFramework from Error to Warning and reorganized property definitions |
| src/Azure.Functions.Sdk/Strings.resx | Updated AZFW0107 from Error to Warning with improved message |
| src/Azure.Functions.Sdk/LogMessage.cs | Added Format methods and HelpKeyword property, renamed Error_UnsupportedTargetFramework to Warning_UnsupportedTargetFramework |
| src/Azure.Functions.Sdk/Azure.Functions.Sdk.csproj | Added GetSdkFiles target and updated packaging configuration for SDK files |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/Azure.Functions.Sdk.Tests/Integration/MSBuildSdkTestBase.cs
Outdated
Show resolved
Hide resolved
c8d8997 to
bb4448d
Compare
e428977 to
2e93512
Compare
543836c to
19a89e1
Compare
105bda6 to
4fbbb12
Compare
8d3b96a to
6efe069
Compare
Issue describing the changes in this PR
Part of #3131
Pull request checklist
release_notes.mdAdditional information
This PR adds integration tests for the new msbuild sdk. The integration tests are self-bootstrapping. No manual setup steps are required. This PR also adds many assertion extensions for MSBuild types to AwesomeAssertions, giving a more natural way to assert in tests.
This PR also changes the error for using a TFM < net8.0 to a warning.