-
Couldn't load subscription status.
- Fork 1.2k
Move src/Tests to test
#37200
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
Move src/Tests to test
#37200
Conversation
…d editorconfig settings to apply to both src and test folder.
|
It looks like there are still some test files under src/Tests. |
|
I'm not sure whether I'm fan of the singular word Aside from that, I see the model that we have in the libraries part of dotnet/runtime as the preferred one over a dedicated tests folder. In libraries we have have the following folder structure per component: Tests often depend on shared sources or other parts from the src directory, i.e. referencing the source project via a P2P. Grouping them together per component has worked really well in runtime. FWIW I was planning to move the APICompat and GenAPI test projects into the Compatibility folder, next to the source project folders here in this repo. |
|
The changes look good to me. I only hesitate to approve because, like ViktorHofer, I'm not sure it's really better to have a dedicated test folder. I'm assuming that if we take this change, no similar changes would occur in the roslyn, runtime, msbuild, etc. repos to put tests in a dedicated test folder, and I'd rather align with other dotnet repos (particularly the 'flagship' dotnet repos) than with random other repos. I agree that test code isn't intended to ship, but I'd argue it's an important part of the product, and good tests should not be treated as an afterthought. Using MSBuild as an example, there's a lot of source code in the src directory that doesn't normally ship! It's there for legacy reasons. (And if you can remove it without breaking people, you will make rainersigwald very happy.) |
That happened when I merged |
I've seen both I don't know why the standard uses plural for some and singular for others. Take the PowerShell repo for example. It has singular
Azure PowerShell had a similar concept per Azure service: I think something like this would be great for this repo. However, I'm not looking to restructure the entire repo at the moment. I'm just going to be moving the
That would work great for a component-based folder structure. This repo kinda has that but a bunch of things aren't set up that way. Based on this discussion, though, I really think segregating the repo by components is likely the best solution. |
This (root-level
Tests are a very important part of the product. They are so important, I feel they should have their own root-level folder. 😉 As it stands, this repo has a half-single product, half-componentized folder structure, which is confusing. Even the layout of the test projects/folders don't make a lot of sense to me and involve a lot of weird linking to source files (meaning, the folder structure doesn't relate to the Solution Explorer structure when viewing the project in VS). I'd love to restructure the repo to be a bit more logical, but that's not my focus at this point. 😢 |
|
I'm fine with this if it helps to merge installer and sdk together (if that's the goal). Please file a follow-up issue to track the migration to a componentized folder structure. |
|
In other repositories, I often use commands like |
This is a great point in favor of at least making it Tests instead of test...though I'm not 100% sure whether * can match "". A root-level directory called test with a subdirectory called Tests would definitely work for that but would not look at all good 😆 |
|
I mean, it's fine if dotnet/sdk has |
Summary
I started to work on the dotnet/installer merge and realized how unconventional
src\Testswas. Most repo structure conventions in the last decade have a dedicatedtestfolder at the root of the repo, sincesrcis generally for product source code only. So, I movedsrc\Teststotestand adjusted what was necessary to build such as relative paths. This PR doesn't change anything about the output structure (that withinartifacts). This is only the structure of the files within the repo itself.The dotnet/installer repo also has a
testfolder at the root. I believe many of the older repos (runtime, roslyn, etc.) don't have atestfolder at the root as this kind of paradigm wasn't established. Thetestfolder convention just helps with separation-of-concerns for how to scaffold the contents of the repo. It has no functional changes.Reference
There are many other sources on this information. Additionally, one of the repos that was merged into this, dotnet/cli, also had a
testfolder. I can find more information if need be.