From d45f1f635c16fd5c10a535d50b7daef0ca4775e1 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Mon, 31 Oct 2022 16:32:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E7=BB=9F=E4=B8=80=E4=BB=BB=E5=8A=A1=E4=B8=AD=E5=BF=83Jenkin?= =?UTF-8?q?s=E8=B0=83=E7=94=A8=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1019144 --user=赵勇 【接口测试】Jenkins中api调用执行接口CASE-任务中心显示JENKINS字样 https://www.tapd.cn/55049933/s/1283764 --- .../business/history/task/ApiTaskCenter.vue | 4 +- .../src/components/task/TaskCenter.vue | 4 +- .../base/mapper/ext/BaseTaskMapper.xml | 63 ++++++++++++++++--- 3 files changed, 60 insertions(+), 11 deletions(-) diff --git a/api-test/frontend/src/business/history/task/ApiTaskCenter.vue b/api-test/frontend/src/business/history/task/ApiTaskCenter.vue index caff10d2db..991e84c53f 100644 --- a/api-test/frontend/src/business/history/task/ApiTaskCenter.vue +++ b/api-test/frontend/src/business/history/task/ApiTaskCenter.vue @@ -161,7 +161,7 @@ export default { {id: 'BATCH', label: this.$t('api_test.automation.batch_execute')}, {id: 'SCHEDULE', label: this.$t('commons.trigger_mode.schedule')}, {id: 'MANUAL', label: this.$t('commons.trigger_mode.manual')}, - {id: 'API', label: 'API'} + {id: 'API', label: this.$t('commons.trigger_mode.api')} ], runStatus: [ {id: '', label: this.$t('api_test.definition.document.data_set.all')}, @@ -371,7 +371,7 @@ export default { if (mode === 'TEST_PLAN_SCHEDULE') { return this.$t('commons.trigger_mode.schedule'); } - if (mode === 'API') { + if (mode.startsWith('JENKINS')) { return this.$t('commons.trigger_mode.api'); } if (mode === 'BATCH') { diff --git a/framework/sdk-parent/frontend/src/components/task/TaskCenter.vue b/framework/sdk-parent/frontend/src/components/task/TaskCenter.vue index 1de9d91950..4e366192e2 100644 --- a/framework/sdk-parent/frontend/src/components/task/TaskCenter.vue +++ b/framework/sdk-parent/frontend/src/components/task/TaskCenter.vue @@ -164,7 +164,7 @@ export default { {id: 'BATCH', label: this.$t('api_test.automation.batch_execute')}, {id: 'SCHEDULE', label: this.$t('commons.trigger_mode.schedule')}, {id: 'MANUAL', label: this.$t('commons.trigger_mode.manual')}, - {id: 'API', label: 'API'} + {id: 'API', label: this.$t('commons.trigger_mode.api')} ], runStatus: [ {id: '', label: this.$t('api_test.definition.document.data_set.all')}, @@ -374,7 +374,7 @@ export default { if (mode === 'BATCH') { return this.$t('api_test.automation.batch_execute'); } - if (mode === 'JENKINS_RUN_TEST_PLAN') { + if (mode.startsWith('JENKINS')) { return this.$t('commons.trigger_mode.api'); } return mode; diff --git a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml index 24ab5a1a92..336885e773 100644 --- a/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml +++ b/framework/sdk-parent/sdk/src/main/java/io/metersphere/base/mapper/ext/BaseTaskMapper.xml @@ -15,7 +15,14 @@ #{id} - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -36,7 +43,14 @@ - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -57,7 +71,14 @@ #{id} - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -119,7 +140,14 @@ #{id} - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -140,7 +168,14 @@ #{id} - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -162,7 +197,14 @@ - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus} @@ -184,7 +226,14 @@ #{id} - AND t.trigger_mode = #{request.triggerMode} + + + AND t.trigger_mode in ('JENKINS_API_PLAN', 'JENKINS_SCENARIO_PLAN', 'JENKINS_PERFORMANCE_TEST', 'JENKINS') + + + AND t.trigger_mode = #{request.triggerMode} + + AND t.status = #{request.executionStatus}