Skip to content

Commit

Permalink
Fix dotnet_root passing, and unignore tests (#5113)
Browse files Browse the repository at this point in the history
  • Loading branch information
nohwnd authored Feb 24, 2025
1 parent 7d906dd commit 26f91c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ public class DeploymentTests : CLITestBase
public void ValidateTestSourceDependencyDeployment_net462()
=> ValidateTestSourceDependencyDeployment("net462");

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled as it's not working on CIA fatal error occurred. The required library hostfxr.dll could not be found.")]
private void ValidateTestSourceDependencyDeployment_netcoreapp31()
public void ValidateTestSourceDependencyDeployment_netcoreapp31()
=> ValidateTestSourceDependencyDeployment("netcoreapp3.1");

private void ValidateTestSourceDependencyDeployment(string targetFramework)
Expand All @@ -49,8 +48,7 @@ public void ValidateTestSourceLocationDeployment(string targetFramework)
public void ValidateDirectoryDeployment_net462()
=> ValidateDirectoryDeployment("net462");

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled as it's not working on CIA fatal error occurred. The required library hostfxr.dll could not be found.")]
private void ValidateDirectoryDeployment_netcoreapp31()
public void ValidateDirectoryDeployment_netcoreapp31()
=> ValidateDirectoryDeployment("netcoreapp3.1");

public void ValidateDirectoryDeployment(string targetFramework)
Expand All @@ -62,8 +60,7 @@ public void ValidateDirectoryDeployment(string targetFramework)
public void ValidateFileDeployment_net462()
=> ValidateFileDeployment("net462");

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled as it's not working on CIA fatal error occurred. The required library hostfxr.dll could not be found.")]
private void ValidateFileDeployment_netcoreapp31()
public void ValidateFileDeployment_netcoreapp31()
=> ValidateFileDeployment("netcoreapp3.1");

public void ValidateFileDeployment(string targetFramework)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ public class SuiteLifeCycleTests : CLITestBase
private const string TestAssetName = "SuiteLifeCycleTestProject";
private static readonly string[] WindowsLineReturn = ["\r\n"];

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled as it's not working on CI. A fatal error occurred. The required library hostfxr.dll could not be found.")]
private void ValidateTestRunLifecycle_net6() => ValidateTestRunLifecycle("net6.0");
public void ValidateTestRunLifecycle_net6() => ValidateTestRunLifecycle("net6.0");

public void ValidateTestRunLifecycle_net462() => ValidateTestRunLifecycle("net462");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ public class TimeoutTests : CLITestBase

public void ValidateTimeoutTests_net462() => ValidateTimeoutTests("net462");

[SuppressMessage("CodeQuality", "IDE0051:Remove unused private members", Justification = "Disabled as it's not working on CIA fatal error occurred. The required library hostfxr.dll could not be found.")]
private void ValidateTimeoutTests_netcoreapp31() => ValidateTimeoutTests("netcoreapp3.1");
public void ValidateTimeoutTests_netcoreapp31() => ValidateTimeoutTests("netcoreapp3.1");

private void ValidateTimeoutTests(string targetFramework)
{
Expand Down
5 changes: 3 additions & 2 deletions test/Utilities/Automation.CLI/CLITestBase.e2e.cs
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,10 @@ private static string FindDotNetRoot()
var currentDirectory = new DirectoryInfo(Directory.GetCurrentDirectory());
do
{
if (currentDirectory.EnumerateDirectories(".dotnet").Any())
string folderName = ".dotnet";
if (currentDirectory.EnumerateDirectories(folderName).Any())
{
return currentDirectory.FullName;
return Path.Combine(currentDirectory.FullName, folderName);
}
}
while ((currentDirectory = currentDirectory.Parent) != null);
Expand Down

0 comments on commit 26f91c4

Please sign in to comment.