Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: scene set supports parallel in autoTest #2173

Merged

Conversation

littlejiancc
Copy link
Contributor

What type of this PR

/kind feature

What this PR does / why we need it:

feature: scene set supports parallel in autoTest

Which issue(s) this PR fixes:

自动化测试计划中,场景集支持并行

  • Fixes #your-issue_number
  • [Erda Cloud Issue Link](paste your link here)

Specified Reviewers:

/assign @sfwn

ChangeLog

Language Changelog
🇺🇸 English feature: scene set supports parallel in autoTest
🇨🇳 中文 自动化测试场景集支持并行

Need cherry-pick to release versions?

/cherry-pick release/1.3
Add comment like /cherry-pick release/1.0 when this PR is merged.

For details on the cherry pick process, see the cherry pick requests section under CONTRIBUTING.md.

@erda-bot
Copy link
Member

Automated cherry pick can ONLY be triggered when this PR is MERGED!

@erda-bot erda-bot requested a review from sfwn September 28, 2021 07:30
@littlejiancc littlejiancc added dop devops plaoform feature labels Sep 28, 2021
@codecov
Copy link

codecov bot commented Sep 28, 2021

Codecov Report

Merging #2173 (4bb1a11) into master (09a08c9) will decrease coverage by 0.34%.
The diff coverage is 39.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2173      +/-   ##
==========================================
- Coverage   15.96%   15.62%   -0.35%     
==========================================
  Files        1200     1213      +13     
  Lines      119118   122483    +3365     
==========================================
+ Hits        19021    19132     +111     
- Misses      98143   101396    +3253     
- Partials     1954     1955       +1     
Impacted Files Coverage Δ
apistructs/testplan_v2.go 0.00% <ø> (ø)
modules/dop/endpoints/endpoints.go 1.07% <0.00%> (-0.01%) ⬇️
modules/dop/endpoints/testplan_v2.go 0.00% <0.00%> (ø)
.../auto-test-plan-detail/components/stages/render.go 4.31% <0.00%> (ø)
modules/dop/services/autotest_v2/testplan_v2.go 2.25% <24.00%> (ø)
.../auto-test-plan-detail/components/stages/stages.go 35.44% <50.96%> (ø)
apistructs/sceneset.go 38.09% <100.00%> (+38.09%) ⬆️
...ules/extensions/loghub/index/query/log_query_v2.go 22.51% <0.00%> (-4.64%) ⬇️
modules/extensions/loghub/index/query/routes.go 0.00% <0.00%> (ø)
modules/dop/services/autotest_v2/scene.go 0.00% <0.00%> (ø)
... and 15 more

SceneSetsAutotestExecType = "sceneSets"
SceneAutotestExecType = "scene"

nameMaxLength int = 50
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xxxNameMaxLength

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

var step, nextStep TestPlanV2Step
defer func() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong usage of defer function with error. You never have chance to handle defer error.

Should change to:

return client.Transaction(func(tx *grom.DB) (err error) {
        defer func() {
                if err == nil {
                         err = updateStepGroup(tx, step.GroupID)
                }
        }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

return client.Transaction(func(tx *gorm.DB) (err error) {
var oldGroupID, newGroupID uint64
// update step groupID in the group if isGroup is false
defer func() error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -407,6 +407,7 @@ func (e *Endpoints) Routes() []httpserver.Endpoint {
{Path: "/api/autotests/testplans/{testPlanID}/actions/move-step", Method: http.MethodPut, Handler: e.MoveTestPlanV2Step},
{Path: "/api/autotests/testplans-step/{stepID}", Method: http.MethodGet, Handler: e.GetTestPlanV2Step},
{Path: "/api/autotests/testplans-step/{stepID}", Method: http.MethodPut, Handler: e.UpdateTestPlanV2Step},
{Path: "/api/autotests/testplans-steps/{testPlanID}/actions/by-groupID", Method: http.MethodGet, Handler: e.ListTestPlanV2Step},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bad restful api.

maybe /api/autotests/testplans/{testPlanID}/steps/actions/list-by-group-id

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

sfwn
sfwn previously approved these changes Oct 15, 2021
@sfwn
Copy link
Member

sfwn commented Oct 15, 2021

/approve

@erda-bot erda-bot merged commit 5871117 into erda-project:master Oct 15, 2021
@sfwn
Copy link
Member

sfwn commented Oct 15, 2021

/cherry-pick release/1.3

erda-bot pushed a commit to erda-bot/erda that referenced this pull request Oct 15, 2021
* feature: scene set supports parallel in autoTest

* add ListTestPlanV2Step api

* update move group

* add split op of render

* fix: add unit test

* add unit test

* add unit test for render

* add migrations

* polish code

* fix: update timeout of Test_initCron
johnlanni pushed a commit that referenced this pull request Oct 16, 2021
* feature: scene set supports parallel in autoTest

* add ListTestPlanV2Step api

* update move group

* add split op of render

* fix: add unit test

* add unit test

* add unit test for render

* add migrations

* polish code

* fix: update timeout of Test_initCron

Co-authored-by: littlejian <17816869670@163.com>
littlejiancc added a commit to littlejiancc/erda that referenced this pull request Oct 18, 2021
Effet added a commit to Effet/erda that referenced this pull request Oct 18, 2021
Effet added a commit that referenced this pull request Oct 18, 2021
@littlejiancc
Copy link
Contributor Author

/cherry-pick release/1.3

erda-bot pushed a commit to erda-bot/erda that referenced this pull request Oct 19, 2021
* feature: scene set supports parallel in autoTest

* add ListTestPlanV2Step api

* update move group

* add split op of render

* fix: add unit test

* add unit test

* add unit test for render

* add migrations

* polish code

* fix: update timeout of Test_initCron
erda-bot added a commit that referenced this pull request Oct 19, 2021
* feature: scene set supports parallel in autoTest

* add ListTestPlanV2Step api

* update move group

* add split op of render

* fix: add unit test

* add unit test

* add unit test for render

* add migrations

* polish code

* fix: update timeout of Test_initCron

Co-authored-by: littlejian <17816869670@163.com>
@littlejiancc littlejiancc deleted the feature/dop-sceneSet-arallel branch March 29, 2022 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants