File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,29 @@ Target "RunTests" (fun _ ->
115115 projects |> Seq.iter ( runSingleProject)
116116)
117117
118+ Target " IntegrationTests" <| fun _ ->
119+ let integrationTests = !! " ./src/**/Incrementalist.Cmd.csproj"
120+
121+ let runSingleProject project =
122+
123+ let folderOnlyArgs = sprintf " run --project %s -c %s --no-build -- -b dev -l" project configuration
124+ let slnArgs = sprintf " run --project %s -c %s --no-build -- -b dev" project configuration
125+
126+ let execWithArgs args =
127+ let result = ExecProcess( fun info ->
128+ info.FileName <- " dotnet"
129+ info.WorkingDirectory <- __ SOURCE_ DIRECTORY__
130+ info.Arguments <- args) ( TimeSpan.FromMinutes 5.0 )
131+ if result <> 0 then failwithf " Incrementalist failed.%s " args
132+
133+ log " Running Incrementalist folders-only check"
134+ execWithArgs folderOnlyArgs
135+
136+ log " Running Incrementalist solution check"
137+ execWithArgs slnArgs
138+
139+ integrationTests |> Seq.iter runSingleProject
140+
118141Target " NBench" <| fun _ ->
119142 let projects =
120143 match ( isWindows) with
@@ -311,6 +334,7 @@ Target "Nuget" DoNothing
311334
312335// all
313336" BuildRelease" ==> " All"
337+ " IntegrationTests" ==> " All"
314338" RunTests" ==> " All"
315339" NBench" ==> " All"
316340" Nuget" ==> " All"
Original file line number Diff line number Diff line change @@ -95,11 +95,21 @@ private static async Task<int> RunIncrementalist(SlnOptions options)
9595 // validate the target branch
9696 if ( ! DiffHelper . HasBranch ( repoResult . repo , options . GitBranch ) )
9797 {
98- Console . WriteLine ( "Current git repository doesn't have any branch named [{0}]. Shutting down." , options . GitBranch ) ;
99- return - 4 ;
98+ // workaround common CI server issues and check to see if this same branch is located
99+ // under "origin/{branchname}"
100+ options . GitBranch = $ "origin/{ options . GitBranch } ";
101+ if ( ! DiffHelper . HasBranch ( repoResult . repo , options . GitBranch ) )
102+ {
103+ Console . WriteLine ( "Current git repository doesn't have any branch named [{0}]. Shutting down." , options . GitBranch ) ;
104+ Console . WriteLine ( "[Debug] Here are all of the currently known branches in this repository" ) ;
105+ foreach ( var b in repoResult . repo . Branches )
106+ {
107+ Console . WriteLine ( b . FriendlyName ) ;
108+ }
109+ return - 4 ;
110+ }
100111 }
101112
102-
103113 if ( ! string . IsNullOrEmpty ( repoFolder ) )
104114 {
105115 if ( options . ListFolders )
You can’t perform that action at this time.
0 commit comments