Skip to content

[Helix] Enable Hosting/DefautBuilder/ServerComparison.FunctionalTests #8248

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

Closed
wants to merge 3 commits into from

Conversation

HaoK
Copy link
Member

@HaoK HaoK commented Mar 6, 2019

Starting point PR for #8247

@HaoK HaoK changed the title Enable helix for Hosting.FunctionalTests [Helix] Enable Hosting.FunctionalTests Mar 6, 2019
@HaoK
Copy link
Member Author

HaoK commented Mar 6, 2019

Currently results in errror:

Starting test execution, please wait...
[xUnit.net 00:00:00.00] xUnit.net VSTest Adapter v2.4.1 (64-bit .NET Core 3.0.0-preview4-27428-4)
[xUnit.net 00:00:00.54]   Discovering: Microsoft.AspNetCore.Hosting.FunctionalTests
[xUnit.net 00:00:00.60]   Discovered:  Microsoft.AspNetCore.Hosting.FunctionalTests
[xUnit.net 00:00:00.60]   Starting:    Microsoft.AspNetCore.Hosting.FunctionalTests
[xUnit.net 00:00:00.66]     Microsoft.AspNetCore.Hosting.FunctionalTests.ShutdownTests.ShutdownTestWaitForShutdown [SKIP]
[xUnit.net 00:00:00.66]       Test cannot run on this operating system.
[xUnit.net 00:00:00.66]     Microsoft.AspNetCore.Hosting.FunctionalTests.ShutdownTests.ShutdownTestRun [SKIP]
[xUnit.net 00:00:00.66]       Test cannot run on this operating system.
[xUnit.net 00:00:00.84]     Microsoft.AspNetCore.Hosting.FunctionalTests.WebHostBuilderTests.InjectedStartup_DefaultApplicationNameIsEntryAssembly(variant: Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64) [FAIL]
[xUnit.net 00:00:00.85]       System.InvalidOperationException : No process is associated with this object.
[xUnit.net 00:00:00.85]       Stack Trace:
[xUnit.net 00:00:00.85]            at System.Diagnostics.Process.EnsureState(State state)
[xUnit.net 00:00:00.85]            at System.Diagnostics.Process.get_HasExited()
[xUnit.net 00:00:00.85]         /_/src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployer.cs(126,0): at Microsoft.AspNetCore.Server.IntegrationTesting.ApplicationDeployer.ShutDownIfAnyHostProcess(Process hostProcess)
[xUnit.net 00:00:00.85]         /_/src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs(203,0): at Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer.Dispose()
[xUnit.net 00:00:00.85]         /_/src/Hosting/test/FunctionalTests/WebHostBuilderTests.cs(61,0): at Microsoft.AspNetCore.Hosting.FunctionalTests.WebHostBuilderTests.InjectedStartup_DefaultApplicationNameIsEntryAssembly(TestVariant variant)
[xUnit.net 00:00:00.85]         --- End of stack trace from previous location where exception was thrown ---
[xUnit.net 00:00:00.85]       Output:
[xUnit.net 00:00:00.85]         | [0.006s] TestLifetime Information: Starting test InjectedStartup_DefaultApplicationNameIsEntryAssembly-Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64 at 2019-03-06T22:07:49
[xUnit.net 00:00:00.85]         | [0.000s] TestLifetime Information: Starting test InjectedStartup_DefaultApplicationNameIsEntryAssembly at 2019-03-06T22:07:49
[xUnit.net 00:00:00.85]         | [0.004s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Deploying [Variation] :: ServerType=Kestrel, Runtime=CoreClr, Arch=x64, BaseUrlHint=, Publish=False
[xUnit.net 00:00:00.85]         | [0.007s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Executing dotnet C:\dotnetbuild\work\cf986d53-ed2e-474e-a2aa-39f27ba29ced\Work\47e1fb8a-d6b6-432e-b7b6-8d3df46a4a6b\Exec\IStartupInjectionAssemblyName\bin\Release\netcoreapp3.0\IStartupInjectionAssemblyName.dll --urls http://localhost:49839/ --server Microsoft.AspNetCore.Server.Kestrel
[xUnit.net 00:00:00.85]         | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Removing environment variable ASPNETCORE_ENVIRONMENT
[xUnit.net 00:00:00.85]         | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: SET ASPNETCORE_DETAILEDERRORS=true
[xUnit.net 00:00:00.85]         | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: SET ASPNETCORE_CONTENTROOT=C:\dotnetbuild\work\cf986d53-ed2e-474e-a2aa-39f27ba29ced\Work\47e1fb8a-d6b6-432e-b7b6-8d3df46a4a6b\Exec\IStartupInjectionAssemblyName
[xUnit.net 00:00:00.85]         | [0.082s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Error: Error occurred while starting the process. Exception: System.ComponentModel.Win32Exception (267): The directory name is invalid.
[xUnit.net 00:00:00.85]         |                                                                                    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
[xUnit.net 00:00:00.85]         |                                                                                    at System.Diagnostics.Process.Start()
[xUnit.net 00:00:00.85]         |                                                                                    at System.Diagnostics.ProcessLoggingExtensions.StartAndCaptureOutAndErrToLogger(Process process, String prefix, ILogger logger) in /_/src/Hosting/Server.IntegrationTesting/src/Common/ProcessLoggingExtensions.cs:line 30
[xUnit.net 00:00:00.85]         |                                                                                    at Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer.StartSelfHostAsync(Uri hintUrl) in /_/src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs:line 169
[xUnit.net 00:00:00.85]         | [0.084s] TestLifetime Information: Finished test InjectedStartup_DefaultApplicationNameIsEntryAssembly in 0.084323s
[xUnit.net 00:00:00.85]         | [0.105s] TestLifetime Information: Finished test InjectedStartup_DefaultApplicationNameIsEntryAssembly-Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64 in 0.1007563s
[xUnit.net 00:00:00.85]   Finished:    Microsoft.AspNetCore.Hosting.FunctionalTests
Skipped  Microsoft.AspNetCore.Hosting.FunctionalTests.ShutdownTests.ShutdownTestWaitForShutdown
Skipped  Microsoft.AspNetCore.Hosting.FunctionalTests.ShutdownTests.ShutdownTestRun
Failed   Microsoft.AspNetCore.Hosting.FunctionalTests.WebHostBuilderTests.InjectedStartup_DefaultApplicationNameIsEntryAssembly(variant: Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64)
Error Message:
 System.InvalidOperationException : No process is associated with this object.
Stack Trace:
   at System.Diagnostics.Process.EnsureState(State state)
   at System.Diagnostics.Process.get_HasExited()
   at Microsoft.AspNetCore.Server.IntegrationTesting.ApplicationDeployer.ShutDownIfAnyHostProcess(Process hostProcess) in /_/src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployer.cs:line 126
   at Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer.Dispose() in /_/src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs:line 203
   at Microsoft.AspNetCore.Hosting.FunctionalTests.WebHostBuilderTests.InjectedStartup_DefaultApplicationNameIsEntryAssembly(TestVariant variant) in /_/src/Hosting/test/FunctionalTests/WebHostBuilderTests.cs:line 61
--- End of stack trace from previous location where exception was thrown ---
Standard Output Messages:
 | [0.006s] TestLifetime Information: Starting test InjectedStartup_DefaultApplicationNameIsEntryAssembly-Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64 at 2019-03-06T22:07:49
 | [0.000s] TestLifetime Information: Starting test InjectedStartup_DefaultApplicationNameIsEntryAssembly at 2019-03-06T22:07:49
 | [0.004s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Deploying [Variation] :: ServerType=Kestrel, Runtime=CoreClr, Arch=x64, BaseUrlHint=, Publish=False
 | [0.007s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Executing dotnet C:\dotnetbuild\work\cf986d53-ed2e-474e-a2aa-39f27ba29ced\Work\47e1fb8a-d6b6-432e-b7b6-8d3df46a4a6b\Exec\IStartupInjectionAssemblyName\bin\Release\netcoreapp3.0\IStartupInjectionAssemblyName.dll --urls http://localhost:49839/ --server Microsoft.AspNetCore.Server.Kestrel
 | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: Removing environment variable ASPNETCORE_ENVIRONMENT
 | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: SET ASPNETCORE_DETAILEDERRORS=true
 | [0.008s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Information: SET ASPNETCORE_CONTENTROOT=C:\dotnetbuild\work\cf986d53-ed2e-474e-a2aa-39f27ba29ced\Work\47e1fb8a-d6b6-432e-b7b6-8d3df46a4a6b\Exec\IStartupInjectionAssemblyName
 | [0.082s] Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer Error: Error occurred while starting the process. Exception: System.ComponentModel.Win32Exception (267): The directory name is invalid.
 |                                                                                    at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
 |                                                                                    at System.Diagnostics.Process.Start()
 |                                                                                    at System.Diagnostics.ProcessLoggingExtensions.StartAndCaptureOutAndErrToLogger(Process process, String prefix, ILogger logger) in /_/src/Hosting/Server.IntegrationTesting/src/Common/ProcessLoggingExtensions.cs:line 30
 |                                                                                    at Microsoft.AspNetCore.Server.IntegrationTesting.SelfHostDeployer.StartSelfHostAsync(Uri hintUrl) in /_/src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs:line 169
 | [0.084s] TestLifetime Information: Finished test InjectedStartup_DefaultApplicationNameIsEntryAssembly in 0.084323s
 | [0.105s] TestLifetime Information: Finished test InjectedStartup_DefaultApplicationNameIsEntryAssembly-Server: Kestrel, TFM: netcoreapp3.0, Type: Portable, Arch: x64 in 0.1007563s


Results File: C:\dotnetbuild\work\cf986d53-ed2e-474e-a2aa-39f27ba29ced\Work\47e1fb8a-d6b6-432e-b7b6-8d3df46a4a6b\Exec\TestResults\runner_a0007FD_2019-03-06_22_07_49_426.trx

Total tests: 3. Passed: 0. Failed: 1. Skipped: 2.

@@ -28,7 +29,8 @@ public async Task InjectedStartup_DefaultApplicationNameIsEntryAssembly(TestVari
{
var logger = loggerFactory.CreateLogger(nameof(InjectedStartup_DefaultApplicationNameIsEntryAssembly));

var applicationPath = Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets", "IStartupInjectionAssemblyName");
var baseDirectory = SkipOnHelixAttribute.OnHelix() ? AppContext.BaseDirectory : Path.Combine(TestPathUtilities.GetSolutionRootDirectory("Hosting"), "test", "testassets");
Copy link
Member

@Tratcher Tratcher Mar 6, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling the skip attribute as a helper library? 👃

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah need a centralized helper for sure, the universe of these tests that need to do different stuff on helix will drive that, its in a shared source file for now, so it was easiest to just expose it there as a starting point. Note: I'm just opening these PRs as starting points for the feature teams to be investigate. These are 'repro' PRs

</PropertyGroup>

<ItemGroup>
<Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
<HelixContent Include="..\testassets\**\*" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should compile on helix machines. We should instead try to generalize using pre-published assets.
See #7027

@HaoK HaoK changed the title [Helix] Enable Hosting.FunctionalTests [Helix] Enable Hosting/DefautBuilder/ServerComparison.FunctionalTests Mar 8, 2019
@analogrelay
Copy link
Contributor

Looks like an ancient draft. @HaoK I'm going to close this on the assumption it isn't worth keeping around right now. Feel free to re-open if I'm wrong :)

@analogrelay analogrelay closed this Oct 3, 2019
@HaoK HaoK deleted the helix/hosting branch December 5, 2019 16:56
@amcasey amcasey added the area-hosting Includes Hosting label Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-hosting Includes Hosting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants