Skip to content

Commit 9af8c57

Browse files
brettfobaronfel
authored andcommitted
skip flaky tests in official builds (#8497)
* skip flaky tests in official builds * also filter tests on linux
1 parent 61acf88 commit 9af8c57

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

eng/Build.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,10 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
256256
$args += " --no-build"
257257
}
258258

259+
if ($env:RunningAsPullRequest -ne "true") {
260+
$args += " --filter TestCategory!=PullRequest"
261+
}
262+
259263
Exec-Console $dotnetExe $args
260264
}
261265

eng/build.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,15 @@ function TestUsingNUnit() {
181181
exit 1
182182
fi
183183

184+
filterArgs=""
185+
if [[ "${RunningAsPullRequest:-}" != "true" ]]; then
186+
filterArgs=" --filter TestCategory!=PullRequest"
187+
fi
188+
184189
projectname=$(basename -- "$testproject")
185190
projectname="${projectname%.*}"
186191
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
187-
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\""
192+
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs"
188193
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
189194
}
190195

0 commit comments

Comments
 (0)