@@ -16,10 +16,12 @@ package step
16
16
17
17
import (
18
18
"encoding/json"
19
+ "fmt"
19
20
"strconv"
20
21
21
22
"github.com/erda-project/erda/apistructs"
22
23
"github.com/erda-project/erda/bundle"
24
+ protocol "github.com/erda-project/erda/modules/openapi/component-protocol"
23
25
"github.com/erda-project/erda/pkg/expression"
24
26
)
25
27
@@ -29,14 +31,14 @@ type APISpec struct {
29
31
Loop * apistructs.PipelineTaskLoop `json:"loop"`
30
32
}
31
33
32
- func GetStepAllOutput (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle ) (map [string ]map [string ]string , error ) {
34
+ func GetStepAllOutput (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle , gs * apistructs. GlobalStateData ) (map [string ]map [string ]string , error ) {
33
35
var outputs = map [string ]map [string ]string {}
34
36
apiOutput , err := buildStepOutPut (steps )
35
37
if err != nil {
36
38
return nil , err
37
39
}
38
40
39
- configSheetOutput , err := buildConfigSheetStepOutPut (steps , bdl )
41
+ configSheetOutput , err := buildConfigSheetStepOutPut (steps , bdl , gs )
40
42
if err != nil {
41
43
return nil , err
42
44
}
@@ -132,7 +134,7 @@ func MakeStepOutputSelectKey(stepID string, stepName string, key string) string
132
134
return "#" + stepID + "-" + stepName + ":" + key
133
135
}
134
136
135
- func buildConfigSheetStepOutPut (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle ) (map [string ]map [string ]string , error ) {
137
+ func buildConfigSheetStepOutPut (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle , gs * apistructs. GlobalStateData ) (map [string ]map [string ]string , error ) {
136
138
137
139
outputs := make (map [string ]map [string ]string , 0 )
138
140
@@ -177,7 +179,7 @@ func buildConfigSheetStepOutPut(steps []apistructs.AutoTestSceneStep, bdl *bundl
177
179
req .SnippetConfigs = snippetConfigs
178
180
detail , err := bdl .GetPipelineActionParamsAndOutputs (req )
179
181
if err != nil {
180
- return nil , err
182
+ ( * gs )[ protocol . GlobalInnerKeyError . String ()] = fmt . Sprintf ( "failed to query step outputs, please check config sheets" )
181
183
}
182
184
183
185
for alias , detail := range detail {
@@ -198,7 +200,7 @@ func buildConfigSheetStepOutPut(steps []apistructs.AutoTestSceneStep, bdl *bundl
198
200
return outputs , nil
199
201
}
200
202
201
- func GetConfigSheetStepOutPut (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle ) (map [string ]map [string ]string , error ) {
203
+ func GetConfigSheetStepOutPut (steps []apistructs.AutoTestSceneStep , bdl * bundle.Bundle , gs * apistructs. GlobalStateData ) (map [string ]map [string ]string , error ) {
202
204
203
205
outputs := make (map [string ]map [string ]string , 0 )
204
206
@@ -247,7 +249,7 @@ func GetConfigSheetStepOutPut(steps []apistructs.AutoTestSceneStep, bdl *bundle.
247
249
req .SnippetConfigs = snippetConfigs
248
250
detail , err := bdl .GetPipelineActionParamsAndOutputs (req )
249
251
if err != nil {
250
- return nil , err
252
+ ( * gs )[ protocol . GlobalInnerKeyError . String ()] = fmt . Sprintf ( "failed to query step outputs , err: %v" , err )
251
253
}
252
254
253
255
for alias , detail := range detail {
0 commit comments