WIP - Testing approaches

This commit is contained in:
Miguel Veloso 2019-04-10 13:54:06 +01:00
parent aa7614be5a
commit f6c2f5672a
5 changed files with 32 additions and 16 deletions

View File

@ -7,7 +7,6 @@
docker-compose*.yml docker-compose*.yml
docker-compose.dcproj docker-compose.dcproj
*.sln *.sln
!eShopOnContainers-ServicesAndWebApps.sln
*.md *.md
hosts hosts
LICENSE LICENSE
@ -32,3 +31,10 @@ cli-linux
global.json global.json
**/appsettings.localhost.json **/appsettings.localhost.json
src/Web/WebSPA/wwwroot/ src/Web/WebSPA/wwwroot/
packages/
csproj-files/
test-results/
TestResults/
src/Mobile/
src/Web/Catalog.WebForms/
src/Web/WebMonolithic/

3
.gitignore vendored
View File

@ -26,6 +26,9 @@ bld/
# Visual Studio 2015 cache/options directory # Visual Studio 2015 cache/options directory
.vs/ .vs/
# Dockerfile projects folder for restore-packages script
csproj-files/
# .js files created on build: # .js files created on build:
src/Web/WebMVC/wwwroot/js/site* src/Web/WebMVC/wwwroot/js/site*

View File

@ -0,0 +1,3 @@
#!/bin/bash
for f in *.csproj; do dotnet restore --no-dependencies ../csproj-files/$f; done

1
restore-packages.cmd Normal file
View File

@ -0,0 +1 @@
for /R %%f in (*.csproj) do dotnet restore --no-dependencies %%f

View File

@ -4,21 +4,24 @@ EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build
WORKDIR /src WORKDIR /src
COPY . . COPY **/*.csproj csproj-files/
WORKDIR /src/src/Services/Ordering/Ordering.API # WORKDIR /src/Dockerfile-scripts
RUN dotnet restore -nowarn:msb3202,nu1503 # RUN restore-packages
RUN dotnet build --no-restore -c Release -o /app # COPY . .
# WORKDIR /src/src/Services/Ordering/Ordering.API
# RUN dotnet restore -nowarn:msb3202,nu1503
# RUN dotnet build --no-restore -c Release -o /app
FROM build as functionaltest # FROM build as functionaltest
WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests # WORKDIR /src/src/Services/Ordering/Ordering.FunctionalTests
FROM build as unittest # FROM build as unittest
WORKDIR /src/src/Services/Ordering/Ordering.UnitTests # WORKDIR /src/src/Services/Ordering/Ordering.UnitTests
FROM build AS publish # FROM build AS publish
RUN dotnet publish --no-restore -c Release -o /app # RUN dotnet publish --no-restore -c Release -o /app
FROM base AS final # FROM base AS final
WORKDIR /app # WORKDIR /app
COPY --from=publish /app . # COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Ordering.API.dll"] # ENTRYPOINT ["dotnet", "Ordering.API.dll"]