Skip to content

Commit

Permalink
Fixed build
Browse files Browse the repository at this point in the history
  • Loading branch information
jezzsantos committed Sep 16, 2023
1 parent cd756b0 commit 67eb367
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ env:
IS_CI_BUILD: 'true'
SOLUTION_PATH: 'src/SaaStack.sln'
TESTINGONLY_BUILD_CONFIGURATION: 'Release'
RELEASE_BUILD_CONFIGURATION: 'ReleaseForDeploy'
DEPLOY_BUILD_CONFIGURATION: 'ReleaseForDeploy'

jobs:
build-test:
Expand All @@ -20,11 +20,11 @@ jobs:
dotnet-version: 7.0.x
- name: Restore dependencies
run: dotnet restore "${{env.SOLUTION_PATH}}"
- name: Build for Release
run: dotnet build "${{env.SOLUTION_PATH}}" --no-restore --configuration ${{env.RELEASE_BUILD_CONFIGURATION}}
- name: Build for Deploy
run: dotnet build --configuration ${{env.DEPLOY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}"
- name: Build for Testing
run: dotnet build "${{env.SOLUTION_PATH}}" --no-restore --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}}
run: dotnet build --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} "${{env.SOLUTION_PATH}}"
- name: Unit Test
run: dotnet test --filter Category=Unit "${{env.SOLUTION_PATH}}" --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} --filter:Category="Unit" --collect:"XPlat Code Coverage" --results-directory:"src/TestResults/csharp" --logger:"trx" --logger:"junit;LogFileName={assembly}.junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose" --test-adapter-path:. "${{env.SOLUTION_PATH}}"
- name: Integration Test
run: dotnet test --filter Category=Integration "${{env.SOLUTION_PATH}}" --no-build --verbosity normal
run: dotnet test --no-build --verbosity normal --configuration ${{env.TESTINGONLY_BUILD_CONFIGURATION}} --filter:Category="Integration" --no-build --verbosity normal --collect:"XPlat Code Coverage" --results-directory:"src/TestResults/csharp" --logger:"trx" --logger:"junit;LogFileName={assembly}.junit.xml;MethodFormat=Class;FailureBodyFormat=Verbose" --test-adapter-path:. "${{env.SOLUTION_PATH}}"
3 changes: 1 addition & 2 deletions src/Infrastructure.Api.Common.IntegrationTests/WebApiSpec.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#if TESTINGONLY
using System.Net;
using System.Net.Http.Json;
using FluentAssertions;
Expand All @@ -6,8 +7,6 @@
using Microsoft.AspNetCore.Mvc.Testing;
using Xunit;

#if TESTINGONLY

namespace Infrastructure.Api.Common.IntegrationTests;

[Trait("Category", "Integration.Web")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,14 @@ public void WhenConfigureHost_ThenAppliedToAllModules()

public class TestModule : ISubDomainModule
{
public Assembly? ApiAssembly { get; init; }
public Action<WebApplication>? MinimalApiRegistrationFunction { get; init; }
public TestModule()
{
ApiAssembly = null!;
MinimalApiRegistrationFunction = null!;
RegisterServicesFunction = null!;
}

public Assembly ApiAssembly { get; init; }
public Action<WebApplication> MinimalApiRegistrationFunction { get; init; }
public Action<ConfigurationManager, IServiceCollection>? RegisterServicesFunction { get; init; }
}

0 comments on commit 67eb367

Please sign in to comment.