Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/check tests passed #43

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions TemporalAirlinesConcept.Api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,29 @@ ARG BUILD_CONFIGURATION=Release
WORKDIR /src
COPY ["TemporalAirlinesConcept.Api/TemporalAirlinesConcept.Api.csproj", "TemporalAirlinesConcept.Api/"]
COPY ["TemporalAirlinesConcept.Common/TemporalAirlinesConcept.Common.csproj", "TemporalAirlinesConcept.Common/"]
COPY ["TemporalAirlinesConcept.Tests/TemporalAirlinesConcept.Tests.csproj", "TemporalAirlinesConcept.Tests/"]
RUN dotnet restore "./TemporalAirlinesConcept.Api/./TemporalAirlinesConcept.Api.csproj"

COPY . .

WORKDIR "/src/TemporalAirlinesConcept.Api"
RUN dotnet build "./TemporalAirlinesConcept.Api.csproj" -c $BUILD_CONFIGURATION -o /app/build

WORKDIR "/src/TemporalAirlinesConcept.Tests"
RUN dotnet build "./TemporalAirlinesConcept.Tests.csproj" -c $BUILD_CONFIGURATION -o /app/build

FROM build AS test
WORKDIR /src/TemporalAirlinesConcept.Tests
RUN dotnet test --logger "trx;LogFileName=test_results.trx" --collect:"XPlat Code Coverage"

FROM build AS publish
ARG BUILD_CONFIGURATION=Release
WORKDIR "/src/TemporalAirlinesConcept.Api"
RUN dotnet publish "./TemporalAirlinesConcept.Api.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
COPY --from=test /src/TemporalAirlinesConcept.Tests/TestResults /app/TestResults

CMD sleep 45 && dotnet TemporalAirlinesConcept.Api.dll
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public async Task RegisterPassengerPaymentTimeout_Succeeds()

// Assert
await workflowExecution.Should().NotThrowAsync();

flightDetailsModelWithTicket.Registered.Should().Contain(registeredTicket);

flightDetailsModelWithoutTicket.Registered.Should().NotContain(bookingRequestModel.Ticket);
Expand Down
4 changes: 3 additions & 1 deletion temporal-server/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ services:
ports:
- 5455:${POSTGRES_PORT}
volumes:
- ./data/postgresql/:/var/lib/postgresql/data
- /var/lib/postgresql/data
pgadmin:
image: dpage/pgadmin4
ports:
Expand Down Expand Up @@ -104,6 +104,8 @@ services:
- postgresql
networks:
- temporal-network
volumes:
- ./test-results:/app/TestResults # Mount the volume to access test results
temporalairlinesconcept.web:
container_name: temporalairlinesconcept.web
build:
Expand Down