Skip to content

Commit b975da2

Browse files
authored
Fix the issue that test doesn't run in some autorest module (#23672)
1 parent 36fc884 commit b975da2

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks/CIFilterTask.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//
1+
//
22
// Copyright (c) Microsoft. All rights reserved.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -364,14 +364,14 @@ private bool ProcessFileChanged(Dictionary<string, string[]> csprojMap)
364364
DateTime endOfRegularExpressionTime = DateTime.Now;
365365

366366
#region Record the CI plan info to CIPlan.json under the artifacts folder
367-
Dictionary<string, HashSet<string>> CIPlan = new Dictionary<string, HashSet<string>>
367+
Dictionary<string, List<string>> CIPlan = new Dictionary<string, List<string>>
368368
{
369-
[BUILD_PHASE] = new HashSet<string>(influencedModuleInfo[BUILD_PHASE]),
370-
[TEST_PHASE] = new HashSet<string>(influencedModuleInfo[TEST_PHASE])
369+
[BUILD_PHASE] = new List<string>(influencedModuleInfo[BUILD_PHASE]),
370+
[TEST_PHASE] = new List<string>(influencedModuleInfo[TEST_PHASE])
371371
};
372372
foreach (var analysisPhase in ANALYSIS_PHASE_LIST)
373373
{
374-
CIPlan.Add(analysisPhase, influencedModuleInfo[analysisPhase]);
374+
CIPlan.Add(analysisPhase, new List<string>(influencedModuleInfo[analysisPhase]));
375375
}
376376
if (!Directory.Exists(config.ArtifactPipelineInfoFolder))
377377
{

tools/BuildScripts/BuildModules.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,14 @@ if ($PSCmdlet.ParameterSetName -eq 'ModifiedBuildSet' -or $PSCmdlet.ParameterSet
103103
}
104104
}
105105
if ($PSCmdlet.ParameterSetName -eq 'PullRequestSet') {
106-
$BuildCsprojList = (($BuildCsprojList -split ';' | ForEach-Object { Resolve-Path $_ }).Path) -join ';'
107-
$TestCsprojList = (($TestCsprojList -split ';' | ForEach-Object { Resolve-Path $_ }).Path) -join ';'
108-
$csprojFiles += Include-CsprojFiles -Path "$RepoRoot/src/" -Include $BuildCsprojList
109-
$csprojFiles += Include-CsprojFiles -Path "$RepoRoot/src/" -Include $TestCsprojList
106+
if ($PSBoundParameters.ContainsKey('BuildCsprojList') -and $BuildCsprojList) {
107+
$BuildCsprojList = (($BuildCsprojList -split ';' | ForEach-Object { Resolve-Path $_ }).Path) -join ';'
108+
$csprojFiles += Include-CsprojFiles -Path "$RepoRoot/src/" -Include $BuildCsprojList
109+
}
110+
if ($PSBoundParameters.ContainsKey('TestCsprojList') -and $TestCsprojList) {
111+
$TestCsprojList = (($TestCsprojList -split ';' | ForEach-Object { Resolve-Path $_ }).Path) -join ';'
112+
$csprojFiles += Include-CsprojFiles -Path "$RepoRoot/src/" -Include $TestCsprojList
113+
}
110114
}
111115
& dotnet --version
112116
& dotnet new sln -n Azure.PowerShell -o $RepoArtifacts --force

0 commit comments

Comments
 (0)