@@ -13,7 +13,6 @@ namespace Microsoft.MSTestV2.CLIAutomation;
13
13
public partial class CLITestBase : TestContainer
14
14
{
15
15
private const string TestAssetsFolder = "TestAssets" ;
16
- private const string ArtifactsFolder = "artifacts" ;
17
16
private const string PackagesFolder = "packages" ;
18
17
private const string EngineeringFolder = "eng" ;
19
18
@@ -40,11 +39,18 @@ protected string GetTestPlatformVersion()
40
39
return testSdkVersion . InnerText ;
41
40
}
42
41
42
+ protected string GetArtifactsFolder ( )
43
+ {
44
+ var assemblyLocation = System . Reflection . Assembly . GetExecutingAssembly ( ) . Location ;
45
+
46
+ return Path . Combine ( assemblyLocation , @"..\..\..\.." ) ;
47
+ }
48
+
43
49
/// <summary>
44
50
/// Gets the path of test assets folder.
45
51
/// </summary>
46
52
/// <returns>Path to testassets folder.</returns>
47
- protected string GetAssetFolderPath ( ) => Path . Combine ( Environment . CurrentDirectory , ArtifactsFolder , TestAssetsFolder ) ;
53
+ protected string GetAssetFolderPath ( ) => Path . Combine ( GetArtifactsFolder ( ) , TestAssetsFolder ) ;
48
54
49
55
/// <summary>
50
56
/// Gets the full path to a test asset.
@@ -69,7 +75,7 @@ protected string GetAssetFullPath(string assetName)
69
75
70
76
protected string GetTestAdapterPath ( )
71
77
{
72
- var testAdapterPath = Path . Combine ( Environment . CurrentDirectory , ArtifactsFolder , TestAssetsFolder ) ;
78
+ var testAdapterPath = Path . Combine ( GetArtifactsFolder ( ) , TestAssetsFolder ) ;
73
79
return testAdapterPath ;
74
80
}
75
81
0 commit comments