Skip to content
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

Add InstanceId to communication with dotnet test #5279

Merged
merged 13 commits into from
Mar 20, 2025

Conversation

mariam-abdulla
Copy link
Contributor

This pull request introduces the ability to run dotnet test using the Microsoft Testing Platform, enhancing the testing experience while maintaining backward compatibility. The main changes include adding an InstanceId to various classes and methods to uniquely identify test instances and updating the serialization and deserialization processes to handle this new property.

Enhancements to Testing Platform:

  • Added a new InstanceId property to the DotnetTestConnection class to uniquely identify test instances. (src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs)
  • Updated the IsCompatibleProtocolAsync method to include InstanceId in the handshake message. (src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/DotnetTestConnection.cs)

Serialization and Deserialization Updates:

  • Added InstanceId to the HandshakeMessagePropertyNames and corresponding classes to handle the new property in messages. (src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Constants.cs)
  • Updated DiscoveredTestMessages, FileArtifactMessages, and TestResultMessages to include InstanceId and modified their serializers to handle the new property. (src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/DiscoveredTestMessages.cs, src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/FileArtifactMessages.cs, src/Platform/Microsoft.Testing.Platform/ServerMode/DotnetTest/IPC/Models/TestResultMessages.cs) [1] [2] [3]

Documentation:

  • Added RFC 011 to document the new feature of running dotnet test with the Microsoft Testing Platform, including motivation, proposed solution, and configuration details. (docs/RFCs/011-Sdk-Testing-Platform.md)

@mariam-abdulla mariam-abdulla changed the title Dev/mabdullah/add instance id to dotnet test Add InstanceId to communication with dotnet test Mar 20, 2025
Youssef1313
Youssef1313 previously approved these changes Mar 20, 2025
@Youssef1313 Youssef1313 enabled auto-merge (squash) March 20, 2025 14:46
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 33.33333% with 26 lines in your changes missing coverage. Please review.

Project coverage is 73.64%. Comparing base (bc4cb68) to head (91b85f3).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...erverMode/DotnetTest/IPC/DotnetTestDataConsumer.cs 16.66% 10 Missing ⚠️
...PC/Serializers/DiscoveredTestMessagesSerializer.cs 0.00% 7 Missing ⚠️
.../IPC/Serializers/FileArtifactMessagesSerializer.cs 0.00% 7 Missing ⚠️
...de/DotnetTest/IPC/Models/DiscoveredTestMessages.cs 0.00% 1 Missing ⚠️
...Mode/DotnetTest/IPC/Models/FileArtifactMessages.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5279      +/-   ##
==========================================
- Coverage   76.08%   73.64%   -2.45%     
==========================================
  Files         601      601              
  Lines       36368    36392      +24     
==========================================
- Hits        27672    26800     -872     
- Misses       8696     9592     +896     
Flag Coverage Δ
Debug 73.64% <33.33%> (-2.45%) ⬇️
integration 73.64% <33.33%> (-2.45%) ⬇️
production 73.64% <33.33%> (-2.45%) ⬇️
unit 73.64% <33.33%> (-2.45%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...form/ServerMode/DotnetTest/DotnetTestConnection.cs 59.03% <100.00%> (+1.01%) ⬆️
...erMode/DotnetTest/IPC/Models/TestResultMessages.cs 100.00% <100.00%> (ø)
...st/IPC/Serializers/TestResultMessagesSerializer.cs 95.57% <100.00%> (+0.12%) ⬆️
...de/DotnetTest/IPC/Models/DiscoveredTestMessages.cs 0.00% <0.00%> (ø)
...Mode/DotnetTest/IPC/Models/FileArtifactMessages.cs 0.00% <0.00%> (ø)
...PC/Serializers/DiscoveredTestMessagesSerializer.cs 1.35% <0.00%> (-0.10%) ⬇️
.../IPC/Serializers/FileArtifactMessagesSerializer.cs 1.11% <0.00%> (-0.07%) ⬇️
...erverMode/DotnetTest/IPC/DotnetTestDataConsumer.cs 36.17% <16.66%> (-0.65%) ⬇️

... and 63 files with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Youssef1313 Youssef1313 merged commit 66b23c3 into main Mar 20, 2025
7 of 8 checks passed
@Youssef1313 Youssef1313 deleted the dev/mabdullah/add-instance-id-to-dotnet-test branch March 20, 2025 15:23
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.

3 participants