@@ -37,6 +37,7 @@ type testParams struct {
3737 operationsHeaders string
3838 oAuth2Context string
3939 outputFormat string
40+ artifactPath string
4041}
4142
4243// progressWriter returns where human progress/diagnostics should go. For
@@ -87,24 +88,25 @@ func runTestAndWait(mc connectors.MicrocksClient, params testParams) (bool, stri
8788 time .Sleep (2 * time .Second )
8889 }
8990
90- if err := renderTestResult (mc , testResultID , params .outputFormat ); err != nil {
91+ if err := renderTestResult (mc , testResultID , params .outputFormat , params . artifactPath ); err != nil {
9192 return false , testResultID , err
9293 }
9394
9495 return success , testResultID , nil
9596}
9697
9798// renderTestResult fetches the full result and writes it to stdout in the
98- // requested format.
99- func renderTestResult (mc connectors.MicrocksClient , testResultID , format string ) error {
99+ // requested format. artifactPath (when set) lets the github-actions formatter
100+ // map failures to file:line.
101+ func renderTestResult (mc connectors.MicrocksClient , testResultID , format , artifactPath string ) error {
100102 if format == "" {
101103 format = string (output .FormatText )
102104 }
103105 full , err := mc .GetFullTestResult (testResultID )
104106 if err != nil {
105107 return fmt .Errorf ("Got error when retrieving full test result: %s" , err )
106108 }
107- formatter , err := output .NewFormatter (output .OutputFormat (format ))
109+ formatter , err := output .NewFormatter (output .OutputFormat (format ), output . WithArtifactPath ( artifactPath ) )
108110 if err != nil {
109111 return err
110112 }
0 commit comments