Skip to content

Commit

Permalink
[Settings] Unit Tests Migration Feature Branch Merge (#5754)
Browse files Browse the repository at this point in the history
* added MSTest project

* enabled settings tests run in the build pipeline

* re-added settings test project

* re-added test project and sample test

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* updated settings test output path

* updated output path for release config

* added xunit test project

* removed xunit test project

* fix build

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-ci.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-ci.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml

* Update build-powertoys-steps.yml
  • Loading branch information
Nkateko committed Aug 13, 2020
1 parent d1ee9eb commit ebd1a64
Show file tree
Hide file tree
Showing 29 changed files with 226 additions and 2,219 deletions.
2 changes: 1 addition & 1 deletion .pipelines/ci/templates/build-powertoys-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
steps:
- template: build-powertoys-steps.yml
parameters:
additionalBuildArguments: ${{ parameters.additionalBuildArguments }}
additionalBuildArguments: ${{ parameters.additionalBuildArguments }}
27 changes: 16 additions & 11 deletions .pipelines/ci/templates/build-powertoys-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,34 @@ steps:
maximumCpuCount: true


# directly not doing WinAppDriver testing
# Running VSTest@2 step seperatly for .netframework and .netcore.
# .NetCore assemblies
- task: VSTest@2
displayName: 'Run .Net Core Tests'
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
!**\*PowerToysTests.dll
!**\*TestAdapter.dll
#**\Microsoft.Plugin.Program.UnitTests.dll
#**\Microsoft.Plugin.Uri.UnitTests.dll
#**\Wox.Test.dll
**\*Microsoft.PowerToys.Settings.UI.UnitTests.dll
!**\obj\**
# .NetFramework assemblies
- task: VSTest@2
displayName: 'Run .Net Framework Tests'
inputs:
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
testSelector: 'testAssemblies'
testAssemblyVer2: |
**\ImageResizer.Test.dll
**\KeyboardManagerTest.dll
**\Microsoft.Plugin.Program.UnitTests.dll
**\Microsoft.Plugin.Uri.UnitTests.dll
**\PowerRenameUnitTests.dll
**\UnitTests-CommonLib.dll
**\PreviewPaneUnitTests.dll #this is the markdown tests
**\UnitTests-PreviewHandlerCommon.dll
**\UnitTests-SvgPreviewHandler.dll
**\Wox.Test.dll
**\powerpreviewTest.dll
# Can't get working, says no tests
# #**\Microsoft.PowerToys.Settings.UnitTest.exe
# crashes CI
#**\interop-tests.dll
#**\UnitTests-FancyZones.dll
!**\obj\**
154 changes: 147 additions & 7 deletions PowerToys.sln

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions src/core/Microsoft.PowerToys.Settings.UI.UnitTests/General.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// Copyright (c) Microsoft Corporation
// The Microsoft Corporation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using System.IO;
using System.Text.Json;
using Microsoft.PowerToys.Settings.UI.Lib;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace ViewModelTests
{
[TestClass]
public class SampleTest
{
[TestInitialize]
public void Setup()
{
}

[TestCleanup]
public void CleanUp()
{
}

[TestMethod]
public void SampleTest_For_Settings()
{

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>

<IsPackable>false</IsPackable>

<Platforms>AnyCPU;x64</Platforms>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutputPath>..\..\..\x64\Debug\SettingsTests\</OutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutputPath>..\..\..\x64\Release\SettingsTest\</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.0" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.0" />
<PackageReference Include="coverlet.collector" Version="1.2.0" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Microsoft.PowerToys.Settings.UI.Lib\Microsoft.PowerToys.Settings.UI.Lib.csproj" />
</ItemGroup>

</Project>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

0 comments on commit ebd1a64

Please sign in to comment.