未验证 提交 58ff8200 编写于 作者: J Jose Perez Rodriguez 提交者: GitHub

Add Windows CI legs (#497)

* Add Windows CI legs

* Skip Tests that are failing in Windows run

* PR Feedback
上级 989b7878
......@@ -54,6 +54,18 @@ jobs:
name: Build
displayName: Build
condition: succeeded()
- script: powershell -ExecutionPolicy ByPass -NoProfile eng\common\msbuild.ps1 -warnaserror:0 -ci
eng/sendToHelix.proj
/t:Test
/p:TestOS=Windows_NT
/p:Configuration=$(_BuildConfig)
/p:HelixBuild=$(Build.BuildNumber)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
/p:HelixAccessToken=$(HelixApiAccessToken)
displayName: Send to Helix
condition: succeeded()
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
- task: PublishBuildArtifacts@1
displayName: Publish Windows managed assets
inputs:
......@@ -147,6 +159,7 @@ jobs:
- script: ./eng/common/msbuild.sh --warnaserror false --ci
eng/sendToHelix.proj
/t:Test
/p:TestOS=Unix
/p:Configuration=$(_BuildConfig)
/p:HelixBuild=$(Build.BuildNumber)
/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog
......
<Project Sdk="Microsoft.DotNet.Helix.Sdk">
<PropertyGroup>
<HelixSource>pr/dotnet/iot/$(BUILD_SOURCEBRANCH)/</HelixSource>
<TestOS Condition="'$(TestOS)' == ''">$(OS)</TestOS>
<HelixSourcePrefix>pr</HelixSourcePrefix>
<HelixSourcePrefix Condition="'$(HelixAccessToken)' != ''">official</HelixSourcePrefix>
<HelixSource>$(HelixSourcePrefix)/dotnet/iot/$(BUILD_SOURCEBRANCH)/</HelixSource>
<HelixType>test/product/</HelixType>
<HelixBuild>$(BUILD_BUILDNUMBER)</HelixBuild>
<HelixBuild Condition="'$(HelixBuild)' == ''">123460.01</HelixBuild>
<HelixConfiguration>$(Configuration)</HelixConfiguration>
<XUnitArguments>$(XUnitArguments) -nocolor -verbose -serialize -maxthreads 1</XUnitArguments>
<IncludeDotNetCli>true</IncludeDotNetCli>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<DotNetCliVersion>2.2.300</DotNetCliVersion>
<EnableAzurePipelinesReporter Condition="'$(SYSTEM_ACCESSTOKEN)' != ''">true</EnableAzurePipelinesReporter>
<TestRunNamePrefix>$(AGENT_JOBNAME)</TestRunNamePrefix>
......@@ -16,36 +21,53 @@
<FailOnMissionControlTestFailure>true</FailOnMissionControlTestFailure>
</PropertyGroup>
<ItemGroup>
<!-- For now we only have a queue for Linux. Once we have a queue for Windows we will run
those tests too. -->
<PropertyGroup Condition=" '$(HelixAccessToken)' == '' ">
<Creator>$(BUILD_SOURCEVERSIONAUTHOR)</Creator>
<Creator Condition=" '$(Creator)' == ''">dotnet-bot</Creator>
</PropertyGroup>
<ItemGroup Condition="'$(HelixTargetQueue)' != ''">
<HelixTargetQueue Include="$(HelixTargetQueue)"/>
</ItemGroup>
<!-- Windows-specific settings -->
<ItemGroup Condition="'$(TestOS)' == 'Windows_NT'">
<!-- Xunit project to test -->
<XUnitProject Include="..\src\System.Device.Gpio.Tests\System.Device.Gpio.Tests.csproj">
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeTargetFramework>netcoreapp2.0</RuntimeTargetFramework>
<AdditionalProperties>RuntimeIdentifier=linux-arm</AdditionalProperties>
<AdditionalProperties>RuntimeIdentifier=win-arm</AdditionalProperties>
</XUnitProject>
<!-- Target queues -->
<HelixTargetQueue Condition="'$(HelixAccessToken)' != ''" Include="Windows.10.Arm32.IoT"/>
<HelixTargetQueue Condition="'$(HelixAccessToken)' == ''" Include="Windows.10.Arm32.IoT.Open"/>
</ItemGroup>
<ItemGroup Condition=" '$(HelixAccessToken)' != '' And '$(HelixTargetQueue)' == ''">
<HelixTargetQueue Include="Raspbian.9.Arm32.IoT"/>
</ItemGroup>
<PropertyGroup Condition="'$(TestOS)' == 'Windows_NT'">
<DotNetCliRuntime>win-arm</DotNetCliRuntime>
<XUnitArguments>$(XUnitArguments) -notrait "SkipOnTestRun=Windows_NT"</XUnitArguments>
</PropertyGroup>
<ItemGroup Condition="'$(HelixTargetQueue)' != ''">
<HelixTargetQueue Include="$(HelixTargetQueue)"/>
<!-- Linux-specific settings -->
<ItemGroup Condition="'$(TestOS)' == 'Unix'">
<!-- Xunit project to test -->
<XUnitProject Include="..\src\System.Device.Gpio.Tests\System.Device.Gpio.Tests.csproj">
<TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeTargetFramework>netcoreapp2.0</RuntimeTargetFramework>
<AdditionalProperties>RuntimeIdentifier=linux-arm</AdditionalProperties>
</XUnitProject>
<!-- Target queues -->
<HelixTargetQueue Condition="'$(HelixAccessToken)' != ''" Include="Raspbian.9.Arm32.IoT"/>
<HelixTargetQueue Condition="'$(HelixAccessToken)' == ''" Include="Raspbian.9.Arm32.IoT.Open"/>
</ItemGroup>
<PropertyGroup Condition=" '$(HelixAccessToken)' == '' ">
<IsExternal>true</IsExternal>
<Creator>$(BUILD_SOURCEVERSIONAUTHOR)</Creator>
<Creator Condition=" '$(Creator)' == ''">dotnet-bot</Creator>
<PropertyGroup Condition="'$(TestOS)' == 'Unix'">
<XUnitArguments>$(XUnitArguments) -notrait "SkipOnTestRun=Unix"</XUnitArguments>
</PropertyGroup>
<ItemGroup Condition=" '$(HelixAccessToken)' == '' And '$(HelixTargetQueue)' == ''">
<HelixTargetQueue Include="Raspbian.9.Arm32.IoT.open"/>
</ItemGroup>
<!-- Our tests require to run as elevated. -->
<!-- Our Unix tests require to run as elevated. -->
<Target Name="AppendSudoToHelixWorkItems"
Condition="'$(TestOS)' == 'Unix'"
Inputs="%(HelixWorkItem.Identity)%(HelixWorkItem.Command)"
Outputs="unused"
AfterTargets="CreateXUnitWorkItems">
......@@ -56,7 +78,7 @@
<!-- Pre append sudo and the full path to dotnet to the command, along with a dollarsign throwAway
which will remove the initial dotnet from the helix command as it will be interpreted as a
variable -->
<_newCommand>sudo -E $_dotnet $throwAway%(HelixWorkItem.Command) -verbose -serialize -maxthreads 1</_newCommand>
<_newCommand>sudo -E $_dotnet $throwAway%(HelixWorkItem.Command)</_newCommand>
</PropertyGroup>
<ItemGroup>
<HelixWorkItem>
......
......@@ -31,6 +31,7 @@ namespace System.Device.Gpio.Tests
}
[Fact]
[Trait("SkipOnTestRun", "Windows_NT")] // The WindowsDriver is kept as High when disposed.
public void PinValueReturnsToLowAfterDispose()
{
using (GpioController controller = new GpioController(GetTestNumberingScheme(), GetTestDriver()))
......@@ -116,6 +117,7 @@ namespace System.Device.Gpio.Tests
}
[Fact]
[Trait("SkipOnTestRun", "Windows_NT")] // Currently, the Windows Driver is defaulting to InputPullDown instead of Input when Closed/Opened.
public void OpenPinDefaultsModeToInput()
{
using (GpioController controller = new GpioController(GetTestNumberingScheme(), GetTestDriver()))
......@@ -272,6 +274,7 @@ namespace System.Device.Gpio.Tests
}
[Fact]
[Trait("SkipOnTestRun", "Windows_NT")] // The windows driver is returning none as the event type.
public void WaitForEventCancelAfter10MilliSecondsTest()
{
using (GpioController controller = new GpioController(GetTestNumberingScheme(), GetTestDriver()))
......
......@@ -23,7 +23,7 @@
</ItemGroup>
<!-- Make sure that we copy the native shim to the publish directory before sending the tests to Helix -->
<Target Name="AddNativeShimToCopyToPublishDirectory" BeforeTargets="_ComputeResolvedFilesToPublishTypes">
<Target Name="AddNativeShimToCopyToPublishDirectory" Condition="'$(TargetsLinux)' == 'true'" BeforeTargets="_ComputeResolvedFilesToPublishTypes">
<ItemGroup>
<_nativeShimFiles Include="$(ArtifactsBinDir)Native\$(Configuration)\*.*" />
......
......@@ -6,7 +6,7 @@ using System.Device.Gpio.Drivers;
namespace System.Device.Gpio.Tests
{
class WindowsDriverTests : GpioControllerTestBase
public class WindowsDriverTests : GpioControllerTestBase
{
protected override GpioDriver GetTestDriver() => new Windows10Driver();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册