Skip to content

Commit

Permalink
(GH-528) Update Teardown method
Browse files Browse the repository at this point in the history
When running integration tests, messages shouldn't be sent out when the
execution completes.  These publishing messages are only intended for
the main build exection.
  • Loading branch information
gep13 committed Jul 7, 2020
1 parent b7b53bb commit bb1047a
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
13 changes: 11 additions & 2 deletions Cake.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@ Teardown(context =>
if(context.Successful)
{
if(!BuildParameters.IsLocalBuild && !BuildParameters.IsPullRequest && BuildParameters.IsMainRepository && (BuildParameters.IsMasterBranch || ((BuildParameters.IsReleaseBranch || BuildParameters.IsHotFixBranch) && BuildParameters.ShouldNotifyBetaReleases)) && BuildParameters.IsTagged)
if(!BuildParameters.IsLocalBuild &&
!BuildParameters.IsPullRequest &&
BuildParameters.IsMainRepository &&
(BuildParameters.IsMasterBranch ||
((BuildParameters.IsReleaseBranch || BuildParameters.IsHotFixBranch)
&& BuildParameters.ShouldNotifyBetaReleases)) &&
BuildParameters.IsTagged &&
!BuildParameters.IsRunningIntegrationTests)
{
if(BuildParameters.CanPostToTwitter && BuildParameters.ShouldPostToTwitter)
{
Expand All @@ -70,7 +77,9 @@ Teardown(context =>
}
else
{
if(!BuildParameters.IsLocalBuild && BuildParameters.IsMainRepository)
if(!BuildParameters.IsLocalBuild &&
BuildParameters.IsMainRepository &&
!BuildParameters.IsRunningIntegrationTests)
{
if(BuildParameters.CanPostToSlack && BuildParameters.ShouldPostToSlack)
{
Expand Down
8 changes: 8 additions & 0 deletions Cake.Recipe/Content/parameters.cake
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ public static class BuildParameters
public static string MasterBranchName { get; private set; }
public static string DevelopBranchName { get; private set; }

public static string IsRunningIntegrationTests
{
get
{
return string.Equals(BuildParameters.Target, "Run-Integration-Tests", StringComparison.OrdinalIgnoreCase)
}
}

public static string GitterMessage
{
get
Expand Down

0 comments on commit bb1047a

Please sign in to comment.