MCPcopy
hub / github.com/httprunner/httprunner / Run

Method Run

hrp/step_api.go:101–116  ·  view source on GitHub ↗
(r *SessionRunner)

Source from the content-addressed store, hash-verified

99}
100
101func (s *StepAPIWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepResult, err error) {
102 defer func() {
103 stepResult.StepType = stepTypeAPI
104 }()
105 // extend request with referenced API
106 api, _ := s.step.API.(*API)
107 step := &TStep{}
108 // deep copy step to avoid data racing
109 if err = copier.Copy(step, s.step); err != nil {
110 log.Error().Err(err).Msg("copy step failed")
111 return
112 }
113 extendWithAPI(step, api)
114 stepResult, err = runStepRequest(r, step)
115 return
116}
117
118// extend teststep with api, teststep will merge and override referenced api
119func extendWithAPI(testStep *TStep, overriddenStep *API) {

Callers

nothing calls this directly

Calls 3

extendWithAPIFunction · 0.85
runStepRequestFunction · 0.85
ErrMethod · 0.80

Tested by

no test coverage detected