Skip to content

Commit

Permalink
feat: Add test for non-self-contained app
Browse files Browse the repository at this point in the history
  • Loading branch information
woky committed Jun 21, 2022
1 parent d6ce258 commit 39c87fe
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
working-directory: ${{ github.workspace }}/tests
run: |
exec &> >(tee -a ${{ github.workspace }}/${{ env.test-results-folder }}/${{ env.log-file }})
./run-all-tests ${{ env.runtime-deps-image-name }}
./run-all-tests ${{ env.runtime-deps-image-name }} ${{ env.runtime-image-name }}
- if: always()
name: Keep test results
Expand Down
8 changes: 8 additions & 0 deletions tests/app_helloworld/runtest
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ex

echo "Running test for .NET Hello World app"

(cd src && dotnet publish --no-self-contained -r linux-x64)

docker run --rm -v $PWD/src:/app:ro $RUNTIME_IMAGE /app/bin/Debug/net6.0/linux-x64/Hello
10 changes: 10 additions & 0 deletions tests/app_helloworld/src/Hello.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
1 change: 1 addition & 0 deletions tests/app_helloworld/src/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Hello, World!");
1 change: 1 addition & 0 deletions tests/run-all-tests
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ set -ex
echo "Running tests..."

export RUNTIME_DEPS_IMAGE=${1:-"ubuntu/dotnet-runtime-deps:test"}
export RUNTIME_IMAGE=${2:-"ubuntu/dotnet-runtime:test"}

CURRENT_FOLDER="$(dirname $(readlink -f $0))"

Expand Down

0 comments on commit 39c87fe

Please sign in to comment.