Skip to content

Commit 81f5710

Browse files
authored
Update testfx repo detection mechanism (#1378)
1 parent 511544c commit 81f5710

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

test/E2ETests/Automation.CLI/CLITestBase.common.cs

+9-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ namespace Microsoft.MSTestV2.CLIAutomation;
1313
public partial class CLITestBase : TestContainer
1414
{
1515
private const string TestAssetsFolder = "TestAssets";
16-
private const string ArtifactsFolder = "artifacts";
1716
private const string PackagesFolder = "packages";
1817
private const string EngineeringFolder = "eng";
1918

@@ -40,11 +39,18 @@ protected string GetTestPlatformVersion()
4039
return testSdkVersion.InnerText;
4140
}
4241

42+
protected string GetArtifactsFolder()
43+
{
44+
var assemblyLocation = System.Reflection.Assembly.GetExecutingAssembly().Location;
45+
46+
return Path.Combine(assemblyLocation, @"..\..\..\..");
47+
}
48+
4349
/// <summary>
4450
/// Gets the path of test assets folder.
4551
/// </summary>
4652
/// <returns>Path to testassets folder.</returns>
47-
protected string GetAssetFolderPath() => Path.Combine(Environment.CurrentDirectory, ArtifactsFolder, TestAssetsFolder);
53+
protected string GetAssetFolderPath() => Path.Combine(GetArtifactsFolder(), TestAssetsFolder);
4854

4955
/// <summary>
5056
/// Gets the full path to a test asset.
@@ -69,7 +75,7 @@ protected string GetAssetFullPath(string assetName)
6975

7076
protected string GetTestAdapterPath()
7177
{
72-
var testAdapterPath = Path.Combine(Environment.CurrentDirectory, ArtifactsFolder, TestAssetsFolder);
78+
var testAdapterPath = Path.Combine(GetArtifactsFolder(), TestAssetsFolder);
7379
return testAdapterPath;
7480
}
7581

0 commit comments

Comments
 (0)