Skip to content

Commit e3d2379

Browse files
committed
more test debuging
1 parent bd1cd4b commit e3d2379

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

src/code/InstallHelper.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public IEnumerable<PSResourceInfo> BeginInstallPackages(
173173
skipDependencyCheck: skipDependencyCheck,
174174
scope: scope ?? ScopeType.CurrentUser);
175175

176+
_cmdletPassedIn.WriteVerbose("Returning from BeginInstallpackages");
176177
return installedPkgs;
177178
}
178179

@@ -341,11 +342,13 @@ private List<PSResourceInfo> ProcessRepositories(
341342

342343
repositoryNamesToSearch.Add(repoName);
343344

345+
_cmdletPassedIn.WriteVerbose("InstallHelper line 345");
344346
List<PSResourceInfo> installedPkgs = InstallPackages(_pkgNamesToInstall.ToArray(), currentRepository, currentServer, currentResponseUtil, scope, skipDependencyCheck, findHelper);
345347
foreach (PSResourceInfo pkg in installedPkgs)
346348
{
347349
_pkgNamesToInstall.RemoveAll(x => x.Equals(pkg.Name, StringComparison.InvariantCultureIgnoreCase));
348350
}
351+
_cmdletPassedIn.WriteVerbose("InstallHelper line 351");
349352

350353
allPkgsInstalled.AddRange(installedPkgs);
351354
}
@@ -359,6 +362,7 @@ private List<PSResourceInfo> ProcessRepositories(
359362
ErrorCategory.InvalidData,
360363
_cmdletPassedIn));
361364
}
365+
_cmdletPassedIn.WriteVerbose("InstallHelper line 365");
362366

363367
return allPkgsInstalled;
364368
}

src/code/SavePSResource.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,16 @@ private void ProcessSaveHelper(string[] pkgNames, string pkgVersion, bool pkgPre
313313
tmpPath: _tmpPath,
314314
pkgsInstalled: new HashSet<string>(StringComparer.InvariantCultureIgnoreCase));
315315

316+
WriteVerbose("Returned from BeginPackages in Save");
317+
316318
if (PassThru)
317319
{
318320
foreach (PSResourceInfo pkg in installedPkgs)
319321
{
322+
if (pkg == null)
323+
{
324+
WriteVerbose("pkg is null");
325+
}
320326
WriteObject(pkg);
321327
}
322328
}

src/code/V3ServerAPICalls.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,11 @@ private Stream InstallVersion(string packageName, string version, out ErrorRecor
754754
_cmdletPassedIn.WriteDebug("In V3ServerAPICalls::InstallVersion()");
755755
if (!NuGetVersion.TryParse(version, out NuGetVersion requiredVersion))
756756
{
757+
_cmdletPassedIn.WriteDebug("InstallVersion - could not parse version");
758+
if (string.IsNullOrEmpty(version))
759+
{
760+
_cmdletPassedIn.WriteDebug("version is null or empty");
761+
}
757762
errRecord = new ErrorRecord(
758763
new ArgumentException($"Version {version} to be installed is not a valid NuGet version."),
759764
"InstallVersionFailure",
@@ -762,6 +767,7 @@ private Stream InstallVersion(string packageName, string version, out ErrorRecor
762767

763768
return null;
764769
}
770+
_cmdletPassedIn.WriteDebug("InstallVersion 765");
765771

766772
var inst = InstallHelper(packageName, requiredVersion, out errRecord);
767773
_cmdletPassedIn.WriteDebug("Returning from V3ServerAPICalls::InstallVersion()");

test/InstallPSResourceTests/InstallPSResourceV3Server.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ Describe 'Test Install-PSResource for V3Server scenarios' -tags 'CI' {
393393
}
394394

395395
It "Install module and its dependencies" {
396-
$res = Install-PSResource 'TestModuleWithDependencyE' -Repository $NuGetGalleryName -TrustRepository -PassThru
396+
$res = Install-PSResource 'TestModuleWithDependencyE' -Repository $NuGetGalleryName -TrustRepository -PassThru -Verbose -Debug
397397
$res.Length | Should -Be 4
398398
}
399399
}

0 commit comments

Comments
 (0)