This solution is used to run .Net library tests in Mystikos pipeline
- runner/: stores the custom test runner, this is a better alternative to
dotnet test - testcases/: stores path to dotnet library test DLLs
- test_runner.sh: Runs test using
dockerordotnet test
all_test_dll.txt: all library test DLLs
all_testhost_dll.txt: all testhost.dll we could find in dotnet library tests
pass.txt: Tests that should pass when running in Mystikos
fail.txt: Tests that currently fail when running in Mystikos
skip.txt: Tests that should be skipped because they could crash Mystikos, or hangs forever, or don't contain unit tests
Docker images are pre-built to save time, you can find repo here: https://hub.docker.com/repository/docker/hullcritical/dotnet-library-test
- hullcritical/dotnet-library-test:release-musl is built from Dockerfile.musl
- hullcritical/dotnet-library-test:release-glibc is built from Dockerfile.glibc
The main difference is whether dotnet is built by musl(on Alpine) or glibc(on Ubuntu)
There is another Dockerfile Dockerfile.musl/glibc.runner, this takes the pre-built image and append a custom test runner.
Some random code snippets that might be useful
# Replace testhost.dll path to actual unit test DLL in testcases/all_testhost_dll.txt # Before: ./Common.Tests/net5.0-Linux-Release/testhost.dll # After: Common.Tests/net5.0-Linux-Release/Common.Tests.dll function get_all_test_dll() { sed -e 's/^\.\/\(.*\.Tests\)\(.*\)\/testhost\.dll/\1\2\/\1\.dll/g' all_testhost_dll.txt }