Skip to content

Commit

Permalink
Switch to using dotnet test as the test runner
Browse files Browse the repository at this point in the history
* Exclude the SIL.LCModel.Utils.Tests.dll since that is a utility dll
  that has tests in it
  • Loading branch information
jasonleenaylor committed Dec 7, 2024
1 parent df6220a commit 7089a2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/windows@v2
with:
files: '**/TestResults.xml'
files: '**/*TestResults.trx'

- name: Create NuGet packages
shell: cmd
Expand Down
23 changes: 6 additions & 17 deletions build/FLExBridge.proj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
<GitVersionMsBuildTargets>$(RootDir)/packages/GitVersion.MsBuild/build/GitVersion.MsBuild.targets</GitVersionMsBuildTargets>
<SILBuildTasksDLL>$(RootDir)/packages/SIL.BuildTasks/tools/SIL.BuildTasks.dll</SILBuildTasksDLL>
<SILReleaseTasksProps>$(RootDir)/packages/SIL.ReleaseTasks/build/SIL.ReleaseTasks.props</SILReleaseTasksProps>
<NUnitToolsDir>$(RootDir)/packages/NUnit.ConsoleRunner/tools</NUnitToolsDir>
<NUnitConsoleRunner>$(NUnitToolsDir)/nunit3-console.exe</NUnitConsoleRunner>
<BuildDependencyTasksDLL>$(RootDir)/packages/BuildDependencyTasks/BuildDependencyTasks.dll</BuildDependencyTasksDLL>
<RestartBuild Condition="!Exists('$(GitVersionMsBuildProps)') Or !Exists('$(GitVersionMsBuildTargets)') Or !Exists('$(SILBuildTasksDLL)') Or !Exists('$(SILReleaseTasksProps)') Or !Exists('$(NUnitConsoleRunner)') Or !Exists('$(BuildDependencyTasksDLL)')">true</RestartBuild>
<RestartBuild Condition="Exists('$(GitVersionMsBuildProps)') And Exists('$(GitVersionMsBuildTargets)') And Exists('$(SILBuildTasksDLL)') And Exists('$(SILReleaseTasksProps)') And Exists('$(NUnitConsoleRunner)') And Exists('$(BuildDependencyTasksDLL)')">false</RestartBuild>
<IgnoreGitVersionTask Condition="'$(IgnoreGitVersionTask)' == ''">false</IgnoreGitVersionTask>
Expand All @@ -44,9 +41,6 @@
<UsingTask TaskName="Split" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)')"/>
<UsingTask TaskName="SIL.BuildTasks.FileUpdate" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)')"/>
<UsingTask TaskName="MakeWixForDirTree" AssemblyFile="$(SILBuildTasksDLL)" Condition="Exists('$(SILBuildTasksDLL)') And '$(OS)'=='Windows_NT'"/>
<UsingTask TaskName="NUnit3"
AssemblyFile="$(SILBuildTasksDLL)"
Condition="Exists('$(SILBuildTasksDLL)')" />

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

<Target Name="TestOnly">
<ItemGroup>
<TestAssemblies Include="$(RootDir)/output/$(Configuration)/$(TargetFramework)/*Tests.dll" />
<!-- Include test assemblies and exclude unwanted ones -->
<TestAssemblies Include="$(RootDir)/output/$(Configuration)/$(TargetFramework)/*Tests.dll"
Exclude="**/SIL.LCModel.Utils.Tests.dll" />
</ItemGroup>

<NUnit3 Assemblies="@(TestAssemblies)"
ToolPath="$(NUnitToolsDir)"
TestInNewThread="false"
ExcludeCategory="$(ExtraExcludeCategories)"
WorkingDirectory="$(RootDir)/output/$(Configuration)/$(TargetFramework)"
Process="single"
Verbose="true"
UseNUnit3Xml="false"
OutputXmlFile="$(RootDir)/output/$(Configuration)/$(TargetFramework)/TestResults.xml"
TeamCity="$(TeamCity)"/>
<!-- Loop over each TestAssembly and execute dotnet test -->
<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;"
Condition="Exists('%(TestAssemblies.FullPath)')" />
</Target>

<Target Name="Pack" DependsOnTargets="RestorePackages">
Expand Down

0 comments on commit 7089a2f

Please sign in to comment.