Skip to content

Commit

Permalink
Revert "feature: scene set supports parallel in autoTest (#2173) (#2412
Browse files Browse the repository at this point in the history
…)"

This reverts commit cb7aafe.
  • Loading branch information
littlejiancc authored Oct 18, 2021
1 parent cb7aafe commit cecf4a7
Show file tree
Hide file tree
Showing 17 changed files with 133 additions and 1,046 deletions.

This file was deleted.

26 changes: 2 additions & 24 deletions apistructs/sceneset.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,12 @@
package apistructs

import (
"fmt"
"regexp"
"strconv"
"time"

"github.com/erda-project/erda/pkg/strutil"
)

const (
SceneSetsAutotestExecType = "sceneSets"
SceneAutotestExecType = "scene"

SceneSetNameMaxLength int = 50
SceneSetDescMaxLength int = 255
)
const SceneSetsAutotestExecType = "sceneSets"
const SceneAutotestExecType = "scene"

type SceneSet struct {
ID uint64 `json:"id"`
Expand Down Expand Up @@ -62,19 +53,6 @@ type SceneSetRequest struct {
IdentityInfo
}

func (req *SceneSetRequest) Validate() error {
if err := strutil.Validate(req.Name, strutil.MaxRuneCountValidator(SceneSetNameMaxLength)); err != nil {
return err
}
if err := strutil.Validate(req.Description, strutil.MaxRuneCountValidator(SceneSetDescMaxLength)); err != nil {
return err
}
if ok, _ := regexp.MatchString("^[a-zA-Z\u4e00-\u9fa50-9_-]*$", req.Name); !ok {
return fmt.Errorf("the name not match %s", "^[a-zA-Z\u4e00-\u9fa50-9_-]*$")
}
return nil
}

// type SceneSetUpdateRequest struct {
// Name string `json:"name"`
// Description string `json:"description"`
Expand Down
44 changes: 0 additions & 44 deletions apistructs/sceneset_test.go

This file was deleted.

21 changes: 0 additions & 21 deletions apistructs/testplan_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ type TestPlanV2StepGetResponse struct {
Data TestPlanV2Step `json:"data"`
}

// TestPlanV2StepListResponse testplan get response
type TestPlanV2StepListResponse struct {
Header
Data []*TestPlanV2Step `json:"data"`
}

// TestPlanV2PagingResponseData testplan query response data
type TestPlanV2PagingResponseData struct {
Total int `json:"total"`
Expand All @@ -190,7 +184,6 @@ type TestPlanV2Step struct {
SceneSetName string `json:"sceneSetName"`
PreID uint64 `json:"preID"`
PlanID uint64 `json:"planID"`
GroupID uint64 `json:"groupID"`
ID uint64 `json:"id"`
}

Expand All @@ -199,7 +192,6 @@ type TestPlanV2StepAddRequest struct {
SceneSetID uint64 `json:"sceneSetID"`
PreID uint64 `json:"preID"`
TestPlanID uint64 `json:"-"`
GroupID uint64 `json:"groupID"`

IdentityInfo
}
Expand Down Expand Up @@ -236,16 +228,3 @@ type TestPlanV2StepUpdateResp struct {
Header
Data string `json:"data"`
}

// TestPlanV2StepMoveRequest move a step in the test plan request
type TestPlanV2StepMoveRequest struct {
StepID uint64 `json:"stepID"`
LastStepID uint64 `json:"lastStepID"`
PreID uint64 `json:"preID"`
ScenesSetId uint64 `json:"scenesSetId"`
TestPlanID uint64 `json:"-"`
TargetStepID uint64 `json:"targetStepID"`
IsGroup bool `json:"isGroup"` // true: means move with group

IdentityInfo
}
29 changes: 3 additions & 26 deletions bundle/autotest_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *Bundle) DeleteTestPlansV2Step(req apistructs.TestPlanV2StepDeleteReques
}

// MoveTestPlansV2Step 移动测试计划步骤
func (b *Bundle) MoveTestPlansV2Step(req apistructs.TestPlanV2StepMoveRequest) error {
func (b *Bundle) MoveTestPlansV2Step(req apistructs.TestPlanV2StepUpdateRequest) error {
host, err := b.urls.DOP()
if err != nil {
return err
Expand Down Expand Up @@ -177,7 +177,7 @@ func (b *Bundle) GetTestPlanV2(testPlanID uint64) (*apistructs.TestPlanV2GetResp
return &getResp, nil
}

// GetTestPlanV2Step 获取测试计划步骤
// GetTestPlanV2 获取测试计划步骤
func (b *Bundle) GetTestPlanV2Step(stepID uint64) (*apistructs.TestPlanV2Step, error) {
host, err := b.urls.DOP()
if err != nil {
Expand All @@ -199,30 +199,7 @@ func (b *Bundle) GetTestPlanV2Step(stepID uint64) (*apistructs.TestPlanV2Step, e
return &getResp.Data, nil
}

// ListTestPlanV2Step list test plan step
func (b *Bundle) ListTestPlanV2Step(testPlanID, groupID uint64) ([]*apistructs.TestPlanV2Step, error) {
host, err := b.urls.DOP()
if err != nil {
return nil, err
}
hc := b.hc

var getResp apistructs.TestPlanV2StepListResponse
resp, err := hc.Get(host).Path(fmt.Sprintf("/api/autotests/testplans/%d/steps/actions/list-by-group-id", testPlanID)).
Param("groupID", strconv.FormatUint(groupID, 10)).
Header(httputil.InternalHeader, "bundle").Do().JSON(&getResp)

if err != nil {
return nil, apierrors.ErrInvoke.InternalError(err)
}
if !resp.IsOK() || !getResp.Success {
return nil, toAPIError(resp.StatusCode(), getResp.Error)
}

return getResp.Data, nil
}

// UpdateTestPlanV2Step 获取测试计划步骤
// GetTestPlanV2 获取测试计划步骤
func (b *Bundle) UpdateTestPlanV2Step(req apistructs.TestPlanV2StepUpdateRequest) error {
host, err := b.urls.DOP()
if err != nil {
Expand Down
Loading

0 comments on commit cecf4a7

Please sign in to comment.