From 94082eb02ba41d4ba90a33a97596e5d4d2594af1 Mon Sep 17 00:00:00 2001 From: Tim Haasdyk Date: Wed, 18 Dec 2024 16:22:52 +0100 Subject: [PATCH] Put tests that need Db into their own category --- backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs | 1 + backend/Testing/LexCore/CrdtServerCommitTests.cs | 1 + backend/Testing/LexCore/Services/ProjectServiceTest.cs | 1 + backend/Testing/LexCore/Services/UserServiceTest.cs | 1 + backend/Testing/Taskfile.yml | 7 +++++++ 5 files changed, 11 insertions(+) diff --git a/backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs b/backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs index 8369b562b..612278053 100644 --- a/backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs +++ b/backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs @@ -2,6 +2,7 @@ namespace Testing.Fixtures.Tests; +[Trait("Category", "RequiresDb")] public class ServicesFixtureTests { [Fact] diff --git a/backend/Testing/LexCore/CrdtServerCommitTests.cs b/backend/Testing/LexCore/CrdtServerCommitTests.cs index 31ed6c747..65a90b2df 100644 --- a/backend/Testing/LexCore/CrdtServerCommitTests.cs +++ b/backend/Testing/LexCore/CrdtServerCommitTests.cs @@ -10,6 +10,7 @@ namespace Testing.LexCore; [Collection(nameof(TestingServicesFixture))] +[Trait("Category", "RequiresDb")] public class CrdtServerCommitTests { private readonly LexBoxDbContext _dbContext; diff --git a/backend/Testing/LexCore/Services/ProjectServiceTest.cs b/backend/Testing/LexCore/Services/ProjectServiceTest.cs index 6accdbbe8..2b82580b6 100644 --- a/backend/Testing/LexCore/Services/ProjectServiceTest.cs +++ b/backend/Testing/LexCore/Services/ProjectServiceTest.cs @@ -14,6 +14,7 @@ namespace Testing.LexCore.Services; [Collection(nameof(TestingServicesFixture))] +[Trait("Category", "RequiresDb")] public class ProjectServiceTest { private readonly ProjectService _projectService; diff --git a/backend/Testing/LexCore/Services/UserServiceTest.cs b/backend/Testing/LexCore/Services/UserServiceTest.cs index 2ba2f2f5c..104f5aff2 100644 --- a/backend/Testing/LexCore/Services/UserServiceTest.cs +++ b/backend/Testing/LexCore/Services/UserServiceTest.cs @@ -12,6 +12,7 @@ namespace Testing.LexCore.Services; [Collection(nameof(TestingServicesFixture))] +[Trait("Category", "RequiresDb")] public class UserServiceTest : IAsyncLifetime { private readonly UserService _userService; diff --git a/backend/Testing/Taskfile.yml b/backend/Testing/Taskfile.yml index 0f36ef689..a9b6b7f78 100644 --- a/backend/Testing/Taskfile.yml +++ b/backend/Testing/Taskfile.yml @@ -6,6 +6,13 @@ vars: tasks: unit: + interactive: true + vars: + FILTER: '{{default "." .CLI_ARGS}}' + cmds: + - dotnet test --filter="Category!=RequiresDb&Category!=Integration&Category!=FlakyIntegration&{{.FILTER}}" + + unit-with-db: interactive: true vars: FILTER: '{{default "." .CLI_ARGS}}'