From c2937bac15d34279335728066bb7bf983818fa54 Mon Sep 17 00:00:00 2001 From: p-zielinski <82354717+p-zielinski@users.noreply.github.com> Date: Fri, 6 Mar 2026 11:54:09 +0100 Subject: [PATCH] Improved tests - test using committed dll files --- .github/workflows/dotnet-tests.yml | 4 ++- Dockerfile | 3 +- src/Voucherify.Test/Voucherify.Test.csproj | 34 +++++++++++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet-tests.yml b/.github/workflows/dotnet-tests.yml index 556c2711..1c584eb1 100644 --- a/.github/workflows/dotnet-tests.yml +++ b/.github/workflows/dotnet-tests.yml @@ -36,4 +36,6 @@ jobs: - name: Run tests (detailed) run: | - dotnet test src/Voucherify.Test/Voucherify.Test.csproj + dotnet test src/Voucherify.Test/Voucherify.Test.csproj -p:VoucherifyLibTfm=netstandard2.0 + dotnet test src/Voucherify.Test/Voucherify.Test.csproj -p:VoucherifyLibTfm=netstandard2.1 + dotnet test src/Voucherify.Test/Voucherify.Test.csproj -p:VoucherifyLibTfm=net9.0 diff --git a/Dockerfile b/Dockerfile index aac72c7b..03847c88 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,8 +4,9 @@ WORKDIR /app # Copy the source code COPY ./src ./src +COPY ./lib ./lib # Run the tests with detailed logging and check the results -CMD dotnet test src/Voucherify.Test/Voucherify.Test.csproj -l "console;verbosity=detailed" | \ +CMD dotnet test src/Voucherify.Test/Voucherify.Test.csproj -p:VoucherifyLibTfm=net9.0 -l "console;verbosity=detailed" | \ tee test_results.txt && \ grep -E "failed: 0.*skipped: 0" test_results.txt || (echo "Tests failed or were skipped!" && exit 1) diff --git a/src/Voucherify.Test/Voucherify.Test.csproj b/src/Voucherify.Test/Voucherify.Test.csproj index c94d2d53..73789f7a 100644 --- a/src/Voucherify.Test/Voucherify.Test.csproj +++ b/src/Voucherify.Test/Voucherify.Test.csproj @@ -5,6 +5,8 @@ Voucherify.Test net9.0 false + net9.0 + $(MSBuildThisFileDirectory)../../lib @@ -19,7 +21,32 @@ - + + $(VoucherifyLibRoot)/$(VoucherifyLibTfm)/Voucherify.dll + true + + + + + + + + + + + + + + + + + + + + + + + @@ -35,4 +62,9 @@ PreserveNewest + + + +