1
0
mirror of https://github.com/bitwarden/server synced 2025-12-16 08:13:33 +00:00

Get database tests to be individually ran

This commit is contained in:
Justin Baur
2025-11-19 11:27:28 -05:00
parent 6b5f7d297f
commit cf0acd0f17

View File

@@ -68,7 +68,9 @@ public class DatabaseDataAttribute : DataAttribute
if (!database.Enabled) if (!database.Enabled)
{ {
var theory = new TheoryDataRow() // Use the database type as an argument since it is used to build a unique ID and if we have multiple with no
// data then the tests overwrite each other
var theory = new TheoryDataRow(database.Type, database.ConnectionString)
.WithSkip("Not-Enabled") .WithSkip("Not-Enabled")
.WithTrait("Database", database.Type.ToString()); .WithTrait("Database", database.Type.ToString());
theory.Label = database.Type.ToString(); theory.Label = database.Type.ToString();
@@ -103,7 +105,9 @@ public class DatabaseDataAttribute : DataAttribute
foreach (var unconfiguredDatabase in unconfiguredDatabases) foreach (var unconfiguredDatabase in unconfiguredDatabases)
{ {
var theory = new TheoryDataRow() // Use the database type as an argument since it is used to build a unique ID and if we have multiple with no
// data then the tests overwrite each other
var theory = new TheoryDataRow(unconfiguredDatabase)
.WithSkip("Unconfigured") .WithSkip("Unconfigured")
.WithTrait("Database", unconfiguredDatabase.ToString()); .WithTrait("Database", unconfiguredDatabase.ToString());
theory.Label = unconfiguredDatabase.ToString(); theory.Label = unconfiguredDatabase.ToString();
@@ -184,7 +188,7 @@ public class DatabaseDataAttribute : DataAttribute
public override bool SupportsDiscoveryEnumeration() public override bool SupportsDiscoveryEnumeration()
{ {
return false; return true;
} }
private class ServiceBasedTheoryDataRow : TheoryDataRowBase private class ServiceBasedTheoryDataRow : TheoryDataRowBase