Helix tests should fail if exceptions thrown during test discovery (#8107)

This commit is contained in:
Hao Kung 2019-03-04 14:15:37 -08:00 committed by GitHub
parent 51e30ee20d
commit 3652b7a927
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -15,6 +15,14 @@ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePo
set HELIX=true
%DOTNET_ROOT%\dotnet vstest %target% -lt >discovered.txt
find /c "Exception thrown" discovered.txt
if %errorlevel% equ 0 (
echo Exception thrown during test discovery.
type discovered.txt
exit 1
)
%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --logger:console;verbosity=normal

View File

@ -60,4 +60,11 @@ export DOTNET_CLI_HOME="$HELIX_CORRELATION_PAYLOAD/home"
export helix="true"
$HELIX_CORRELATION_PAYLOAD/sdk/dotnet vstest $1 --logger:trx
$DOTNET_ROOT/dotnet vstest $1 -lt >discovered.txt
if grep -q "Exception thrown" discovered.txt; then
echo -e "${RED}Exception thrown during test discovery${RESET}".
cat discovered.txt
exit 1
fi
$DOTNET_ROOT/dotnet vstest $1 --logger:trx