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

System.TestStructs ships with Micrososoft.Extensions.DependencyInjection.Specification.Tests but builds from test directory #49069

Closed
ericstj opened this issue Mar 3, 2021 · 7 comments

Comments

@ericstj
Copy link
Member

ericstj commented Mar 3, 2021

#48858 started shipping System.TestStructs.

Micrososoft.Extensions.DependencyInjection.Specification.Tests is shipped to be used by 3rd party implementers of Micrososoft.Extensions.DependencyInjection in order to test their implementations. This was something done in dotnet/extensions, then dropped when we moved the source to dotnet/runtime, and brought back due to #37108 (comment) cc @maryamariyan @JunTaoLuo

@eerhardt added tests to this test assembly in 21ff47c which require the System.TestStructs assembly in order to test how DI implementations handle structs with parameterless constructors.

@ViktorHofer brought up some questions after we merged the PR and some issues arose around wether we should be shipping System.TestStructs as it is, or if it should be moved somewhere to better indicate that its a test assembly. For example https://github.com/dotnet/runtime/tree/main/src/libraries/Common/src or https://github.com/dotnet/runtime/tree/main/src/libraries/Common/tests.

We might also consider if we want to change the assembly name, public key token, or anything else about how we build this or other "shipping test assemblies".

This issue aims to gather concensus on these questions. Those mentioned, please weigh in.

@dotnet-issue-labeler dotnet-issue-labeler bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Mar 3, 2021
@ghost
Copy link

ghost commented Mar 3, 2021

Tagging subscribers to this area: @safern, @ViktorHofer, @Anipik
See info in area-owners.md if you want to be subscribed.

Issue Details

#48858 started shipping System.TestStructs.

Micrososoft.Extensions.DependencyInjection.Specification.Tests is shipped to be used by 3rd party implementers of Micrososoft.Extensions.DependencyInjection in order to test their implementations. This was something done in dotnet/extensions, then dropped when we moved the source to dotnet/runtime, and brought back due to #37108 (comment) cc @maryamariyan @JunTaoLuo

@eerhardt added tests to this test assembly in 21ff47c which require the System.TestStructs assembly in order to test how DI implementations handle structs which parameterized constructors.

@ViktorHofer brought up some questions after we merged the PR and some issues arose around wether we should be shipping System.TestStructs as it is, or if it should be moved somewhere to better indicate that its a test assembly. For example https://github.com/dotnet/runtime/tree/main/src/libraries/Common/src or https://github.com/dotnet/runtime/tree/main/src/libraries/Common/tests.

We might also consider if we want to change the assembly name, public key token, or anything else about how we build this or other "shipping test assemblies".

This issue aims to gather concensus on these questions. Those mentioned, please weigh in.

Author: ericstj
Assignees: -
Labels:

area-Infrastructure-libraries, untriaged

Milestone: -

@eerhardt
Copy link
Member

eerhardt commented Mar 3, 2021

The test added in 21ff47c did find a behavioral difference in Unity DI container: unitycontainer/microsoft-dependency-injection#87. So it seems like a valuable test.

Note that once the C# feature comes in which allows parameterless constructors on structs, we can remove the dependency on the TestStructs assembly and just create one in the test assembly.

@ViktorHofer ViktorHofer removed the untriaged New issue has not been triaged by the area owner label Mar 3, 2021
@ViktorHofer ViktorHofer added this to the 6.0.0 milestone Mar 3, 2021
@ViktorHofer
Copy link
Member

Note that once the C# feature comes in which allows parameterless constructors on structs, we can remove the dependency on the TestStructs assembly and just create one in the test assembly.

Is that a NET6 deliverable? If yes then I'm fine to wait, otherwise I would prefer to address this issue sooner.

@eerhardt
Copy link
Member

eerhardt commented Mar 3, 2021

Is that a NET6 deliverable?

According to https://github.com/dotnet/roslyn/blob/master/docs/Language%20Feature%20Status.md#c-next, it is currently in progress. @cston @jcouv @333fred could answer if parameterless struct constructors will make it for NET6.

@333fred
Copy link
Member

333fred commented Mar 3, 2021

Chuck is working on them. I would expect that they should make it.

@ericstj
Copy link
Member Author

ericstj commented Mar 4, 2021

@eerhardt in this case do you want to remove this test for now until we have the language feature?

eerhardt added a commit to eerhardt/runtime that referenced this issue Mar 4, 2021
Commenting out this test until the C# language feature is implemented. This allows us to ship the DI Specification tests without shipping the TestStructs project.

Contributes to dotnet#49069
stephentoub pushed a commit that referenced this issue Mar 5, 2021
Commenting out this test until the C# language feature is implemented. This allows us to ship the DI Specification tests without shipping the TestStructs project.

Contributes to #49069
@Anipik Anipik modified the milestones: 6.0.0, 7.0.0 Aug 4, 2021
@ViktorHofer
Copy link
Member

Closing as mitigated with b0ba53a.

@ghost ghost locked as resolved and limited conversation to collaborators Oct 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants