Skip to content

Commit

Permalink
Move src/Tests to test (dotnet#37200)
Browse files Browse the repository at this point in the history
  • Loading branch information
MiYanni authored Dec 9, 2023
2 parents 78aa7b7 + ffcfeed commit 91da06e
Show file tree
Hide file tree
Showing 1,775 changed files with 289 additions and 332 deletions.
8 changes: 4 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ dotnet_diagnostic.IDE0200.severity = none
dotnet_diagnostic.IDE0240.severity = warning

# Additional rules for template engine source code
[src/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs]
[{src,test}/**{Microsoft.TemplateEngine.*,dotnet-new?*}/**.cs]
# Default analyzed API surface = 'public' (public APIs)
dotnet_code_quality.api_surface = public
# Provide ObsoleteAttribute message
Expand Down Expand Up @@ -445,7 +445,7 @@ dotnet_diagnostic.SA1642.severity = none
dotnet_diagnostic.SA1649.severity = none

# Disable some StyleCop rules for test common Program.cs that is linked to test project of template engine
[src/Tests/Common/Program.cs]
[test/Common/Program.cs]
# Declare types in namespaces
dotnet_diagnostic.CA1050.severity = none
# Elements should be documented
Expand All @@ -456,7 +456,7 @@ dotnet_diagnostic.SA1601.severity = none
dotnet_diagnostic.SA1633.severity = none

# Additional rules for test source code for template engine
[src/Tests/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs]
[test/{Microsoft.TemplateEngine.*,dotnet-new.Tests}/**.cs]
# Test methods should not be skipped
dotnet_diagnostic.xUnit1004.severity = warning
# Elements should appear in the correct order
Expand Down Expand Up @@ -506,5 +506,5 @@ dotnet_diagnostic.IDE0040.severity = warning
[*.txt]
insert_final_newline = false

[src/Tests/dotnet-new.Tests/**/Approvals/**]
[test/dotnet-new.Tests/**/Approvals/**]
trim_trailing_whitespace = false
50 changes: 25 additions & 25 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@

# Area-WebSDK
/src/WebSdk/ @vijayrkn
/src/Tests/Microsoft.NET.Sdk.Publish.Tasks.Tests/ @vijayrkn
/test/Microsoft.NET.Sdk.Publish.Tasks.Tests/ @vijayrkn

# Area-AspNetCore
/src/BlazorWasmSdk/ @dotnet/aspnet-blazor-eng
/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/ @dotnet/aspnet-blazor-eng
/test/Microsoft.NET.Sdk.BlazorWebAssembly.Tests/ @dotnet/aspnet-blazor-eng
/src/Assets/TestProjects/BlazorHosted/ @dotnet/aspnet-blazor-eng
/src/Assets/TestProjects/BlazorHostedRID/ @dotnet/aspnet-blazor-eng
/src/Assets/TestProjects/BlazorWasmMinimal/ @dotnet/aspnet-blazor-eng
/src/Assets/TestProjects/BlazorWasmWithLibrary/ @dotnet/aspnet-blazor-eng
/src/RazorSdk/ @dotnet/aspnet-blazor-eng
/src/Tests/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/ @dotnet/aspnet-blazor-eng
/src/Tests/Microsoft.NET.Sdk.Razor.Tests/ @dotnet/aspnet-blazor-eng
/src/Tests/Microsoft.NET.Sdk.Razor.Tool.Tests/ @dotnet/aspnet-blazor-eng
/test/Microsoft.NET.Sdk.BlazorWebAssembly.AoT.Tests/ @dotnet/aspnet-blazor-eng
/test/Microsoft.NET.Sdk.Razor.Tests/ @dotnet/aspnet-blazor-eng
/test/Microsoft.NET.Sdk.Razor.Tool.Tests/ @dotnet/aspnet-blazor-eng
/src/Assets/TestPackages/PackageLibraryDirectDependency/ @dotnet/aspnet-blazor-eng
/src/Assets/TestPackages/PackageLibraryTransitiveDependency/ @dotnet/aspnet-blazor-eng
/src/src/Assets/TestProjects/Razor*/ @dotnet/aspnet-blazor-eng
Expand All @@ -31,64 +31,64 @@

# Area-Format
/src/Cli/dotnet/commands/dotnet-format @sharwell @arkalyanms
/src/Tests/dotnet-format.Tests @sharwell @arkalyanms
/test/dotnet-format.Tests @sharwell @arkalyanms

# Area-NuGet
/src/Cli/dotnet/commands/dotnet-add/dotnet-add-package @dotnet/nuget-team
/src/Tests/dotnet-add-package.Tests @dotnet/nuget-team
/test/dotnet-add-package.Tests @dotnet/nuget-team
/src/Cli/dotnet/commands/dotnet-nuget @dotnet/nuget-team
/src/Tests/dotnet-nuget.UnitTests @dotnet/nuget-team
/test/dotnet-nuget.UnitTests @dotnet/nuget-team

# Area-FSharp
/src/Cli/dotnet/commands/dotnet-fsi @dotnet/fsharp
/src/Tests/dotnet-fsi.Tests @dotnet/fsharp
/test/dotnet-fsi.Tests @dotnet/fsharp

# Area-DotNet Test
/src/Cli/dotnet/commands/dotnet-test @dotnet/dotnet-test-templates-admin
/src/Cli/dotnet/commands/dotnet-vstest @dotnet/dotnet-test-templates-admin
/src/Tests/dotnet-test.Tests @dotnet/dotnet-test-templates-admin
/src/Tests/dotnet-vstest.Tests @dotnet/dotnet-test-templates-admin
/test/dotnet-test.Tests @dotnet/dotnet-test-templates-admin
/test/dotnet-vstest.Tests @dotnet/dotnet-test-templates-admin

# Area-Templates
/src/Cli/dotnet/commands/dotnet-new @dotnet/templating-engine-maintainers
/src/Cli/dotnet-new3 @dotnet/templating-engine-maintainers
/src/Cli/Microsoft.TemplateEngine.Cli @dotnet/templating-engine-maintainers
/src/Tests/dotnet-new.Tests @dotnet/templating-engine-maintainers
/src/Tests/Microsoft.TemplateEngine.* @dotnet/templating-engine-maintainers
/test/dotnet-new.Tests @dotnet/templating-engine-maintainers
/test/Microsoft.TemplateEngine.* @dotnet/templating-engine-maintainers
/template_feed @dotnet/templating-engine-maintainers

# ILLink and ReadyToRun targets and tasks owned by runtime team
# Area-ILLink Area-ReadyToRun
/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ILLink.targets [email protected] @dotnet/illink-contrib
/src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs @AntonLapounov
/src/Tasks/Microsoft.NET.Build.Tasks/RunReadyToRunCompiler.cs @AntonLapounov
/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs [email protected] @dotnet/illink-contrib
/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs @AntonLapounov
/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToRunILLink.cs [email protected] @dotnet/illink-contrib
/test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs @AntonLapounov
# Publish.targets related to ILLink and ReadyToRun is own by both runtime and SDK team
/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Publish.targets [email protected] @dotnet/illink-contrib @AntonLapounov @dotnet/dotnet-cli
/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.ClickOnce.targets @sujitnayak

# Area-Watch
/src/Assets/TestProjects/Watch*/ @tmat @arkalyanms @dotnet/roslyn-ide
/src/Tests/dotnet-watch.Tests/ @tmat @arkalyanms @dotnet/roslyn-ide
/src/Tests/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/ @dotnet/aspnet-blazor-eng
/test/dotnet-watch.Tests/ @tmat @arkalyanms @dotnet/roslyn-ide
/test/Microsoft.AspNetCore.Watch.BrowserRefresh.Tests/ @dotnet/aspnet-blazor-eng
/src/BuiltInTools/* @tmat @arkalyanms @dotnet/roslyn-ide
/src/BuiltInTools/BrowserRefresh @dotnet/aspnet-blazor-eng

# Compatibility tools owned by runtime team
/src/Compatibility/ @dotnet/area-infrastructure-libraries
/src/Tests/Microsoft.DotNet.ApiCompatibility*/ @dotnet/area-infrastructure-libraries
/src/Tests/Microsoft.DotNet.ApiCompat*/ @dotnet/area-infrastructure-libraries
/src/Tests/Microsoft.DotNet.PackageValidation*/ @dotnet/area-infrastructure-libraries
/test/Microsoft.DotNet.ApiCompatibility*/ @dotnet/area-infrastructure-libraries
/test/Microsoft.DotNet.ApiCompat*/ @dotnet/area-infrastructure-libraries
/test/Microsoft.DotNet.PackageValidation*/ @dotnet/area-infrastructure-libraries

# Area-GenAPI
/src/Compatibility/GenAPI/ @dotnet/area-infrastructure-libraries @andriipatsula
/src/Compatibility/Microsoft.DotNet.ApiSymbolExtensions/ @dotnet/area-infrastructure-libraries @andriipatsula
/src/Tests/Microsoft.DotNet.GenAPI/ @dotnet/area-infrastructure-libraries @andriipatsula
/src/Tests/Microsoft.DotNet.ApiSymbolExtensions.Tests/
/test/Microsoft.DotNet.GenAPI/ @dotnet/area-infrastructure-libraries @andriipatsula
/test/Microsoft.DotNet.ApiSymbolExtensions.Tests/

# Area: dotnet containers
/src/Cli/Containers @dotnet/sdk-container-builds-maintainers
/src/Tests/containerize.UnitTests @dotnet/sdk-container-builds-maintainers
/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests @dotnet/sdk-container-builds-maintainers
/src/Tests/Microsoft.NET.Build.Containers.UnitTests @dotnet/sdk-container-builds-maintainers
/test/containerize.UnitTests @dotnet/sdk-container-builds-maintainers
/test/Microsoft.NET.Build.Containers.IntegrationTests @dotnet/sdk-container-builds-maintainers
/test/Microsoft.NET.Build.Containers.UnitTests @dotnet/sdk-container-builds-maintainers
8 changes: 4 additions & 4 deletions TemplateEngine.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
"src\\Microsoft.Win32.Msi\\Microsoft.Win32.Msi.csproj",
"src\\Resolvers\\Microsoft.DotNet.NativeWrapper\\Microsoft.DotNet.NativeWrapper.csproj",
"src\\Resolvers\\Microsoft.DotNet.SdkResolver\\Microsoft.DotNet.SdkResolver.csproj",
"src\\Tests\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj",
"src\\Tests\\Microsoft.TemplateEngine.Cli.UnitTests\\Microsoft.TemplateEngine.Cli.UnitTests.csproj",
"src\\Tests\\dotnet-new.Tests\\dotnet-new.IntegrationTests.csproj",
"src\\Tests\\dotnet.Tests\\dotnet.Tests.csproj",
"test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj",
"test\\Microsoft.TemplateEngine.Cli.UnitTests\\Microsoft.TemplateEngine.Cli.UnitTests.csproj",
"test\\dotnet-new.Tests\\dotnet-new.IntegrationTests.csproj",
"test\\dotnet.Tests\\dotnet.Tests.csproj",
"template_feed\\Microsoft.DotNet.Common.ItemTemplates\\Microsoft.DotNet.Common.ItemTemplates.csproj",
"template_feed\\Microsoft.DotNet.Common.ProjectTemplates.9.0\\Microsoft.DotNet.Common.ProjectTemplates.9.0.csproj"
]
Expand Down
8 changes: 4 additions & 4 deletions containers.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
"src\\Containers\\Microsoft.NET.Build.Containers\\Microsoft.NET.Build.Containers.csproj",
"src\\Containers\\containerize\\containerize.csproj",
"src\\Containers\\packaging\\package.csproj",
"src\\Tests\\Microsoft.NET.Build.Containers.IntegrationTests\\Microsoft.NET.Build.Containers.IntegrationTests.csproj",
"src\\Tests\\Microsoft.NET.Build.Containers.UnitTests\\Microsoft.NET.Build.Containers.UnitTests.csproj",
"src\\Tests\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj",
"src\\Tests\\containerize.UnitTests\\containerize.UnitTests.csproj"
"test\\Microsoft.NET.Build.Containers.IntegrationTests\\Microsoft.NET.Build.Containers.IntegrationTests.csproj",
"test\\Microsoft.NET.Build.Containers.UnitTests\\Microsoft.NET.Build.Containers.UnitTests.csproj",
"test\\Microsoft.NET.TestFramework\\Microsoft.NET.TestFramework.csproj",
"test\\containerize.UnitTests\\containerize.UnitTests.csproj"
]
}
}
2 changes: 1 addition & 1 deletion documentation/project-docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Run "dotnet --debug <command>" which will launch dotnet and pause waiting for us
```shell
build.cmd # to have a full build first
.\artifacts\sdk-build-env.bat
cd src\Tests\YOURTEST.Tests # cd to the test folder that contains the test csproj file
cd test\YOURTEST.Tests # cd to the test folder that contains the test csproj file
dotnet test --filter "FullyQualifiedName~TESTNAME" # run individual test
```

Expand Down
6 changes: 3 additions & 3 deletions documentation/project-docs/repro-helix-failure.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ REM use build env to have stage 0 dotnet on the PATH
.\artifacts\sdk-build-env.bat
REM run the special test target CreateLocalHelixTestLayout. To have the test layout created on disk.
dotnet msbuild /restore /t:CreateLocalHelixTestLayout .\src\Tests\UnitTests.proj /p:creator=dotnetsdkdev /p:_CustomHelixTargetQueue=Windows.Server.Amd64.VS2019.Pre.Open /bl
dotnet msbuild /restore /t:CreateLocalHelixTestLayout .\test\UnitTests.proj /p:creator=dotnetsdkdev /p:_CustomHelixTargetQueue=Windows.Server.Amd64.VS2019.Pre.Open /bl
```

Copy the result of `artifacts\bin\localHelixTestLayout` to another directory or VM. For example to `C:\helix\localHelixTestLayout`. See "Folders under localHelixTestLayout" for the content. This is _correlation_ payload in helix term.

Publish the test project you want to repro. For example Microsoft.NET.Build.Tests.

```cmd
dotnet publish src\Tests\Microsoft.NET.Build.Tests\
dotnet publish test\Microsoft.NET.Build.Tests\
```

The output is in `artifacts\bin\Tests\Microsoft.NET.Build.Tests\Debug\publish`. Copy this folder to another directory or VM. For example `C:\helix\payload-dir`. This is the "workitem payload" in helix term.
Expand Down Expand Up @@ -64,4 +64,4 @@ Due to Helix long path problem. The folders under localHelixTestLayout all have

- New test environment variable introduced has not been reflected in RunTestsOnHelix.cmd.

- To test out changes to the Helix tasks, you can run the unit test project directly: `dotnet -t:Test .\src\Tests\UnitTests.proj /p:_CustomHelixTargetQueue=foo /bl` It won't be able to push the files into helix but it will let you view what helix work items are getting created.
- To test out changes to the Helix tasks, you can run the unit test project directly: `dotnet -t:Test .\test\UnitTests.proj /p:_CustomHelixTargetQueue=foo /bl` It won't be able to push the files into helix but it will let you view what helix work items are getting created.
18 changes: 9 additions & 9 deletions eng/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
-ci
-restore
$(_Test)
-projects $(Build.SourcesDirectory)\src\Tests\UnitTests.proj
-projects $(Build.SourcesDirectory)\test\UnitTests.proj
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
/p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
$(_InternalRuntimeDownloadArgs)
Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:
-ci
-restore
-test
-projects $(Build.SourcesDirectory)\src\Tests\UnitTests.proj
-projects $(Build.SourcesDirectory)\test\UnitTests.proj
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
/p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
$(_InternalRuntimeDownloadArgs)
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
-ci
-restore
-test
-projects $(Build.SourcesDirectory)/src/Tests/UnitTests.proj
-projects $(Build.SourcesDirectory)/test/UnitTests.proj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TestInHelix.binlog
/p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
$(_InternalRuntimeDownloadArgs)
Expand Down Expand Up @@ -268,7 +268,7 @@ jobs:
-restore
-test
-prepareMachine
-projects $(Build.SourcesDirectory)/src/Tests/UnitTests.proj
-projects $(Build.SourcesDirectory)/test/UnitTests.proj
-configuration $(_BuildConfig)
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TestInHelix.binlog
/p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
Expand Down Expand Up @@ -302,7 +302,7 @@ jobs:
--ci
--restore
--test
--projects $(Build.SourcesDirectory)/src/Tests/UnitTests.proj
--projects $(Build.SourcesDirectory)/test/UnitTests.proj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TestInHelix.binlog
/p:_CustomHelixTargetQueue=${{ parameters.helixTargetQueue }}
$(_InternalRuntimeDownloadArgs)
Expand Down Expand Up @@ -396,7 +396,7 @@ jobs:
-ci
-restore
$(_Test)
-projects $(Build.SourcesDirectory)\src\Tests\Microsoft.TemplateEngine.Cli.UnitTests\Microsoft.TemplateEngine.Cli.UnitTests.csproj
-projects $(Build.SourcesDirectory)\test\Microsoft.TemplateEngine.Cli.UnitTests\Microsoft.TemplateEngine.Cli.UnitTests.csproj
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\TemplateEngine.Cli.UnitTests.binlog
$(_InternalRuntimeDownloadArgs)
displayName: Run TemplateEngine Cli Unit Tests
Expand All @@ -406,7 +406,7 @@ jobs:
-ci
-restore
$(_Test)
-projects $(Build.SourcesDirectory)\src\Tests\dotnet-new.Tests\dotnet-new.IntegrationTests.csproj
-projects $(Build.SourcesDirectory)\test\dotnet-new.Tests\dotnet-new.IntegrationTests.csproj
/bl:$(Build.SourcesDirectory)\artifacts\log\$(_BuildConfig)\dotnet-new.IntegrationTests.binlog
$(_InternalRuntimeDownloadArgs)
displayName: Run dotnet new Integration Tests
Expand All @@ -430,7 +430,7 @@ jobs:
-ci
-restore
-test
-projects $(Build.SourcesDirectory)/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj
-projects $(Build.SourcesDirectory)/test/Microsoft.TemplateEngine.Cli.UnitTests/Microsoft.TemplateEngine.Cli.UnitTests.csproj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/TemplateEngine.Cli.UnitTests.binlog
$(_InternalRuntimeDownloadArgs)
displayName: Run TemplateEngine Cli Unit Tests
Expand All @@ -440,7 +440,7 @@ jobs:
-ci
-restore
-test
-projects $(Build.SourcesDirectory)/src/Tests/dotnet-new.Tests/dotnet-new.IntegrationTests.csproj
-projects $(Build.SourcesDirectory)/test/dotnet-new.Tests/dotnet-new.IntegrationTests.csproj
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/dotnet-new.IntegrationTests.binlog
$(_InternalRuntimeDownloadArgs)
displayName: Run dotnet new Integration Tests
Expand Down
Loading

0 comments on commit 91da06e

Please sign in to comment.