Skip to content

Commit 3652b7a

Browse files
authored
Helix tests should fail if exceptions thrown during test discovery (#8107)
1 parent 51e30ee commit 3652b7a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

eng/helix/vstest/runtests.cmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ powershell.exe -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePo
1515

1616
set HELIX=true
1717

18+
%DOTNET_ROOT%\dotnet vstest %target% -lt >discovered.txt
19+
find /c "Exception thrown" discovered.txt
20+
if %errorlevel% equ 0 (
21+
echo Exception thrown during test discovery.
22+
type discovered.txt
23+
exit 1
24+
)
25+
1826
%DOTNET_ROOT%\dotnet vstest %target% --logger:trx --logger:console;verbosity=normal
1927

2028

eng/helix/vstest/runtests.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,11 @@ export DOTNET_CLI_HOME="$HELIX_CORRELATION_PAYLOAD/home"
6060

6161
export helix="true"
6262

63-
$HELIX_CORRELATION_PAYLOAD/sdk/dotnet vstest $1 --logger:trx
63+
$DOTNET_ROOT/dotnet vstest $1 -lt >discovered.txt
64+
if grep -q "Exception thrown" discovered.txt; then
65+
echo -e "${RED}Exception thrown during test discovery${RESET}".
66+
cat discovered.txt
67+
exit 1
68+
fi
69+
70+
$DOTNET_ROOT/dotnet vstest $1 --logger:trx

0 commit comments

Comments
 (0)