@@ -19,18 +19,14 @@ public static class AppConfig
1919 [ "Data:SupportsJson" ] = "false" ,
2020 } ;
2121
22- private static string CodeRootPath = GetCodeRootPath ( ) ;
22+ public static string CertsPath => Path . GetFullPath ( Config . GetValue < string > ( "Data:CertificatesPath" ) ) ;
2323
24- public static string BasePath = Path . Combine ( CodeRootPath , "tests" , "SideBySide" ) ;
25-
26- public static string CertsPath = Path . Combine ( CodeRootPath , ".ci" , "server" , "certs" ) ;
27-
28- public static string TestDataPath = Path . Combine ( CodeRootPath , "tests" , "TestData" ) ;
24+ public static string TestDataPath => Path . GetFullPath ( Config . GetValue < string > ( "Data:TestData" ) ) ;
25+ public static string RemoteTestDataPath => Path . GetFullPath ( Config . GetValue < string > ( "Data:RemoteTestData" ) ) ;
2926
3027 private static int _configFirst ;
3128
3229 private static IConfiguration ConfigBuilder { get ; } = new ConfigurationBuilder ( )
33- . SetBasePath ( BasePath )
3430 . AddInMemoryCollection ( DefaultConfig )
3531 . AddJsonFile ( "config.json" )
3632 . Build ( ) ;
@@ -74,19 +70,6 @@ public static MySqlConnectionStringBuilder CreateSha256ConnectionStringBuilder()
7470 // tests can run much slower in CI environments
7571 public static int TimeoutDelayFactor { get ; } = ( Environment . GetEnvironmentVariable ( "APPVEYOR" ) == "True" || Environment . GetEnvironmentVariable ( "TRAVIS" ) == "true" ) ? 6 : 1 ;
7672
77- private static string GetCodeRootPath ( )
78- {
79- #if NET46
80- var currentAssembly = Assembly . GetExecutingAssembly ( ) ;
81- #else
82- var currentAssembly = typeof ( AppConfig ) . GetTypeInfo ( ) . Assembly ;
83- #endif
84- var directory = new Uri ( currentAssembly . CodeBase ) . LocalPath ;
85- while ( ! string . Equals ( Path . GetFileName ( directory ) , "MySqlConnector" , StringComparison . OrdinalIgnoreCase ) )
86- directory = Path . GetDirectoryName ( directory ) ;
87- return directory ;
88- }
89-
90- private static string ExpandVariables ( string value ) => value ? . Replace ( "%TESTDATA%" , TestDataPath ) ;
73+ private static string ExpandVariables ( string value ) => value ? . Replace ( "%TESTDATA%" , TestDataPath ) . Replace ( "%REMOTETESTDATA%" , RemoteTestDataPath ) ;
9174 }
9275}
0 commit comments