Skip to content

Commit

Permalink
Revert "Performance Degradation Testing (#35)"
Browse files Browse the repository at this point in the history
This reverts commit 0e229e8.
  • Loading branch information
skrasekmichael authored Mar 8, 2024
1 parent 0e229e8 commit 8046783
Show file tree
Hide file tree
Showing 53 changed files with 126 additions and 449 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: dotnet restore ${{ env.SOLUTION }}

- name: Build
run: dotnet build ${{ env.SOLUTION }} -c Release --no-restore
run: dotnet build ${{ env.SOLUTION }} --no-restore

- name: Test
run: dotnet test ${{env.SOLUTION }} -c Release --no-build --verbosity normal
run: dotnet test ${{env.SOLUTION }} --no-build --verbosity normal
3 changes: 1 addition & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
<PackageVersion Include="Testcontainers" Version="3.7.0" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="3.7.0" />
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.extensibility.core" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
</ItemGroup>
</Project>
</Project>
7 changes: 0 additions & 7 deletions TeamUp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamUp.ArchitectureTests",
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamUp.EndToEndTests", "tests\TeamUp.EndToEndTests\TeamUp.EndToEndTests.csproj", "{63C1F34E-C706-43AC-A98B-E9530F875FFA}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamUp.PerformanceTests", "tests\TeamUp.PerformanceTests\TeamUp.PerformanceTests.csproj", "{B80B3E02-0B98-4ABA-92A9-74AEEEF76423}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TeamUp.TestsCommon", "tests\TeamUp.TestsCommon\TeamUp.TestsCommon.csproj", "{A3D136DD-571F-4B1C-83E2-9B538F85C575}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scripts", "Scripts", "{F77B386C-FDBC-4BB4-AF07-0CF054DBDB7E}"
Expand Down Expand Up @@ -81,10 +79,6 @@ Global
{A3D136DD-571F-4B1C-83E2-9B538F85C575}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A3D136DD-571F-4B1C-83E2-9B538F85C575}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A3D136DD-571F-4B1C-83E2-9B538F85C575}.Release|Any CPU.Build.0 = Release|Any CPU
{B80B3E02-0B98-4ABA-92A9-74AEEEF76423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B80B3E02-0B98-4ABA-92A9-74AEEEF76423}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B80B3E02-0B98-4ABA-92A9-74AEEEF76423}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B80B3E02-0B98-4ABA-92A9-74AEEEF76423}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -99,7 +93,6 @@ Global
{BFC0159D-37D8-494F-90A6-DA3EA05CFDEF} = {B78B958B-7250-4FEC-96F4-4FE0DE49D916}
{63C1F34E-C706-43AC-A98B-E9530F875FFA} = {B78B958B-7250-4FEC-96F4-4FE0DE49D916}
{A3D136DD-571F-4B1C-83E2-9B538F85C575} = {B78B958B-7250-4FEC-96F4-4FE0DE49D916}
{B80B3E02-0B98-4ABA-92A9-74AEEEF76423} = {B78B958B-7250-4FEC-96F4-4FE0DE49D916}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2E9D991D-377D-45D8-9599-801391683CEA}
Expand Down
6 changes: 0 additions & 6 deletions src/TeamUp.Common/Extensions.cs

This file was deleted.

6 changes: 6 additions & 0 deletions tests/TeamUp.EndToEndTests/DataGenerators/BaseGenerator.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace TeamUp.EndToEndTests.DataGenerators;

public abstract class BaseGenerator
{
protected static Faker F => FExt.F;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
using FluentAssertions.Extensions;

namespace TeamUp.TestsCommon.DataGenerators;
using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.DataGenerators;

public static class EventGeneratorExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@

using FluentAssertions.Extensions;

namespace TeamUp.TestsCommon.DataGenerators;
using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.DataGenerators;

public sealed class EventGenerators : BaseGenerator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Linq.Expressions;
using System.Reflection;

namespace TeamUp.TestsCommon.DataGenerators;
namespace TeamUp.EndToEndTests.DataGenerators;

public sealed class InvalidRequest<TRequest>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
global using InvitationGenerator = Bogus.Faker<TeamUp.Domain.Aggregates.Invitations.Invitation>;

namespace TeamUp.TestsCommon.DataGenerators;
using TeamUp.Contracts.Invitations;
using TeamUp.Contracts.Teams;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.DataGenerators;

public sealed class InvitationGenerators : BaseGenerator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using TeamUp.Common;
using TeamUp.Contracts.Teams;

namespace TeamUp.TestsCommon.DataGenerators;
namespace TeamUp.EndToEndTests.DataGenerators;

public static class TeamGeneratorExtensions
{
Expand Down Expand Up @@ -36,24 +36,6 @@ public static TeamGenerator WithMembers(this TeamGenerator teamGenerator, User o
return teamGenerator.GetTeamGeneratorWithMembers(members, userMembersWithOwner);
}

public static TeamGenerator WithRandomMembers(this TeamGenerator teamGenerator, int count, List<User> pot)
{
count.Should().BeGreaterThan(0);
pot.Should().HaveCountGreaterThanOrEqualTo(1);

return teamGenerator
.RuleFor(TeamGenerators.TEAM_MEMBERS_FIELD, (f, t) => f
.Make(count, index => f.PickRandom(pot)
.Map(user => TeamGenerators.TeamMember
.RuleForBackingField(tm => tm.TeamId, t.Id)
.RuleForBackingField(tm => tm.UserId, user.Id)
.RuleFor(tm => tm.Nickname, user.Name)
.RuleFor(tm => tm.Role, index == 0 ? TeamRole.Owner : TeamRole.Member)
.Generate()))
.ToHashSet()
.ToList());
}

public static TeamGenerator WithMembers(this TeamGenerator teamGenerator, List<User> members, params (User User, TeamRole Role)[] userMembers)
{
userMembers.Where(x => x.Role == TeamRole.Owner).Should().ContainSingle("team has to have exactly 1 owner");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
global using TeamGenerator = Bogus.Faker<TeamUp.Domain.Aggregates.Teams.Team>;

namespace TeamUp.TestsCommon.DataGenerators;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.DataGenerators;

public sealed class TeamGenerators : BaseGenerator
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace TeamUp.TestsCommon.DataGenerators;
using TeamUp.Contracts.Teams;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.DataGenerators;

public sealed class UserGenerators : BaseGenerator
{
Expand Down
5 changes: 3 additions & 2 deletions tests/TeamUp.EndToEndTests/EndpointTests/BaseEndpointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ namespace TeamUp.EndToEndTests.EndpointTests;
[Collection(nameof(AppCollectionFixture))]
public abstract class BaseEndpointTests : IAsyncLifetime
{
protected static Faker F => FakerExtensions.F;
protected static Faker F => FExt.F;
protected static object EmptyObject { get; } = new { };

protected TeamApiWebApplicationFactory AppFactory { get; }
protected HttpClient Client { get; }
Expand All @@ -23,7 +24,7 @@ public BaseEndpointTests(TeamApiWebApplicationFactory appFactory)
{
AppFactory = appFactory;
Client = appFactory.CreateClient();
Client.BaseAddress = new Uri($"https://{Client.BaseAddress?.Host}:{TeamApiWebApplicationFactory.HTTPS_PORT}");
Client.BaseAddress = new Uri($"https://{Client.BaseAddress?.Host}:8080");

Inbox = appFactory.Services.GetRequiredService<MailInbox>();
BackgroundCallback = appFactory.Services.GetRequiredService<OutboxBackgroundCallback>();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Events;
using TeamUp.Contracts.Events;

namespace TeamUp.EndToEndTests.EndpointTests.Events;

public abstract class BaseEventTests : BaseEndpointTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace TeamUp.EndToEndTests.EndpointTests.Events;
using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Events;

public sealed class CreateEventTests : BaseEventTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using EventResponse = TeamUp.Contracts.Events.EventResponse;
using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

using EventResponse = TeamUp.Contracts.Events.EventResponse;

namespace TeamUp.EndToEndTests.EndpointTests.Events;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
namespace TeamUp.EndToEndTests.EndpointTests.Events;
using FluentAssertions.Extensions;

using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Events;

public sealed class GetEventsTests : BaseEventTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Events;
using TeamUp.Contracts.Teams;

using EventResponse = TeamUp.Domain.Aggregates.Events.EventResponse;

namespace TeamUp.EndToEndTests.EndpointTests.Events;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ namespace TeamUp.EndToEndTests.EndpointTests;
[Collection(nameof(AppCollectionFixture))]
public sealed class HttpsRedirectionTests : IAsyncLifetime
{
private static Faker F => FExt.F;

private readonly TeamApiWebApplicationFactory _appFactory;
private readonly HttpClient _client;

Expand Down Expand Up @@ -42,7 +44,7 @@ private void Authenticate(User user)
public async Task HttpRequest_ToHealthCheckEndpoint_Should_RedirectToHttps()
{
//arrange
var expectedLocation = $"https://{_client.BaseAddress?.Host}:{TeamApiWebApplicationFactory.HTTPS_PORT}/_health";
var expectedLocation = $"https://{_client.BaseAddress?.Host}:8080/_health";

//act
var response = await _client.GetAsync("/_health");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Invitations;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Invitations;

public sealed class AcceptInvitationTests : BaseInvitationTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Invitations;
using TeamUp.Contracts.Invitations;

namespace TeamUp.EndToEndTests.EndpointTests.Invitations;

public sealed class GetMyInvitationsTests : BaseInvitationTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace TeamUp.EndToEndTests.EndpointTests.Invitations;
using TeamUp.Contracts.Invitations;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Invitations;

public sealed class GetTeamInvitationsTests : BaseInvitationTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
namespace TeamUp.EndToEndTests.EndpointTests.Invitations;
using TeamUp.Contracts.Invitations;
using TeamUp.Contracts.Teams;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.EndpointTests.Invitations;

public sealed class InviteUserTests : BaseInvitationTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
namespace TeamUp.EndToEndTests.EndpointTests.Invitations;
using TeamUp.Contracts.Invitations;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Invitations;

public sealed class RemoveInvitationTests : BaseInvitationTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class ChangeNicknameTests : BaseTeamTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class ChangeOwnershipTests : BaseTeamTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Teams;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class CreateEventTypeTests : BaseTeamTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class CreateTeamTests : BaseTeamTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Microsoft.EntityFrameworkCore;

using EventResponse = TeamUp.Domain.Aggregates.Events.EventResponse;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Teams;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class GetTeamTests : BaseTeamTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Teams;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class RemoveTeamMemberTests : BaseTeamTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using Microsoft.EntityFrameworkCore;

using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class UpdateTeamMemberRoleTests : BaseTeamTests
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.Teams;
using TeamUp.Contracts.Teams;

namespace TeamUp.EndToEndTests.EndpointTests.Teams;

public sealed class UpdateTeamNameTests : BaseTeamTests
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.UserAccess;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.EndpointTests.UserAccess;

public sealed class ActivateAccountTests : BaseUserAccessTests
{
Expand All @@ -20,7 +22,7 @@ await UseDbContextAsync(dbContext =>
});

//act
var response = await Client.PostAsync(GetUrl(user.Id), null);
var response = await Client.PostAsJsonAsync(GetUrl(user.Id), EmptyObject);

//assert
response.Should().Be200Ok();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace TeamUp.EndToEndTests.EndpointTests.UserAccess;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.EndpointTests.UserAccess;

public sealed class GetMyAccountDetailsTests : BaseUserAccessTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Security.Claims;

using TeamUp.Application.Users;
using TeamUp.Contracts.Users;

namespace TeamUp.EndToEndTests.EndpointTests.UserAccess;

Expand Down
Loading

0 comments on commit 8046783

Please sign in to comment.