Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ variables:
value: .NETCore
- name: VisualStudioDropName
value: Products/$(System.TeamProject)/$(Build.Repository.Name)/$(Build.SourceBranchName)/$(Build.BuildNumber)
- ${{ if and(eq(variables['System.TeamProject'], 'public'), eq(variables['Build.Reason'], 'PullRequest')) }}:
- name: RunningAsPullRequest
value: true

# Variables defined in yml cannot be overridden at queue time; instead overridable variables must be defined in the web UI.
# Commenting out until something like this is supported: https://github.com/Microsoft/azure-pipelines-yaml/pull/129
Expand Down
4 changes: 4 additions & 0 deletions eng/Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ function TestUsingNUnit([string] $testProject, [string] $targetFramework) {
$args += " --no-build"
}

if ($env:RunningAsPullRequest -ne "true") {
$args += " --filter TestCategory!=PullRequest"
}

Exec-Console $dotnetExe $args
}

Expand Down
7 changes: 6 additions & 1 deletion eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,15 @@ function TestUsingNUnit() {
exit 1
fi

filterArgs=""
if [[ "${RunningAsPullRequest:-}" != "true" ]]; then
filterArgs=" --filter TestCategory!=PullRequest"
fi

projectname=$(basename -- "$testproject")
projectname="${projectname%.*}"
testlogpath="$artifacts_dir/TestResults/$configuration/${projectname}_$targetframework.xml"
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\""
args="test \"$testproject\" --no-restore --no-build -c $configuration -f $targetframework --test-adapter-path . --logger \"nunit;LogFilePath=$testlogpath\"$filterArgs"
"$DOTNET_INSTALL_DIR/dotnet" $args || exit $?
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ type MailboxProcessorType() =
()

[<Test>]
[<Category("PullRequest")>]
member this.``Receive handles cancellation token``() =
let result = ref None

Expand Down Expand Up @@ -103,6 +104,7 @@ type MailboxProcessorType() =
Assert.AreEqual(Some("Received 1 Disposed"), !result)

[<Test>]
[<Category("PullRequest")>]
member this.``Receive with timeout argument handles cancellation token``() =
let result = ref None

Expand Down