-
Notifications
You must be signed in to change notification settings - Fork 302
Add source NuGet package for the dotnet test wire contract (follow-up to #9218) #9231
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
8c48522
Add source NuGet package for the dotnet test wire contract
Evangelink 00fa42d
Document why the source package targets netstandard2.0 (not net8/9/10)
Evangelink d9ab77b
Address review: make package pack-only, fix props comment/indentation
Evangelink 4e28ad6
Mark dotnet test contract types [Embedded]; source-link ids instead o…
Evangelink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
....Testing.Platform.DotnetTestProtocol/Microsoft.Testing.Platform.DotnetTestProtocol.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <!-- | ||
| netstandard2.0 is deliberate, NOT net8/9/10: this is a source-only package. The contract files are shipped as | ||
| contentFiles/cs/any and are compiled into the CONSUMER's compilation under the consumer's own TFM (e.g. net11 | ||
| in dotnet/sdk), so this TargetFramework never reaches consumers. This project does not compile the contract | ||
| files itself (see DotnetTestProtocolContractCompile below), so the TFM only governs the empty placeholder | ||
| assembly; netstandard2.0 keeps it the lightest and needs no runtime packs. | ||
| --> | ||
| <TargetFramework>netstandard2.0</TargetFramework> | ||
|
|
||
| <!-- | ||
| Source-only package: it ships the 'dotnet test' wire-contract source files (ObjectFieldIds.cs + Constants.cs) | ||
| as contentFiles so a consumer (the dotnet/sdk 'dotnet test' implementation) compiles them into its OWN | ||
| assembly. This keeps a single source of truth for the protocol ids/constants instead of hand-copying them. | ||
|
|
||
| DotnetTestProtocolContractCompile=false makes the imported .props skip its <Compile> items: this project only | ||
| *packs* the files, it does not compile them. The guarantee that the shared contract compiles standalone is | ||
| provided by the dedicated consumer test project | ||
| (test/UnitTests/Microsoft.Testing.Platform.DotnetTestProtocolContract.UnitTests), not by this package build. | ||
| --> | ||
| <IsPackable>true</IsPackable> | ||
| <IncludeBuildOutput>false</IncludeBuildOutput> | ||
| <SuppressDependenciesWhenPacking>true</SuppressDependenciesWhenPacking> | ||
| <DotnetTestProtocolContractCompile>false</DotnetTestProtocolContractCompile> | ||
| <EnableDefaultCompileItems>false</EnableDefaultCompileItems> | ||
|
|
||
| <!-- Build-only / source contribution: it must not flow as a transitive runtime dependency to consumers. --> | ||
| <DevelopmentDependency>true</DevelopmentDependency> | ||
|
|
||
| <!-- | ||
| IsShipping=false keeps this package OUT of nuget.org and in the internal (NonShipping) feed used for cross-repo | ||
| dependency flow (dotnet/sdk). NOTE: the exact internal-feed shipping mechanism still needs confirmation with | ||
| the Arcade team (see PR discussion). | ||
| --> | ||
| <IsShipping>false</IsShipping> | ||
|
|
||
| <!-- NU5128: source-only package has no lib/ assembly, only contentFiles. --> | ||
| <NoWarn>$(NoWarn);NU5128</NoWarn> | ||
|
|
||
| <PackageDescription> | ||
| <![CDATA[Microsoft Testing is a set of platform, framework and protocol intended to make it possible to run any test on any target or device. | ||
|
|
||
| This package shares - as compiled source - the 'dotnet test' named-pipe wire contract (serializer/field ids and handshake/session/state constants) so that the protocol has a single source of truth across the microsoft/testfx and dotnet/sdk repositories. It is an implementation detail of 'dotnet test' integration and is not intended for direct end-user consumption.]]> | ||
| </PackageDescription> | ||
| </PropertyGroup> | ||
|
|
||
| <!-- | ||
| Pulls in @(DotnetTestProtocolContractSource) - the canonical contract file list. We set | ||
| DotnetTestProtocolContractCompile=false above, so the .props does NOT add <Compile> items here; this project only | ||
| packs that same item as contentFiles, so the NuGet and the in-repo source-share can never drift. | ||
| --> | ||
| <Import Project="$(RepoRoot)src\Platform\Microsoft.Testing.Platform\ServerMode\DotnetTest\DotnetTestProtocolContract.props" /> | ||
|
|
||
| <ItemGroup> | ||
| <None Include="@(DotnetTestProtocolContractSource)" | ||
| Pack="true" | ||
| BuildAction="Compile" | ||
| PackagePath="contentFiles/cs/any/DotnetTestProtocol/%(Filename)%(Extension)" /> | ||
| </ItemGroup> | ||
|
|
||
| </Project> |
31 changes: 31 additions & 0 deletions
31
src/Platform/Microsoft.Testing.Platform.DotnetTestProtocol/PACKAGE.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Microsoft.Testing.Platform.DotnetTestProtocol | ||
|
|
||
| This package shares — **as compiled source** — the `dotnet test` named-pipe **wire contract** used between a | ||
| [Microsoft.Testing.Platform](https://www.nuget.org/packages/Microsoft.Testing.Platform) test host and the | ||
| `dotnet test` command line. | ||
|
|
||
| It exists so the protocol's serializer/field ids and handshake/session/state constants have a **single source of | ||
| truth** across the [microsoft/testfx](https://github.com/microsoft/testfx) and | ||
| [dotnet/sdk](https://github.com/dotnet/sdk) repositories, instead of being hand-copied (where any drift is a silent | ||
| wire-protocol break). | ||
|
|
||
| > This package is an implementation detail of `dotnet test` integration. It is **not** intended for direct | ||
| > end-user consumption. | ||
|
|
||
| ## What's inside | ||
|
|
||
| The package ships two zero-dependency source files as `contentFiles` (compiled into the consuming assembly): | ||
|
|
||
| - `ObjectFieldIds.cs` — serializer ids and per-message field ids. | ||
| - `Constants.cs` — handshake property names, execution modes, session-event types, test states and the protocol | ||
| version. | ||
|
|
||
| Because they are delivered as `contentFiles/cs/any` with `BuildAction=Compile`, the consumer compiles them into its | ||
| **own** assembly, so the `internal` types are visible without any `InternalsVisibleTo` plumbing. | ||
|
|
||
| ## Scope | ||
|
|
||
| Only the wire **contract** (ids + constants) is shared here. The message **models** and **serializers** are not | ||
| included yet because they still depend on `TestMetadataProperty` | ||
| (`Microsoft.Testing.Platform.Extensions.Messages`) and use a different class shape than the SDK's copy; sharing them | ||
| requires decoupling/unifying first. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.