@@ -49,6 +49,7 @@ public void SetupDefaultBehavior()
4949 this . fixture . Parameters = new Dictionary < string , IConvertible > ( )
5050 {
5151 { nameof ( SysbenchConfiguration . DatabaseSystem ) , "MySQL" } ,
52+ { nameof ( SysbenchConfiguration . Action ) , "PopulateTables" } ,
5253 { nameof ( SysbenchConfiguration . Benchmark ) , "OLTP" } ,
5354 { nameof ( SysbenchConfiguration . DatabaseName ) , "sbtest" } ,
5455 { nameof ( SysbenchConfiguration . PackageName ) , "sysbench" } ,
@@ -77,7 +78,7 @@ public async Task SysbenchConfigurationSkipsSysbenchInitialization()
7778
7879 string [ ] expectedCommands =
7980 {
80- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8 -- password [A-Za-z0-9+/=]+",
81+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 8 -- tableCount 10 --recordCount 1000 --password [A-Za-z0-9+/=]+ --host \" 1.2.3.5 \" ",
8182 } ;
8283
8384 int commandNumber = 0 ;
@@ -122,7 +123,7 @@ public async Task SysbenchConfigurationPreparesDatabase()
122123 string [ ] expectedCommands =
123124 {
124125 $ "python3 { this . mockPackagePath } /configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath { this . mockPackagePath } ",
125- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 10 --recordCount 1000 --threadCount 8 --password [A-Za-z0-9+/=]+",
126+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 8 --tableCount 10 --recordCount 1000 --password [A-Za-z0-9+/=]+",
126127 } ;
127128
128129 int commandNumber = 0 ;
@@ -173,7 +174,7 @@ public async Task SysbenchConfigurationUsesDefinedParametersWhenRunningTheWorklo
173174 string [ ] expectedCommands =
174175 {
175176 $ "python3 { this . mockPackagePath } /configure-workload-generator.py --distro Ubuntu --databaseSystem MySQL --packagePath { this . mockPackagePath } ",
176- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --tableCount 40 --recordCount 1000 --threadCount 16 --password [A-Za-z0-9+/=]+",
177+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark OLTP --threadCount 16 --tableCount 40 --recordCount 1000 --password [A-Za-z0-9+/=]+",
177178 } ;
178179
179180 int commandNumber = 0 ;
@@ -213,7 +214,7 @@ public async Task SysbenchConfigurationUsesDefinedParametersWhenRunningTheWorklo
213214 }
214215
215216 [ Test ]
216- public async Task SysbenchConfigurationSkipsDatabasePopulationWhenInitialized ( )
217+ public void SysbenchConfigurationThrowsErrorWhenDatabasePopulated ( )
217218 {
218219 this . fixture . StateManager . OnGetState ( ) . ReturnsAsync ( JObject . FromObject ( new SysbenchExecutor . SysbenchState ( )
219220 {
@@ -258,7 +259,8 @@ public async Task SysbenchConfigurationSkipsDatabasePopulationWhenInitialized()
258259
259260 using ( TestSysbenchConfiguration SysbenchExecutor = new TestSysbenchConfiguration ( this . fixture . Dependencies , this . fixture . Parameters ) )
260261 {
261- await SysbenchExecutor . ExecuteAsync ( CancellationToken . None ) . ConfigureAwait ( false ) ;
262+ DependencyException error = Assert . ThrowsAsync < DependencyException > ( ( ) => SysbenchExecutor . ExecuteAsync ( CancellationToken . None ) ) ;
263+ Assert . IsTrue ( error . Reason == ErrorReason . NotSupported ) ;
262264 }
263265 }
264266
@@ -274,7 +276,7 @@ public async Task SysbenchConfigurationProperlyExecutesTPCCPreparation()
274276
275277 string [ ] expectedCommands =
276278 {
277- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --tableCount 10 --warehouses 100 --threadCount 8 -- password [A-Za-z0-9+/=]+"
279+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 8 -- tableCount 10 --warehouses 100 --password [A-Za-z0-9+/=]+ --host \" 1.2.3.5 \" "
278280 } ;
279281
280282 int commandNumber = 0 ;
@@ -330,7 +332,7 @@ public async Task SysbenchConfigurationProperlyExecutesTPCCConfigurablePreparati
330332
331333 string [ ] expectedCommands =
332334 {
333- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --tableCount 40 --warehouses 1000 --threadCount 16 -- password [A-Za-z0-9+/=]+"
335+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem MySQL --benchmark TPCC --threadCount 16 -- tableCount 40 --warehouses 1000 --password [A-Za-z0-9+/=]+ --host \" 1.2.3.5 \" "
334336 } ;
335337
336338 int commandNumber = 0 ;
@@ -386,7 +388,7 @@ public async Task SysbenchConfigurationProperlyExecutesPostgreSQLOLTPConfigurabl
386388
387389 string [ ] expectedCommands =
388390 {
389- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --tableCount 40 --recordCount 1000 --threadCount 16 --password [A-Za-z0-9+/=]+"
391+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark OLTP --threadCount 16 --tableCount 40 --recordCount 1000 --password [A-Za-z0-9+/=]+"
390392 } ;
391393
392394 int commandNumber = 0 ;
@@ -444,7 +446,7 @@ public async Task SysbenchConfigurationProperlyExecutesPostgreSQLTPCCConfigurabl
444446
445447 string [ ] expectedCommands =
446448 {
447- $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --tableCount 40 --warehouses 1000 --threadCount 16 -- password [A-Za-z0-9+/=]+"
449+ $ "python3 { this . mockPackagePath } /populate-database.py --dbName sbtest --databaseSystem PostgreSQL --benchmark TPCC --threadCount 16 -- tableCount 40 --warehouses 1000 --password [A-Za-z0-9+/=]+ --host \" 1.2.3.5 \" "
448450 } ;
449451
450452 int commandNumber = 0 ;
0 commit comments