@@ -24,6 +24,9 @@ var AggregateResultsCmd = &cobra.Command{
2424 maxPassRatio , _ := cmd .Flags ().GetFloat64 ("max-pass-ratio" )
2525 codeOwnersPath , _ := cmd .Flags ().GetString ("codeowners-path" )
2626 repoPath , _ := cmd .Flags ().GetString ("repo-path" )
27+ headSHA , _ := cmd .Flags ().GetString ("head-sha" )
28+ baseSHA , _ := cmd .Flags ().GetString ("base-sha" )
29+ githubWorkflowName , _ := cmd .Flags ().GetString ("github-workflow-name" )
2730
2831 // Ensure the output directory exists
2932 if err := fs .MkdirAll (outputDir , 0755 ); err != nil {
@@ -51,6 +54,10 @@ var AggregateResultsCmd = &cobra.Command{
5154
5255 // Aggregate the reports
5356 aggregatedReport , err := reports .Aggregate (testReports ... )
57+ aggregatedReport .HeadSHA = headSHA
58+ aggregatedReport .BaseSHA = baseSHA
59+ aggregatedReport .GitHubWorkflowName = githubWorkflowName
60+
5461 if err != nil {
5562 s .Stop ()
5663 return fmt .Errorf ("error aggregating test reports: %w" , err )
@@ -98,12 +105,15 @@ var AggregateResultsCmd = &cobra.Command{
98105
99106 // Create a new report for failed tests with logs
100107 failedReportWithLogs := & reports.TestReport {
101- GoProject : aggregatedReport .GoProject ,
102- TestRunCount : aggregatedReport .TestRunCount ,
103- RaceDetection : aggregatedReport .RaceDetection ,
104- ExcludedTests : aggregatedReport .ExcludedTests ,
105- SelectedTests : aggregatedReport .SelectedTests ,
106- Results : failedTests ,
108+ GoProject : aggregatedReport .GoProject ,
109+ TestRunCount : aggregatedReport .TestRunCount ,
110+ RaceDetection : aggregatedReport .RaceDetection ,
111+ ExcludedTests : aggregatedReport .ExcludedTests ,
112+ SelectedTests : aggregatedReport .SelectedTests ,
113+ HeadSHA : aggregatedReport .HeadSHA ,
114+ BaseSHA : aggregatedReport .BaseSHA ,
115+ GitHubWorkflowName : aggregatedReport .GitHubWorkflowName ,
116+ Results : failedTests ,
107117 }
108118
109119 // Save the failed tests report with logs
@@ -171,6 +181,9 @@ func init() {
171181 AggregateResultsCmd .Flags ().Float64P ("max-pass-ratio" , "" , 1.0 , "The maximum pass ratio threshold for a test to be considered flaky" )
172182 AggregateResultsCmd .Flags ().StringP ("codeowners-path" , "" , "" , "Path to the CODEOWNERS file" )
173183 AggregateResultsCmd .Flags ().StringP ("repo-path" , "" , "." , "The path to the root of the repository/project" )
184+ AggregateResultsCmd .Flags ().String ("head-sha" , "" , "Head commit SHA for the test report" )
185+ AggregateResultsCmd .Flags ().String ("base-sha" , "" , "Base commit SHA for the test report" )
186+ AggregateResultsCmd .Flags ().String ("github-workflow-name" , "" , "GitHub workflow name for the test report" )
174187
175188 AggregateResultsCmd .MarkFlagRequired ("results-path" )
176189}
0 commit comments