Skip to content

Commit ef6a150

Browse files
authored
[Tools] Skip test phase if there is no test project in CI pipeline (#14243)
* Fix the issue that cannot fine valid module for Generated module in CI pipeline * Fix the issue that Target module fails * Add Debug info for test phase * Add Debug info for test phase * Add Debug info for test phase Co-authored-by: wyunchi-ms <[email protected]>
1 parent acdfb15 commit ef6a150

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

build.proj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@
141141
PropertyName="SubTasks" />
142142
</CreateProperty>
143143
<CreateProperty
144-
Value="@(BuildCsprojList->Split(`;`)->Count())">
144+
Value="@(TestCsprojList->Split(`;`)->Count())">
145145
<Output
146146
TaskParameter="Value"
147-
PropertyName="IsBuildListEmpty" />
147+
PropertyName="IsTestListEmpty" />
148148
</CreateProperty>
149149
</Target>
150150

@@ -311,13 +311,13 @@
311311
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(DockerTools)/CleanArtifacts.ps1 -Docker $(DockerRoot) &quot;" />
312312
</Target>
313313

314-
<Target Name="Test">
314+
<Target Name="Test" DependsOnTargets="FilterBuild">
315315
<Message Importance="high" Text="Running check in tests..." />
316316
<MakeDir Directories="$(TestOutputDirectory)" ContinueOnError="false" />
317317

318318
<!-- https://github.com/Microsoft/msbuild/issues/3157#issuecomment-378002971 -->
319319
<!-- https://github.com/xunit/xunit/issues/1154#issuecomment-405366373 -->
320-
<Exec Command="dotnet test $(RepoArtifacts)Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework $(TestFramework) --logger trx --results-directory &quot;$(TestOutputDirectory)&quot;" />
320+
<Exec Command="dotnet test $(RepoArtifacts)Azure.PowerShell.sln --filter &quot;AcceptanceType=CheckIn%26RunType!=DesktopOnly&quot; --configuration $(Configuration) --framework $(TestFramework) --logger trx --results-directory &quot;$(TestOutputDirectory)&quot; --verbosity d" />
321321

322322
<OnError ExecuteTargets="TestFailureErrorMessage" />
323323
</Target>

tools/CreateFilterMappings.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function Add-ProjectDependencies
148148
[string]$SolutionPath
149149
)
150150

151-
$CommonProjectsToIgnore = @("Authenticators", "ScenarioTest.ResourceManager", "TestFx", "Tests" )
151+
$CommonProjectsToIgnore = @("ScenarioTest.ResourceManager", "TestFx", "Tests" )
152152

153153
$ProjectDependencies = @()
154154
$Content = Get-Content -Path $SolutionPath

0 commit comments

Comments
 (0)