Skip to content

Commit 527f8a7

Browse files
committed
Don't throw hard Exception in FAKE on TC, hard to diagnose the build failure as it takes over failed tests
1 parent 7f54594 commit 527f8a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build/scripts/Testing.fsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ module Tests =
2121
open System
2222

2323
let private buildingOnTravis = getEnvironmentVarAsBool "TRAVIS"
24+
let private buildingOnTeamCity = getEnvironmentVarAsBool "TEAMCITY_VERSION"
2425

2526
let private setLocalEnvVars() =
2627
let clusterFilter = getBuildParamOrDefault "clusterfilter" ""
@@ -50,7 +51,7 @@ module Tests =
5051

5152
let dotnet = Tooling.BuildTooling("dotnet")
5253
let exitCode = dotnet.ExecWithTimeoutIn "src/Tests/Tests" command (TimeSpan.FromMinutes 30.)
53-
if exitCode > 0 then raise (Exception <| (sprintf "test finished with exitCode %d" exitCode))
54+
if exitCode > 0 && not buildingOnTeamCity then raise (Exception <| (sprintf "test finished with exitCode %d" exitCode))
5455

5556
let RunReleaseUnitTests() =
5657
setLocalEnvVars()

0 commit comments

Comments
 (0)