|
15 | 15 |
|
16 | 16 | import unittest |
17 | 17 | from absl import flags |
| 18 | +from absl.testing import parameterized |
18 | 19 | from perfkitbenchmarker import errors |
| 20 | +from perfkitbenchmarker import providers |
19 | 21 | from perfkitbenchmarker import relational_db |
20 | 22 | from perfkitbenchmarker import relational_db_spec |
21 | 23 | from perfkitbenchmarker.providers.gcp import gce_virtual_machine |
@@ -318,6 +320,22 @@ def testReverseOrderedDbReplicaZonesFlag(self): |
318 | 320 | result.vm_groups['servers_replicas'].vm_spec.zone, 'us-central1-d' |
319 | 321 | ) |
320 | 322 |
|
| 323 | + # pyformat: disable |
| 324 | + @parameterized.named_parameters([ |
| 325 | + ('SpannerGoogleSql', 'GCP', 'spanner-googlesql', 'SpannerSpec'), |
| 326 | + ('SpannerPostgres', 'GCP', 'spanner-postgres', 'SpannerSpec'), |
| 327 | + ('AuroraDsql', 'AWS', 'aurora-dsql-postgres', 'AwsAuroraDsqlSpec'), |
| 328 | + ('RdsMysql', 'AWS', 'mysql', 'RelationalDbSpec'), |
| 329 | + ('CloudSqlPostgres', 'GCP', 'postgres', 'RelationalDbSpec'), |
| 330 | + ('AzureFlexibleServer', 'Azure', 'flexible-server-postgres', 'RelationalDbSpec'), |
| 331 | + ('AzureSqlManagedInstance', 'Azure', 'sqlserver', 'RelationalDbSpec'), |
| 332 | + ]) |
| 333 | + # pyformat: enable |
| 334 | + def testGetRelationalDbSpecClass(self, cloud, engine, expected_class_name): |
| 335 | + providers.LoadProvider(cloud, True) |
| 336 | + actual_class = relational_db_spec.GetRelationalDbSpecClass(cloud, engine) |
| 337 | + self.assertEqual(actual_class.__name__, expected_class_name) |
| 338 | + |
321 | 339 |
|
322 | 340 | if __name__ == '__main__': |
323 | 341 | unittest.main() |
0 commit comments