Skip to content

Commit

Permalink
Put tests that need Db into their own category
Browse files Browse the repository at this point in the history
  • Loading branch information
myieye committed Dec 18, 2024
1 parent ce28810 commit 94082eb
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions backend/Testing/Fixtures/Tests/ServicesFixtureTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Testing.Fixtures.Tests;

[Trait("Category", "RequiresDb")]
public class ServicesFixtureTests
{
[Fact]
Expand Down
1 change: 1 addition & 0 deletions backend/Testing/LexCore/CrdtServerCommitTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
namespace Testing.LexCore;

[Collection(nameof(TestingServicesFixture))]
[Trait("Category", "RequiresDb")]
public class CrdtServerCommitTests
{
private readonly LexBoxDbContext _dbContext;
Expand Down
1 change: 1 addition & 0 deletions backend/Testing/LexCore/Services/ProjectServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
namespace Testing.LexCore.Services;

[Collection(nameof(TestingServicesFixture))]
[Trait("Category", "RequiresDb")]
public class ProjectServiceTest
{
private readonly ProjectService _projectService;
Expand Down
1 change: 1 addition & 0 deletions backend/Testing/LexCore/Services/UserServiceTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
namespace Testing.LexCore.Services;

[Collection(nameof(TestingServicesFixture))]
[Trait("Category", "RequiresDb")]
public class UserServiceTest : IAsyncLifetime
{
private readonly UserService _userService;
Expand Down
7 changes: 7 additions & 0 deletions backend/Testing/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}}'
Expand Down

0 comments on commit 94082eb

Please sign in to comment.