Skip to content

Commit c9499e1

Browse files
authored
Run helix tests on master (#6728)
1 parent 2345c83 commit c9499e1

File tree

51 files changed

+424
-50
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+424
-50
lines changed

.azure/pipelines/helix-test.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Don't run CI for this config yet. We're not ready to move official builds on to Azure Pipelines
2+
trigger: none
3+
4+
# Run PR validation on all branches
5+
pr:
6+
branches:
7+
include:
8+
- '*'
9+
10+
jobs:
11+
- job: Helix
12+
timeoutInMinutes: 240
13+
pool:
14+
name: Hosted VS2017
15+
vmImage: vs2017-win2016
16+
steps:
17+
- checkout: self
18+
clean: true
19+
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
20+
displayName: Run build.cmd helix target
21+
- task: PublishBuildArtifacts@1
22+
displayName: Publish Logs to VSTS
23+
inputs:
24+
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log'
25+
PublishLocation: Container
26+
ArtifactName: $(Agent.Os)_$(Agent.JobName)
27+
continueOnError: true
28+
condition: always()

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project>
22
<Import Project="version.props" />
33

44
<PropertyGroup>

Directory.Build.targets

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@
6060
<IsPackable Condition="'$(IsPackable)' == '' ">false</IsPackable>
6161

6262
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
63+
64+
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
6365
</PropertyGroup>
6466

6567
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
@@ -68,4 +70,96 @@
6870
<Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
6971
<Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
7072
<Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
73+
74+
<!-- Move to CSharp.Common.props -->
75+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND '$(IsHelixJob)' == 'true' ">
76+
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
77+
</ItemGroup>
78+
79+
<!-- Prepares the test projects for helix by including xunit and publishing -->
80+
<Target Name="PrepareHelixPayload" Returns="@(HelixDirectory)">
81+
<ItemGroup>
82+
<_TargetFrameworks Remove="@(_TargetFrameworks)" />
83+
<_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" />
84+
</ItemGroup>
85+
86+
<MSBuild Projects="$(MSBuildProjectFullPath)"
87+
Targets="_PrepareHelixPayloadInner"
88+
Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))">
89+
<Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" />
90+
</MSBuild>
91+
</Target>
92+
93+
<Target Name="_PrepareHelixPayloadInner"
94+
DependsOnTargets="Publish"
95+
Condition="'$(BuildHelixPayload)' == 'true'"
96+
Returns="@(HelixDirectory)">
97+
98+
<ItemGroup>
99+
<HelixDirectory Include="$(MSBuildProjectFullPath)" />
100+
</ItemGroup>
101+
</Target>
102+
103+
<!-- Build the actual helix work items to send to helix queues -->
104+
<Target Name="CreateHelixPayload" Returns="@(HelixPayload)">
105+
<ItemGroup>
106+
<_TargetFrameworks Remove="@(_TargetFrameworks)" />
107+
<_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" />
108+
</ItemGroup>
109+
110+
<MSBuild Projects="$(MSBuildProjectFullPath)"
111+
Targets="_CreateHelixPayloadInner"
112+
Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))">
113+
<Output TaskParameter="TargetOutputs" ItemName="HelixPayload" />
114+
</MSBuild>
115+
</Target>
116+
117+
<Target Name="CollectXunitConsoleRunner" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
118+
<PropertyGroup>
119+
<XunitConsoleRunnerDir>$([System.IO.Path]::GetDirectoryName($(XunitConsole472Path)))</XunitConsoleRunnerDir>
120+
</PropertyGroup>
121+
122+
<ItemGroup>
123+
<XunitConsoleRunnerFiles Include="$(XunitConsoleRunnerDir)/**/*" />
124+
</ItemGroup>
125+
126+
<Copy SourceFiles="@(XunitConsoleRunnerFiles)" DestinationFolder="$(PublishDir)" />
127+
</Target>
128+
129+
<Target Name="_CreateHelixPayloadInner"
130+
DependsOnTargets="CollectXunitConsoleRunner"
131+
Condition="($(IsWindowsHelixQueue) OR '$(TargetFrameworkIdentifier)' != '.NETFramework')"
132+
Returns="@(HelixPayload)">
133+
134+
<ConvertToAbsolutePath Paths="$(PublishDir)">
135+
<Output TaskParameter="AbsolutePaths" PropertyName="PublishAbsoluteDir" />
136+
</ConvertToAbsolutePath>
137+
138+
<!-- Windows NetCore -->
139+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND $(IsWindowsHelixQueue)" >
140+
<_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.cmd" />
141+
</ItemGroup>
142+
143+
<!-- Windows NetFramework -->
144+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND $(IsWindowsHelixQueue)" >
145+
<_CopyItems Include="$(MSBuildThisFileDirectory)test\xunit\runtests.cmd" />
146+
</ItemGroup>
147+
148+
<!-- NonWindows -->
149+
<ItemGroup Condition="!$(IsWindowsHelixQueue)" >
150+
<_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.sh" />
151+
</ItemGroup>
152+
153+
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(PublishAbsoluteDir)" />
154+
155+
<ItemGroup>
156+
<HelixPayload Include="$(PublishAbsoluteDir)">
157+
<TestAssembly>$(TargetFileName)</TestAssembly>
158+
<TestName>$(MSBuildProjectName)-$(TargetFramework)</TestName>
159+
<Command Condition="$(IsWindowsHelixQueue)">runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command>
160+
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command>
161+
<TestTimeout>00:30:00</TestTimeout>
162+
</HelixPayload>
163+
</ItemGroup>
164+
</Target>
71165
</Project>

NuGet.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
The only allowed feed here is myget.org/aspnet-tools which is required to work around
88
https://github.com/Microsoft/msbuild/issues/2914
99
-->
10+
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
1011
<add key="myget.org aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
1112
</packageSources>
1213
</configuration>

build/repo.targets

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,30 @@
111111
Properties="$(BuildProperties);__DummyTarget=GenerateBuildAssetManifest" />
112112
</Target>
113113

114+
<!-- will move into korebuild -->
115+
<Target Name="HelixPublish" DependsOnTargets="Restore">
116+
<ItemGroup>
117+
<CsProjects Include="@(ProjectToBuild)" Condition="'%(Extension)' == '.csproj'" />
118+
</ItemGroup>
119+
<MSBuild Projects="@(CsProjects)"
120+
Targets="PrepareHelixPayload"
121+
BuildInParallel="false">
122+
<Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" />
123+
</MSBuild>
124+
125+
<ItemGroup>
126+
<HelixTestProject Include="@(HelixDirectory)" />
127+
</ItemGroup>
128+
</Target>
129+
130+
<Target Name="Helix" DependsOnTargets="HelixPublish">
131+
<PropertyGroup>
132+
<HelixTestProjects>@(HelixTestProject)</HelixTestProjects>
133+
</PropertyGroup>
134+
<MSBuild Projects="$(MSBuildThisFileDirectory)..\test\helix.proj"
135+
Targets="Test"
136+
Properties="ProjectsToTest=$(HelixTestProjects)"
137+
ContinueOnError="ErrorAndStop"
138+
BuildInParallel="false" />
139+
</Target>
114140
</Project>

eng/targets/CSharp.Common.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework>
66
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
77
</PropertyGroup>
8-
8+
99
<Import Project="Packaging.targets" />
1010
<Import Project="ResolveReferences.targets" />
1111
</Project>

src/Azure/AzureAD/test/FunctionalTests/Microsoft.AspNetCore.Authentication.AzureAD.FunctionalTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
6+
<BuildHelixPayload>false</BuildHelixPayload>
57
</PropertyGroup>
68

79
<ItemGroup>

src/Components/Blazor/Build/test/Microsoft.AspNetCore.Blazor.Build.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
<ItemGroup>
3232
<ProjectReference Include="..\..\testassets\StandaloneApp\StandaloneApp.csproj" />
33+
<Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
3334

3435
<Compile Include="$(ComponentsSharedSourceRoot)test\**\*.cs" LinkBase="Helpers" />
3536
</ItemGroup>

src/Components/Blazor/Build/test/RuntimeDependenciesResolverTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.IO;
77
using System.Linq;
8+
using Microsoft.AspNetCore.Testing.xunit;
89
using Xunit;
910
using Xunit.Abstractions;
1011

@@ -19,7 +20,8 @@ public RuntimeDependenciesResolverTest(ITestOutputHelper output)
1920
_output = output;
2021
}
2122

22-
[Fact]
23+
[ConditionalFact]
24+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6549
2325
public void FindsReferenceAssemblyGraph_ForStandaloneApp()
2426
{
2527
// Arrange

src/Components/Server/test/Microsoft.AspNetCore.Components.Server.Tests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<!-- https://github.com/aspnet/AspNetCore/issues/7202 -->
6+
<BuildHelixPayload>false</BuildHelixPayload>
57
</PropertyGroup>
68

79
<ItemGroup>

src/Components/test/E2ETest/Microsoft.AspNetCore.Components.E2ETests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
Temporarily disabled until this runs on macOS
1111
-->
1212
<SkipTests Condition="'$(BlazorAllTests)' != 'true'">true</SkipTests>
13+
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
14+
<BuildHelixPayload>false</BuildHelixPayload>
1315
</PropertyGroup>
1416

1517
<ItemGroup>

src/DataProtection/Extensions/test/DataProtectionProviderTests.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,9 @@ public void System_UsesProvidedDirectory_WithConfigurationCallback()
113113
});
114114
}
115115

116-
[ConditionalFact]
116+
[ConditionalFact]
117117
[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)]
118+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720
118119
public void System_UsesProvidedDirectoryAndCertificate()
119120
{
120121
var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx");
@@ -164,6 +165,7 @@ public void System_UsesProvidedDirectoryAndCertificate()
164165

165166
[ConditionalFact]
166167
[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)]
168+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720
167169
public void System_UsesProvidedCertificateNotFromStore()
168170
{
169171
using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))

src/DataProtection/Extensions/test/Microsoft.AspNetCore.DataProtection.Extensions.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<ItemGroup>
88
<Compile Include="..\..\shared\test\*.cs" />
99
<Content Include="TestFiles\**\*" CopyToOutputDirectory="PreserveNewest" />
10+
<Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
1011
</ItemGroup>
1112

1213
<ItemGroup>

src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
6+
<BuildHelixPayload>false</BuildHelixPayload>
57
</PropertyGroup>
68

79
<ItemGroup>

src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
</PropertyGroup>
66

77
<ItemGroup>
8+
<Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
89
<Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
910
</ItemGroup>
1011

src/Hosting/Hosting/test/WebHostTests.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using Microsoft.AspNetCore.Hosting.Server.Features;
1515
using Microsoft.AspNetCore.Http;
1616
using Microsoft.AspNetCore.Http.Features;
17+
using Microsoft.AspNetCore.Testing.xunit;
1718
using Microsoft.Extensions.Configuration;
1819
using Microsoft.Extensions.DependencyInjection;
1920
using Microsoft.Extensions.Hosting;
@@ -194,7 +195,8 @@ public async Task WebHostShutsDownWhenTokenTriggers()
194195
}
195196
}
196197

197-
[Fact]
198+
[ConditionalFact]
199+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
198200
public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire()
199201
{
200202
var data = new Dictionary<string, string>
@@ -233,7 +235,8 @@ public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire()
233235
}
234236
}
235237

236-
[Fact]
238+
[ConditionalFact]
239+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
237240
public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided()
238241
{
239242
var data = new Dictionary<string, string>
@@ -308,7 +311,8 @@ public async Task WebHostStopAsyncCanBeCancelledEarly()
308311
}
309312
}
310313

311-
[Fact]
314+
[ConditionalFact]
315+
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
312316
public void WebHostApplicationLifetimeEventsOrderedCorrectlyDuringShutdown()
313317
{
314318
using (var host = CreateBuilder()

src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp3.0</TargetFramework>
5+
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
6+
<BuildHelixPayload>false</BuildHelixPayload>
57
</PropertyGroup>
68

79
<ItemGroup>

src/Http/Routing/test/UnitTests/EndpointNameAddressSchemeTest.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -173,17 +173,17 @@ public void AddressScheme_ThrowsExceptionForDuplicateEndpoints()
173173
var ex = Assert.Throws<InvalidOperationException>(() => addressScheme.FindEndpoints("any name"));
174174

175175
// Assert
176-
Assert.Equal(@"The following endpoints with a duplicate endpoint name were found.
177-
178-
Endpoints with endpoint name 'name1':
179-
a
180-
b
181-
c
182-
183-
Endpoints with endpoint name 'name2':
184-
e
185-
f
186-
", ex.Message);
176+
Assert.Equal(String.Join(Environment.NewLine, @"The following endpoints with a duplicate endpoint name were found.",
177+
"",
178+
"Endpoints with endpoint name 'name1':",
179+
"a",
180+
"b",
181+
"c",
182+
"",
183+
"Endpoints with endpoint name 'name2':",
184+
"e",
185+
"f",
186+
""), ex.Message);
187187
}
188188

189189
private EndpointNameAddressScheme CreateAddressScheme(params Endpoint[] endpoints)

0 commit comments

Comments
 (0)