mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
fix: copy testcase
This commit is contained in:
@@ -61,7 +61,7 @@ func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepRe
|
|||||||
stepTestCase := s.step.TestCase.(*TestCase)
|
stepTestCase := s.step.TestCase.(*TestCase)
|
||||||
|
|
||||||
// copy testcase to avoid data racing
|
// copy testcase to avoid data racing
|
||||||
copiedTestCase := TestCase{}
|
copiedTestCase := &TestCase{}
|
||||||
if err := copier.Copy(copiedTestCase, stepTestCase); err != nil {
|
if err := copier.Copy(copiedTestCase, stepTestCase); err != nil {
|
||||||
log.Error().Err(err).Msg("copy step testcase failed")
|
log.Error().Err(err).Msg("copy step testcase failed")
|
||||||
return stepResult, err
|
return stepResult, err
|
||||||
@@ -75,7 +75,7 @@ func (s *StepTestCaseWithOptionalArgs) Run(r *SessionRunner) (stepResult *StepRe
|
|||||||
// merge & override extractors
|
// merge & override extractors
|
||||||
copiedTestCase.Config.Export = mergeSlices(s.step.Export, copiedTestCase.Config.Export)
|
copiedTestCase.Config.Export = mergeSlices(s.step.Export, copiedTestCase.Config.Export)
|
||||||
|
|
||||||
caseRunner, err := r.caseRunner.hrpRunner.NewCaseRunner(copiedTestCase)
|
caseRunner, err := r.caseRunner.hrpRunner.NewCaseRunner(*copiedTestCase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("create case runner failed")
|
log.Error().Err(err).Msg("create case runner failed")
|
||||||
return stepResult, err
|
return stepResult, err
|
||||||
|
|||||||
Reference in New Issue
Block a user