提交 3dd55e88 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

fix unit test issues

上级 d3e9bc8e
......@@ -33,3 +33,4 @@ logs/
/.scannerwork/
/bin/
/log/
/product1/
......@@ -102,7 +102,7 @@ func main() {
case "ci":
files := fileUtils.GetFilesFromParams(os.Args[2:])
if err := flagSet.Parse(os.Args[len(files)+2:]); err == nil {
action.CommitCases(files)
action.CheckIn(files)
}
case "cr":
......
......@@ -2,15 +2,40 @@ package action
import (
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
scriptHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/script"
zentaoHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/zentao"
stdinUtils "github.com/easysoft/zentaoatf/pkg/lib/stdin"
stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string"
)
func CommitCases(files []string) {
func CheckIn(files []string) {
cases := scriptHelper.GetCaseByDirAndFile(files)
config := configHelper.LoadByWorkspacePath(commConsts.ZtfDir)
zentaoHelper.SyncToZentao(cases, config)
}
func Checkout(productId, moduleId, suiteId, taskId string, independentFile bool, scriptLang string) {
if (productId != "" || moduleId != "" || suiteId != "" || taskId != "") && scriptLang != "" {
//isReady = true
} else {
stdinUtils.InputForCheckout(&productId, &moduleId, &suiteId, &taskId,
&independentFile, &scriptLang)
}
settings := commDomain.SyncSettings{
ProductId: stringUtils.ParseInt(productId),
ModuleId: stringUtils.ParseInt(moduleId),
SuiteId: stringUtils.ParseInt(suiteId),
TaskId: stringUtils.ParseInt(taskId),
IndependentFile: independentFile,
Lang: scriptLang,
}
config := configHelper.LoadByWorkspacePath(commConsts.ZtfDir)
zentaoHelper.SyncFromZentao(settings, config, commConsts.WorkDir)
}
package action
import (
commConsts "github.com/easysoft/zentaoatf/internal/pkg/consts"
commDomain "github.com/easysoft/zentaoatf/internal/pkg/domain"
configHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/config"
zentaoHelper "github.com/easysoft/zentaoatf/internal/pkg/helper/zentao"
stdinUtils "github.com/easysoft/zentaoatf/pkg/lib/stdin"
stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string"
)
func Checkout(productId, moduleId, suiteId, taskId string, independentFile bool, scriptLang string) {
if (productId != "" || moduleId != "" || suiteId != "" || taskId != "") && scriptLang != "" {
//isReady = true
} else {
stdinUtils.InputForCheckout(&productId, &moduleId, &suiteId, &taskId,
&independentFile, &scriptLang)
}
settings := commDomain.SyncSettings{
ProductId: stringUtils.ParseInt(productId),
ModuleId: stringUtils.ParseInt(moduleId),
SuiteId: stringUtils.ParseInt(suiteId),
TaskId: stringUtils.ParseInt(taskId),
IndependentFile: independentFile,
Lang: scriptLang,
}
config := configHelper.LoadByWorkspacePath(commConsts.ZtfDir)
zentaoHelper.SyncFromZentao(settings, config, commConsts.WorkDir)
}
......@@ -8,6 +8,7 @@ import (
"github.com/easysoft/zentaoatf/pkg/consts"
commonUtils "github.com/easysoft/zentaoatf/pkg/lib/common"
fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file"
"html"
"io/ioutil"
"path"
"path/filepath"
......@@ -616,6 +617,9 @@ func GetCaseContent(stepObj commDomain.ZtfStep, seq string, independentFile bool
expectContent = expectStr
stepContent = html.UnescapeString(stepContent)
expectContent = html.UnescapeString(expectContent)
return
}
......
......@@ -10,6 +10,7 @@ type ZentaoRespData struct {
}
type ZentaoResultSubmitReq struct {
Title string `json:"title"`
Seq string `json:"seq"`
WorkspaceId int `json:"workspaceId"`
ProductId int `json:"productId"`
......
......@@ -224,6 +224,8 @@ export default {
'open-in-explore': 'Open In Explore',
'open-in-terminal': 'Open In Terminal',
'pls_select_task': 'Please select task',
'or_input_task_name': 'Or input new task name',
'pls_select_workspace': 'Please select workspace.',
'pls_add_zentao_site': 'Please add zentao site.',
'pls_create_workspace': 'Please create workspace to continue.',
......
......@@ -235,6 +235,9 @@ export default {
'open-in-explore': '在资源管理器中显示',
'open-in-terminal': '从此位置打开命令行',
'pls_select_task': '请选择任务',
'or_input_task_name': '或输入新任务标题',
'pls_select_workspace': '请选择导出到的工作目录。',
'pls_add_zentao_site': '初次使用,请点击右上按钮新建禅道站点。',
'pls_create_workspace': '请点击右上角链接新建工作目录',
......
......@@ -4,10 +4,10 @@
@onCancel="close"
@onOk="submit"
:title="t('submit_result_to_zentao')"
:contentStyle="{width: '300px'}"
:contentStyle="{width: '500px'}"
>
<Form labelCol="6" wrapperCol="16">
<FormItem name="taskId" :label="t('task')">
<Form>
<FormItem name="taskId" :label="t('pls_select_task')" labelWidth="120px">
<div class="select">
<select name="taskId" v-model="modelRef.taskId">
<option value="0"></option>
......@@ -17,6 +17,10 @@
</select>
</div>
</FormItem>
<FormItem v-if="!modelRef.taskId" name="title" :label="t('or_input_task_name')" labelWidth="120px">
<input type="text" v-model="modelRef.title" />
</FormItem>
</Form>
</ZModal>
</template>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册