Skip to content
代码片段 群组 项目
未验证 提交 c9499e14 编辑于 作者: Hao Kung's avatar Hao Kung 提交者: GitHub
浏览文件

Run helix tests on master (#6728)

上级 2345c837
No related branches found
No related tags found
无相关合并请求
显示
205 个添加39 个删除
# Don't run CI for this config yet. We're not ready to move official builds on to Azure Pipelines
trigger: none
# Run PR validation on all branches
pr:
branches:
include:
- '*'
jobs:
- job: Helix
timeoutInMinutes: 240
pool:
name: Hosted VS2017
vmImage: vs2017-win2016
steps:
- checkout: self
clean: true
- script: .\build.cmd -all -ci /t:Helix /p:IsHelixJob=true /bl:$env:BUILD_SOURCESDIRECTORY\artifacts\log\SendToHelix.binlog
displayName: Run build.cmd helix target
- task: PublishBuildArtifacts@1
displayName: Publish Logs to VSTS
inputs:
PathtoPublish: '$(Build.SourcesDirectory)/artifacts/log'
PublishLocation: Container
ArtifactName: $(Agent.Os)_$(Agent.JobName)
continueOnError: true
condition: always()
<Project>
<Project>
<Import Project="version.props" />
<PropertyGroup>
......
......@@ -60,6 +60,8 @@
<IsPackable Condition="'$(IsPackable)' == '' ">false</IsPackable>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
<BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
</PropertyGroup>
<Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
......@@ -68,4 +70,96 @@
<Import Project="eng\targets\FSharp.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.fsproj'" />
<Import Project="eng\targets\Wix.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.wixproj'" />
<Import Project="eng\targets\Npm.Common.targets" Condition="'$(MSBuildProjectExtension)' == '.npmproj'" />
<!-- Move to CSharp.Common.props -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND '$(IsHelixJob)' == 'true' ">
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
</ItemGroup>
<!-- Prepares the test projects for helix by including xunit and publishing -->
<Target Name="PrepareHelixPayload" Returns="@(HelixDirectory)">
<ItemGroup>
<_TargetFrameworks Remove="@(_TargetFrameworks)" />
<_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_PrepareHelixPayloadInner"
Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))">
<Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" />
</MSBuild>
</Target>
<Target Name="_PrepareHelixPayloadInner"
DependsOnTargets="Publish"
Condition="'$(BuildHelixPayload)' == 'true'"
Returns="@(HelixDirectory)">
<ItemGroup>
<HelixDirectory Include="$(MSBuildProjectFullPath)" />
</ItemGroup>
</Target>
<!-- Build the actual helix work items to send to helix queues -->
<Target Name="CreateHelixPayload" Returns="@(HelixPayload)">
<ItemGroup>
<_TargetFrameworks Remove="@(_TargetFrameworks)" />
<_TargetFrameworks Include="$(TargetFrameworks);$(TargetFramework)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_CreateHelixPayloadInner"
Properties="TargetFramework=%(_TargetFrameworks.Identity);IsWindowsHelixQueue=$(HelixTargetQueue.Contains('Windows'))">
<Output TaskParameter="TargetOutputs" ItemName="HelixPayload" />
</MSBuild>
</Target>
<Target Name="CollectXunitConsoleRunner" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<PropertyGroup>
<XunitConsoleRunnerDir>$([System.IO.Path]::GetDirectoryName($(XunitConsole472Path)))</XunitConsoleRunnerDir>
</PropertyGroup>
<ItemGroup>
<XunitConsoleRunnerFiles Include="$(XunitConsoleRunnerDir)/**/*" />
</ItemGroup>
<Copy SourceFiles="@(XunitConsoleRunnerFiles)" DestinationFolder="$(PublishDir)" />
</Target>
<Target Name="_CreateHelixPayloadInner"
DependsOnTargets="CollectXunitConsoleRunner"
Condition="($(IsWindowsHelixQueue) OR '$(TargetFrameworkIdentifier)' != '.NETFramework')"
Returns="@(HelixPayload)">
<ConvertToAbsolutePath Paths="$(PublishDir)">
<Output TaskParameter="AbsolutePaths" PropertyName="PublishAbsoluteDir" />
</ConvertToAbsolutePath>
<!-- Windows NetCore -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETFramework' AND $(IsWindowsHelixQueue)" >
<_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.cmd" />
</ItemGroup>
<!-- Windows NetFramework -->
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' AND $(IsWindowsHelixQueue)" >
<_CopyItems Include="$(MSBuildThisFileDirectory)test\xunit\runtests.cmd" />
</ItemGroup>
<!-- NonWindows -->
<ItemGroup Condition="!$(IsWindowsHelixQueue)" >
<_CopyItems Include="$(MSBuildThisFileDirectory)test\vstest\runtests.sh" />
</ItemGroup>
<Copy SourceFiles="@(_CopyItems)" DestinationFolder="$(PublishAbsoluteDir)" />
<ItemGroup>
<HelixPayload Include="$(PublishAbsoluteDir)">
<TestAssembly>$(TargetFileName)</TestAssembly>
<TestName>$(MSBuildProjectName)-$(TargetFramework)</TestName>
<Command Condition="$(IsWindowsHelixQueue)">runtests.cmd $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command>
<Command Condition="!$(IsWindowsHelixQueue)">./runtests.sh $(TargetFileName) $(NETCoreSdkVersion) $(MicrosoftNETCoreAppPackageVersion)</Command>
<TestTimeout>00:30:00</TestTimeout>
</HelixPayload>
</ItemGroup>
</Target>
</Project>
......@@ -7,6 +7,7 @@
The only allowed feed here is myget.org/aspnet-tools which is required to work around
https://github.com/Microsoft/msbuild/issues/2914
-->
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="myget.org aspnetcore-tools" value="https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json" />
</packageSources>
</configuration>
......@@ -111,4 +111,30 @@
Properties="$(BuildProperties);__DummyTarget=GenerateBuildAssetManifest" />
</Target>
<!-- will move into korebuild -->
<Target Name="HelixPublish" DependsOnTargets="Restore">
<ItemGroup>
<CsProjects Include="@(ProjectToBuild)" Condition="'%(Extension)' == '.csproj'" />
</ItemGroup>
<MSBuild Projects="@(CsProjects)"
Targets="PrepareHelixPayload"
BuildInParallel="false">
<Output TaskParameter="TargetOutputs" ItemName="HelixDirectory" />
</MSBuild>
<ItemGroup>
<HelixTestProject Include="@(HelixDirectory)" />
</ItemGroup>
</Target>
<Target Name="Helix" DependsOnTargets="HelixPublish">
<PropertyGroup>
<HelixTestProjects>@(HelixTestProject)</HelixTestProjects>
</PropertyGroup>
<MSBuild Projects="$(MSBuildThisFileDirectory)..\test\helix.proj"
Targets="Test"
Properties="ProjectsToTest=$(HelixTestProjects)"
ContinueOnError="ErrorAndStop"
BuildInParallel="false" />
</Target>
</Project>
......@@ -5,7 +5,7 @@
<TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework>
<TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
</PropertyGroup>
<Import Project="Packaging.targets" />
<Import Project="ResolveReferences.targets" />
</Project>
......@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
<ItemGroup>
......
......@@ -30,6 +30,7 @@
<ItemGroup>
<ProjectReference Include="..\..\testassets\StandaloneApp\StandaloneApp.csproj" />
<Compile Include="..\..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
<Compile Include="$(ComponentsSharedSourceRoot)test\**\*.cs" LinkBase="Helpers" />
</ItemGroup>
......
......@@ -5,6 +5,7 @@ using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
using Xunit.Abstractions;
......@@ -19,7 +20,8 @@ namespace Microsoft.AspNetCore.Blazor.Build.Test
_output = output;
}
[Fact]
[ConditionalFact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6549
public void FindsReferenceAssemblyGraph_ForStandaloneApp()
{
// Arrange
......
......@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<!-- https://github.com/aspnet/AspNetCore/issues/7202 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
<ItemGroup>
......
......@@ -10,6 +10,8 @@
Temporarily disabled until this runs on macOS
-->
<SkipTests Condition="'$(BlazorAllTests)' != 'true'">true</SkipTests>
<!-- https://github.com/aspnet/AspNetCore/issues/6857 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
<ItemGroup>
......
......@@ -113,8 +113,9 @@ namespace Microsoft.AspNetCore.DataProtection
});
}
[ConditionalFact]
[ConditionalFact]
[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720
public void System_UsesProvidedDirectoryAndCertificate()
{
var filePath = Path.Combine(GetTestFilesPath(), "TestCert.pfx");
......@@ -164,6 +165,7 @@ namespace Microsoft.AspNetCore.DataProtection
[ConditionalFact]
[X509StoreIsAvailable(StoreName.My, StoreLocation.CurrentUser)]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/6720
public void System_UsesProvidedCertificateNotFromStore()
{
using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
......
......@@ -7,6 +7,7 @@
<ItemGroup>
<Compile Include="..\..\shared\test\*.cs" />
<Content Include="TestFiles\**\*" CopyToOutputDirectory="PreserveNewest" />
<Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
</ItemGroup>
<ItemGroup>
......
......@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
<ItemGroup>
......
......@@ -5,6 +5,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\..\..\test\xunit\SkipOnHelixAttribute.cs" />
<Content Include="testroot\**\*" CopyToOutputDirectory="PreserveNewest" CopyToPublishDirectory="PreserveNewest" />
</ItemGroup>
......
......@@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Hosting.Server;
using Microsoft.AspNetCore.Hosting.Server.Features;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
......@@ -194,7 +195,8 @@ namespace Microsoft.AspNetCore.Hosting
}
}
[Fact]
[ConditionalFact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
public async Task WebHostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire()
{
var data = new Dictionary<string, string>
......@@ -233,7 +235,8 @@ namespace Microsoft.AspNetCore.Hosting
}
}
[Fact]
[ConditionalFact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided()
{
var data = new Dictionary<string, string>
......@@ -308,7 +311,8 @@ namespace Microsoft.AspNetCore.Hosting
}
}
[Fact]
[ConditionalFact]
[SkipOnHelix] // https://github.com/aspnet/AspNetCore/issues/7291
public void WebHostApplicationLifetimeEventsOrderedCorrectlyDuringShutdown()
{
using (var host = CreateBuilder()
......
......@@ -2,6 +2,8 @@
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<!-- https://github.com/aspnet/AspNetCore/issues/6549 -->
<BuildHelixPayload>false</BuildHelixPayload>
</PropertyGroup>
<ItemGroup>
......
......@@ -173,17 +173,17 @@ namespace Microsoft.AspNetCore.Routing
var ex = Assert.Throws<InvalidOperationException>(() => addressScheme.FindEndpoints("any name"));
// Assert
Assert.Equal(@"The following endpoints with a duplicate endpoint name were found.
Endpoints with endpoint name 'name1':
a
b
c
Endpoints with endpoint name 'name2':
e
f
", ex.Message);
Assert.Equal(String.Join(Environment.NewLine, @"The following endpoints with a duplicate endpoint name were found.",
"",
"Endpoints with endpoint name 'name1':",
"a",
"b",
"c",
"",
"Endpoints with endpoint name 'name2':",
"e",
"f",
""), ex.Message);
}
private EndpointNameAddressScheme CreateAddressScheme(params Endpoint[] endpoints)
......
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.IO;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Routing.Patterns;
......@@ -33,10 +34,9 @@ namespace Microsoft.AspNetCore.Routing.Internal
graphWriter.Write(endpointsDataSource, writer);
// Assert
Assert.Equal(@"digraph DFA {
0 [label=""/""]
}
", writer.ToString());
Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {",
@"0 [label=""/""]",
"}") + Environment.NewLine, writer.ToString());
}
[Fact]
......@@ -57,10 +57,9 @@ namespace Microsoft.AspNetCore.Routing.Internal
graphWriter.Write(endpointsDataSource, writer);
// Assert
Assert.Equal(@"digraph DFA {
0 [label=""/""]
}
", writer.ToString());
Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {",
@"0 [label=""/""]",
@"}") + Environment.NewLine, writer.ToString());
}
[Fact]
......@@ -82,14 +81,13 @@ namespace Microsoft.AspNetCore.Routing.Internal
// Assert
var sdf = writer.ToString();
Assert.Equal(@"digraph DFA {
0 [label=""/ HTTP: GET""]
1 [label=""/ HTTP: *""]
2 -> 0 [label=""HTTP: GET""]
2 -> 1 [label=""HTTP: *""]
2 [label=""/""]
}
", sdf);
Assert.Equal(String.Join(Environment.NewLine, @"digraph DFA {",
@"0 [label=""/ HTTP: GET""]",
@"1 [label=""/ HTTP: *""]",
@"2 -> 0 [label=""HTTP: GET""]",
@"2 -> 1 [label=""HTTP: *""]",
@"2 [label=""/""]",
@"}") + Environment.NewLine, sdf);
}
}
}
......@@ -167,10 +167,8 @@ namespace Microsoft.AspNetCore.Routing.Matching
// Assert
Assert.Equal(
@"The request matched multiple endpoints. Matches:
test: /test2
test: /test3", ex.Message);
@"The request matched multiple endpoints. Matches: " + Environment.NewLine + Environment.NewLine +
"test: /test2" + Environment.NewLine + "test: /test3", ex.Message);
Assert.Null(context.Endpoint);
}
......@@ -204,4 +202,4 @@ test: /test3", ex.Message);
return new DefaultEndpointSelector();
}
}
}
\ No newline at end of file
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册