Skip to content

Commit 7089a2f

Browse files
Switch to using dotnet test as the test runner
* Exclude the SIL.LCModel.Utils.Tests.dll since that is a utility dll that has tests in it
1 parent df6220a commit 7089a2f

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

.github/workflows/ci-cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
- name: Publish Test Results
8888
uses: EnricoMi/publish-unit-test-result-action/windows@v2
8989
with:
90-
files: '**/TestResults.xml'
90+
files: '**/*TestResults.trx'
9191

9292
- name: Create NuGet packages
9393
shell: cmd

build/FLExBridge.proj

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<GitVersionMsBuildTargets>$(RootDir)/packages/GitVersion.MsBuild/build/GitVersion.MsBuild.targets</GitVersionMsBuildTargets>
1818
<SILBuildTasksDLL>$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll</SILBuildTasksDLL>
1919
<SILReleaseTasksProps>$(RootDir)/packages/SIL.ReleaseTasks/build/SIL.ReleaseTasks.props</SILReleaseTasksProps>
20-
<NUnitToolsDir>$(RootDir)/packages/NUnit.ConsoleRunner/tools</NUnitToolsDir>
21-
<NUnitConsoleRunner>$(NUnitToolsDir)/nunit3-console.exe</NUnitConsoleRunner>
22-
<BuildDependencyTasksDLL>$(RootDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll</BuildDependencyTasksDLL>
2320
<RestartBuild Condition="!Exists('$(GitVersionMsBuildProps)') Or !Exists('$(GitVersionMsBuildTargets)') Or !Exists('$(SILBuildTasksDLL)') Or !Exists('$(SILReleaseTasksProps)') Or !Exists('$(NUnitConsoleRunner)') Or !Exists('$(BuildDependencyTasksDLL)')">true</RestartBuild>
2421
<RestartBuild Condition="Exists('$(GitVersionMsBuildProps)') And Exists('$(GitVersionMsBuildTargets)') And Exists('$(SILBuildTasksDLL)') And Exists('$(SILReleaseTasksProps)') And Exists('$(NUnitConsoleRunner)') And Exists('$(BuildDependencyTasksDLL)')">false</RestartBuild>
2522
<IgnoreGitVersionTask Condition="'$(IgnoreGitVersionTask)' == ''">false</IgnoreGitVersionTask>
@@ -44,9 +41,6 @@
4441
<UsingTask TaskName="Split" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)')"/>
4542
<UsingTask TaskName="SIL.BuildTasks.FileUpdate" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)')"/>
4643
<UsingTask TaskName="MakeWixForDirTree" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)') And '$(OS)'=='Windows_NT'"/>
47-
<UsingTask TaskName="NUnit3"
48-
AssemblyFile="$(SILBuildTasksDLL)"
49-
Condition="Exists('$(SILBuildTasksDLL)')" />
5044

5145
<!-- a few do-nothing targets to get rid of some warnings from GitVersion.MsBuild.targets -->
5246
<Target Name="GetAssemblyVersion"/>
@@ -203,19 +197,14 @@
203197

204198
<Target Name="TestOnly">
205199
<ItemGroup>
206-
<TestAssemblies Include="$(RootDir)/output/$(Configuration)/$(TargetFramework)/*Tests.dll" />
200+
<!-- Include test assemblies and exclude unwanted ones -->
201+
<TestAssemblies Include="$(RootDir)/output/$(Configuration)/$(TargetFramework)/*Tests.dll"
202+
Exclude="**/SIL.LCModel.Utils.Tests.dll" />
207203
</ItemGroup>
208204

209-
<NUnit3 Assemblies="@(TestAssemblies)"
210-
ToolPath="$(NUnitToolsDir)"
211-
TestInNewThread="false"
212-
ExcludeCategory="$(ExtraExcludeCategories)"
213-
WorkingDirectory="$(RootDir)/output/$(Configuration)/$(TargetFramework)"
214-
Process="single"
215-
Verbose="true"
216-
UseNUnit3Xml="false"
217-
OutputXmlFile="$(RootDir)/output/$(Configuration)/$(TargetFramework)/TestResults.xml"
218-
TeamCity="$(TeamCity)"/>
205+
<!-- Loop over each TestAssembly and execute dotnet test -->
206+
<Exec Command="dotnet test --no-build --verbosity detailed --logger &quot;trx;LogFileName=%(TestAssemblies.Filename)TestResults.trx&quot; --filter &quot;TestCategory!=$(ExtraExcludeCategories)&quot; &quot;%(TestAssemblies.FullPath)&quot;"
207+
Condition="Exists('%(TestAssemblies.FullPath)')" />
219208
</Target>
220209

221210
<Target Name="Pack" DependsOnTargets="RestorePackages">

0 commit comments

Comments
 (0)