From 31b06aada069d26ca5e02c99d02a8ed2cd7dcfc0 Mon Sep 17 00:00:00 2001 From: ysicing Date: Thu, 18 Jul 2024 15:28:00 +0800 Subject: [PATCH 1/3] * [feat]: update dev mode --- Taskfile.yml | 37 +++++++++++-------- go.mod | 28 +++++++------- go.sum | 59 +++++++++++++++--------------- internal/command/action/case.go | 8 +++- internal/pkg/consts/consts.go | 2 +- internal/pkg/helper/zentao/case.go | 12 +++--- internal/pkg/helper/zentao/sync.go | 7 +++- 7 files changed, 86 insertions(+), 67 deletions(-) diff --git a/Taskfile.yml b/Taskfile.yml index 29ed78275..622542dc2 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -73,11 +73,11 @@ tasks: build_cli: desc: Build the CLI - run: once + # run: once cmds: - GOOS={{.GOOS}} GOARCH={{.GOARCH}} go build -ldflags "{{.LDFLAGS}}" -o {{.BUILD_DIR}}/{{.GOOS}}/{{.GOARCH}}/ztf{{if eq .GOOS "windows"}}.exe{{end}} cmd/command/main.go - status: - - test -f {{.BUILD_DIR}}/{{.GOOS}}/{{.GOARCH}}/ztf{{if eq .GOOS "windows"}}.exe{{end}} + # status: + # - test -f {{.BUILD_DIR}}/{{.GOOS}}/{{.GOARCH}}/ztf{{if eq .GOOS "windows"}}.exe{{end}} zip: desc: zip @@ -90,19 +90,24 @@ tasks: default: cmds: - - task: prepare - - task: build_server - vars: { - GOOS: darwin, - GOARCH: arm64 - } - - task: package_gui_client - vars: { - GOOS: darwin, - GOARCH: arm64 - } + # - task: prepare + # - task: build_server + # vars: { + # GOOS: darwin, + # GOARCH: arm64 + # } + # - task: package_gui_client + # vars: { + # GOOS: darwin, + # GOARCH: arm64 + # } + # - task: build_cli + # vars: { + # GOOS: darwin, + # GOARCH: arm64 + # } - task: build_cli vars: { - GOOS: darwin, - GOARCH: arm64 + GOOS: linux, + GOARCH: amd64 } diff --git a/go.mod b/go.mod index 38968b30a..475e718e0 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ toolchain go1.22.1 require ( github.com/bitly/go-simplejson v0.5.0 + github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc github.com/emirpasic/gods v1.18.1 github.com/ergoapi/util v0.6.4 github.com/facebookgo/inject v0.0.0-20180706035515-f23751cae28b @@ -35,9 +36,9 @@ require ( github.com/spf13/viper v1.18.2 github.com/tidwall/gjson v1.14.4 go.uber.org/zap v1.27.0 - golang.org/x/text v0.14.0 + golang.org/x/text v0.16.0 google.golang.org/grpc v1.59.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 gopkg.in/ini.v1 v1.67.0 gopkg.in/natefinch/lumberjack.v2 v2.2.1 gorm.io/gorm v1.25.7 @@ -58,13 +59,12 @@ require ( github.com/aymerick/douceur v0.2.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/bmizerany/assert v0.0.0-20160611221934-b7ed37b82869 // indirect - github.com/cloudflare/circl v1.3.7 // indirect + github.com/cloudflare/circl v1.3.9 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cyphar/filepath-securejoin v0.2.4 // indirect github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect - github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/dblohm7/wingoes v0.0.0-20240119213807-a09d6be7affa // indirect github.com/dsnet/compress v0.0.2-0.20210315054119-f66993602bf5 // indirect github.com/dustin/go-humanize v1.0.1 // indirect @@ -92,6 +92,7 @@ require ( github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/go-querystring v1.1.0 // indirect + github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da // indirect github.com/google/uuid v1.6.0 // indirect github.com/gorilla/css v1.0.0 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect @@ -111,7 +112,7 @@ require ( github.com/kataras/sitemap v0.0.6 // indirect github.com/kataras/tunnel v0.0.4 // indirect github.com/kevinburke/ssh_config v1.2.0 // indirect - github.com/klauspost/compress v1.17.4 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect @@ -132,6 +133,7 @@ require ( github.com/nats-io/nuid v1.0.1 // indirect github.com/nwaples/rardecode v1.1.0 // indirect github.com/oklog/run v1.0.0 // indirect + github.com/onsi/gomega v1.33.1 // indirect github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/pierrec/lz4/v4 v4.1.21 // indirect github.com/pjbgf/sha1cd v0.3.0 // indirect @@ -151,7 +153,7 @@ require ( github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.6.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.8.4 // indirect + github.com/stretchr/testify v1.9.0 // indirect github.com/subosito/gotenv v1.6.0 // indirect github.com/tdewolff/minify/v2 v2.12.4 // indirect github.com/tdewolff/parse/v2 v2.6.4 // indirect @@ -173,14 +175,14 @@ require ( github.com/yudai/golcs v0.0.0-20170316035057-ecda9a501e82 // indirect go.uber.org/multierr v1.11.0 // indirect go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f // indirect - golang.org/x/mod v0.16.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/crypto v0.25.0 // indirect + golang.org/x/exp v0.0.0-20240716175740-e3f259677ff7 // indirect + golang.org/x/mod v0.19.0 // indirect + golang.org/x/net v0.27.0 // indirect + golang.org/x/sync v0.7.0 // indirect + golang.org/x/sys v0.22.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.19.0 // indirect + golang.org/x/tools v0.23.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index 720002f54..13a52baf9 100644 --- a/go.sum +++ b/go.sum @@ -53,8 +53,8 @@ github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927/go.mod h1:h/aW8ynjgk github.com/chris-ramon/douceur v0.2.0/go.mod h1:wDW5xjJdeoMm1mRt4sD4c/LbF/mWdEpRXQKjTR8nIBE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= +github.com/cloudflare/circl v1.3.9 h1:QFrlgFYf2Qpi8bSpVPK1HBvWpx16v/1TZivyo7pGuBE= +github.com/cloudflare/circl v1.3.9/go.mod h1:PDRU+oXvdD7KCtgKxW95M5Z8BpSCJXQORiZFnBQS5QU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -210,8 +210,8 @@ github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO github.com/google/go-querystring v1.1.0 h1:AnCroh3fv4ZBgVIf1Iwtovgjaw/GiKJo8M8yD/fhyJ8= github.com/google/go-querystring v1.1.0/go.mod h1:Kcdr2DB4koayq7X8pmAG4sNG59So17icRSOU623lUBU= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42 h1:dHLYa5D8/Ta0aLR2XcPsrkpAgGeFs6thhMcQK0oQ0n8= -github.com/google/pprof v0.0.0-20231229205709-960ae82b1e42/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da h1:xRmpO92tb8y+Z85iUOMOicpCfaYcv7o3Cg3wKrIpg8g= +github.com/google/pprof v0.0.0-20240711041743-f6c9dda6c6da/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= @@ -296,8 +296,8 @@ github.com/klauspost/compress v1.11.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.12.2/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.0/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= -github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= -github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v1.2.0/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/pgzip v1.2.4/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU= @@ -387,8 +387,8 @@ github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7J github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.3/go.mod h1:V9xEwhxec5O8UDM77eCW8vLymOMltsqPVYWrpDsH8xc= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= +github.com/onsi/gomega v1.33.1 h1:dsYjIxxSR755MDmKVsaFQTE22ChNBcuuTWgkUDSubOk= +github.com/onsi/gomega v1.33.1/go.mod h1:U4R44UsT+9eLIaYRB2a5qajjtQYn0hauxvRm16AVYg0= github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/mint v1.5.1 h1:XaPLeE+9vGbuyEHem1JNk3bYc7KKqyI/na0/mLd/Kks= @@ -487,8 +487,9 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/tdewolff/minify/v2 v2.9.10/go.mod h1:U1Nc+/YBSB0FPEarqcgkYH3Ep4DNyyIbOyl5P4eWMuo= @@ -575,11 +576,11 @@ golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0 golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +golang.org/x/crypto v0.25.0 h1:ypSNr+bnYL2YhwoMt2zPxHFmbAN1KZs/njMG3hxUp30= +golang.org/x/crypto v0.25.0/go.mod h1:T+wALwcMOSE0kXgUAnPAHqTLW+XHgcELELW8VaDgm/M= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240716175740-e3f259677ff7 h1:wDLEX9a7YQoKdKNQt88rtydkqDxeGaBUTnIYc3iG/mA= +golang.org/x/exp v0.0.0-20240716175740-e3f259677ff7/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= @@ -588,8 +589,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= -golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= +golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -616,8 +617,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= +golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -627,8 +628,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -668,16 +669,16 @@ golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.22.0 h1:RI27ohtqKCnwULzJLqkv897zojh5/DwS/ENaMzUOaWI= +golang.org/x/sys v0.22.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +golang.org/x/term v0.22.0 h1:BbsgPEJULsl2fV/AT3v15Mjva5yXKQDyKf+TbDz7QJk= +golang.org/x/term v0.22.0/go.mod h1:F3qCibpT5AMpCRfhfT53vVJwhLtIVHhB9XDjfFvnMI4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -687,8 +688,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4= +golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= @@ -704,8 +705,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.19.0 h1:tfGCXNR1OsFG+sVdLAitlpjAvD/I6dHDKnYrpEZUHkw= -golang.org/x/tools v0.19.0/go.mod h1:qoJWxmGSIBmAeriMx19ogtrEPrGtDbPK634QFIcLAhc= +golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= +golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -735,8 +736,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/command/action/case.go b/internal/command/action/case.go index 5b126fb21..1d5c005ec 100644 --- a/internal/command/action/case.go +++ b/internal/command/action/case.go @@ -6,6 +6,7 @@ import ( 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" + logUtils "github.com/easysoft/zentaoatf/pkg/lib/log" stdinUtils "github.com/easysoft/zentaoatf/pkg/lib/stdin" stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string" ) @@ -37,5 +38,10 @@ func Checkout(productId, moduleId, suiteId, taskId string, independentFile bool, config := configHelper.LoadByWorkspacePath(commConsts.ZtfDir) - zentaoHelper.Checkout(settings, config, commConsts.WorkDir) + _, err := zentaoHelper.Checkout(settings, config, commConsts.WorkDir) + if err != nil { + logUtils.Errorf("checkout failed: %v", err) + return + } + logUtils.Info("checkout success") } diff --git a/internal/pkg/consts/consts.go b/internal/pkg/consts/consts.go index fc5ae25ed..8632b26cb 100644 --- a/internal/pkg/consts/consts.go +++ b/internal/pkg/consts/consts.go @@ -40,7 +40,7 @@ const ( PluginDir = "plugin" DownloadDir = "download" BinDir = "bin" - ZapDownloadUrl = "https://dl.cnezsoft.com/ztf/plugin/zap/zap-%s.zip" + ZapDownloadUrl = "https://dl.zentao.net/ztf/plugin/zap/zap-%s.zip" ) var ( diff --git a/internal/pkg/helper/zentao/case.go b/internal/pkg/helper/zentao/case.go index a47b3f2df..3b1f175bd 100644 --- a/internal/pkg/helper/zentao/case.go +++ b/internal/pkg/helper/zentao/case.go @@ -7,6 +7,7 @@ import ( "strconv" "strings" + "github.com/davecgh/go-spew/spew" serverConfig "github.com/easysoft/zentaoatf/internal/server/config" "github.com/fatih/color" @@ -144,7 +145,7 @@ func GetCaseById(config commDomain.WorkspaceConf, caseId int) (cs commDomain.Ztf uri := fmt.Sprintf("/testcases/%d", caseId) url := GenApiUrl(uri, nil, config.Url) - + logUtils.Infof("req url: %s", url) bytes, err := httpUtils.Get(url) if err != nil { err = ZentaoRequestErr(err.Error()) @@ -610,17 +611,18 @@ func convertMap2Case(caseItem interface{}) (caseStruct commDomain.ZtfCaseInModul } func ListCaseByModule(baseUrl string, productId, moduleId int) (casesResp commDomain.ZtfRespTestCases, err error) { - uri := fmt.Sprintf("/products/%d/testcases?module=%d", productId, moduleId) + uri := fmt.Sprintf("/products/%d/testcases", productId) url := GenApiUrl(uri, map[string]interface{}{ - "limit": 10000, + "module": moduleId, + "limit": 10000, }, baseUrl) - + spew.Dump(url) bytes, err := httpUtils.Get(url) if err != nil { err = ZentaoRequestErr(err.Error()) return } - + spew.Dump(string(bytes)) casesResp, err = parseCases(bytes) if err != nil { err = ZentaoRequestErr(url, commConsts.ResponseParseErr.Message) diff --git a/internal/pkg/helper/zentao/sync.go b/internal/pkg/helper/zentao/sync.go index b9ab061bb..d8bea0619 100644 --- a/internal/pkg/helper/zentao/sync.go +++ b/internal/pkg/helper/zentao/sync.go @@ -1,9 +1,11 @@ package zentaoHelper import ( + "errors" "fmt" "path/filepath" + "github.com/davecgh/go-spew/spew" fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file" i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118" logUtils "github.com/easysoft/zentaoatf/pkg/lib/log" @@ -32,7 +34,7 @@ func Checkout(settings commDomain.SyncSettings, config commDomain.WorkspaceConf, if !ok { return } - + spew.Dump(settings) cases := make([]commDomain.ZtfCase, 0) if caseId != 0 { cs, err := GetTestCaseDetail(caseId, config) @@ -50,7 +52,8 @@ func Checkout(settings commDomain.SyncSettings, config commDomain.WorkspaceConf, return } - if cases == nil || len(cases) == 0 { + if len(cases) == 0 { + err = errors.New("no_cases_found") return } From 1460ccdd44eac9e4ab8e0f544d4360f5c112ba2c Mon Sep 17 00:00:00 2001 From: ysicing Date: Mon, 22 Jul 2024 16:40:53 +0800 Subject: [PATCH 2/3] =?UTF-8?q?+=20[feat#55955]=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E5=88=86=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/pkg/domain/zentao.go | 1 + internal/pkg/helper/script/parser.go | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/internal/pkg/domain/zentao.go b/internal/pkg/domain/zentao.go index 32dab3108..9e47bbf60 100644 --- a/internal/pkg/domain/zentao.go +++ b/internal/pkg/domain/zentao.go @@ -15,6 +15,7 @@ type ZentaoUserProfile struct { type ZentaoCaseStep struct { Type commConsts.CaseStepType `json:"type"` + Name string `json:"name"` Desc string `json:"desc"` Expect string `json:"expect"` } diff --git a/internal/pkg/helper/script/parser.go b/internal/pkg/helper/script/parser.go index b34e3a0d8..b2cdd016d 100644 --- a/internal/pkg/helper/script/parser.go +++ b/internal/pkg/helper/script/parser.go @@ -50,6 +50,8 @@ func ReadTitleAndStepsInNewFormat(content, lang string) (caseId int, title strin comments := strings.TrimSpace(getScriptComments(content, lang)) index := 0 + groupName := 1 + itemName := 1 titleLineStart := false lines := strings.Split(comments, "\n") for index < len(lines) { @@ -84,6 +86,12 @@ func ReadTitleAndStepsInNewFormat(content, lang string) (caseId int, title strin step.Type = commConsts.Group if isChild { step.Type = commConsts.Item + step.Name = fmt.Sprintf("%d.%d", groupName-1, itemName) + itemName += 1 + } else { + step.Name = fmt.Sprintf("%d", groupName) + groupName += 1 + itemName = 1 } steps = append(steps, step) From 6a33d12202a7a7a4f3c22929ca2d5ad27b6b6408 Mon Sep 17 00:00:00 2001 From: ysicing Date: Mon, 22 Jul 2024 17:55:02 +0800 Subject: [PATCH 3/3] + [feat#55957] not found cid support create testcase --- cmd/command/main.go | 2 +- internal/command/action/case.go | 4 ++-- internal/pkg/helper/zentao/bug.go | 2 +- internal/pkg/helper/zentao/case.go | 18 ++++++++++++------ internal/pkg/helper/zentao/sync.go | 8 +++----- .../modules/v1/controller/test-script.go | 13 ++++++++----- 6 files changed, 27 insertions(+), 20 deletions(-) diff --git a/cmd/command/main.go b/cmd/command/main.go index 645bd6077..da799530b 100644 --- a/cmd/command/main.go +++ b/cmd/command/main.go @@ -168,7 +168,7 @@ func checkout() { func ci() { files := fileUtils.GetFilesFromParams(os.Args[2:]) if err := flagSet.Parse(os.Args[len(files)+2:]); err == nil { - action.CheckIn(files, noNeedConfirm, withCode) + action.CheckIn(productId, files, noNeedConfirm, withCode) } } diff --git a/internal/command/action/case.go b/internal/command/action/case.go index 1d5c005ec..38b4b8546 100644 --- a/internal/command/action/case.go +++ b/internal/command/action/case.go @@ -11,12 +11,12 @@ import ( stringUtils "github.com/easysoft/zentaoatf/pkg/lib/string" ) -func CheckIn(files []string, noNeedConfirm, withCode bool) { +func CheckIn(productId string, files []string, noNeedConfirm, withCode bool) { cases := scriptHelper.GetCaseByDirAndFile(files) config := configHelper.LoadByWorkspacePath(commConsts.ZtfDir) - zentaoHelper.CheckIn(cases, config, noNeedConfirm, withCode) + zentaoHelper.CheckIn(productId, cases, config, noNeedConfirm, withCode) } func Checkout(productId, moduleId, suiteId, taskId string, independentFile bool, scriptLang string) { diff --git a/internal/pkg/helper/zentao/bug.go b/internal/pkg/helper/zentao/bug.go index cda4c4d9c..115aaa67f 100644 --- a/internal/pkg/helper/zentao/bug.go +++ b/internal/pkg/helper/zentao/bug.go @@ -330,7 +330,7 @@ func generateCaseId(bugs []*commDomain.ZentaoBug, config commDomain.WorkspaceCon } } if bug.Case == 0 { - caseInfo, _ := CreateCase(bug.Product, bug.Title, nil, serverDomain.TestScript{}, config) + caseInfo, _ := CreateCase(fmt.Sprintf("%v", bug.Product), bug.Title, nil, serverDomain.TestScript{}, config) bug.Case = caseInfo.Id } } diff --git a/internal/pkg/helper/zentao/case.go b/internal/pkg/helper/zentao/case.go index 3b1f175bd..deaa27bcb 100644 --- a/internal/pkg/helper/zentao/case.go +++ b/internal/pkg/helper/zentao/case.go @@ -7,7 +7,6 @@ import ( "strconv" "strings" - "github.com/davecgh/go-spew/spew" serverConfig "github.com/easysoft/zentaoatf/internal/server/config" "github.com/fatih/color" @@ -28,7 +27,7 @@ import ( "github.com/kataras/iris/v12" ) -func CommitCase(caseId int, title string, steps []commDomain.ZentaoCaseStep, script serverDomain.TestScript, +func CommitCase(productId string, caseId int, title string, steps []commDomain.ZentaoCaseStep, script serverDomain.TestScript, config commDomain.WorkspaceConf, noNeedConfirm, withCode bool) (err error) { if serverConfig.CONFIG.AuthToken == "" { @@ -40,6 +39,15 @@ func CommitCase(caseId int, title string, steps []commDomain.ZentaoCaseStep, scr _, err = GetCaseById(config, caseId) if err != nil { + if !strings.Contains(err.Error(), "404") { + return + } + if len(productId) == 0 { + logUtils.Info("not found productId, like: pid=1") + return fmt.Errorf("not found productId, like: pid=1") + } + // 创建cases + _, err = CreateCase(productId, title, steps, script, config) return } @@ -87,7 +95,7 @@ func CommitCase(caseId int, title string, steps []commDomain.ZentaoCaseStep, scr return } -func CreateCase(productId int, title string, steps []commDomain.ZentaoCaseStep, script serverDomain.TestScript, +func CreateCase(productId, title string, steps []commDomain.ZentaoCaseStep, script serverDomain.TestScript, config commDomain.WorkspaceConf) (cs commDomain.ZtfCase, err error) { err = Login(config) @@ -95,7 +103,7 @@ func CreateCase(productId int, title string, steps []commDomain.ZentaoCaseStep, return } - uri := fmt.Sprintf("/products/%d/testcases", productId) + uri := fmt.Sprintf("/products/%v/testcases", productId) url := GenApiUrl(uri, nil, config.Url) requestObj := map[string]interface{}{ @@ -616,13 +624,11 @@ func ListCaseByModule(baseUrl string, productId, moduleId int) (casesResp commDo "module": moduleId, "limit": 10000, }, baseUrl) - spew.Dump(url) bytes, err := httpUtils.Get(url) if err != nil { err = ZentaoRequestErr(err.Error()) return } - spew.Dump(string(bytes)) casesResp, err = parseCases(bytes) if err != nil { err = ZentaoRequestErr(url, commConsts.ResponseParseErr.Message) diff --git a/internal/pkg/helper/zentao/sync.go b/internal/pkg/helper/zentao/sync.go index d8bea0619..7b1bfcd7a 100644 --- a/internal/pkg/helper/zentao/sync.go +++ b/internal/pkg/helper/zentao/sync.go @@ -5,7 +5,6 @@ import ( "fmt" "path/filepath" - "github.com/davecgh/go-spew/spew" fileUtils "github.com/easysoft/zentaoatf/pkg/lib/file" i118Utils "github.com/easysoft/zentaoatf/pkg/lib/i118" logUtils "github.com/easysoft/zentaoatf/pkg/lib/log" @@ -34,7 +33,6 @@ func Checkout(settings commDomain.SyncSettings, config commDomain.WorkspaceConf, if !ok { return } - spew.Dump(settings) cases := make([]commDomain.ZtfCase, 0) if caseId != 0 { cs, err := GetTestCaseDetail(caseId, config) @@ -72,16 +70,16 @@ func Checkout(settings commDomain.SyncSettings, config commDomain.WorkspaceConf, return } -func CheckIn(cases []string, config commDomain.WorkspaceConf, noNeedConfirm, withCode bool) (count int, err error) { +func CheckIn(productId string, cases []string, config commDomain.WorkspaceConf, noNeedConfirm, withCode bool) (count int, err error) { for _, cs := range cases { - pass, id, _, title, _ := scriptHelper.GetCaseInfo(cs) + pass, caseId, _, title, _ := scriptHelper.GetCaseInfo(cs) if !pass { continue } steps := scriptHelper.GetStepAndExpectMap(cs) script, _ := scriptHelper.GetScriptContent(cs, -1) - err = CommitCase(id, title, steps, script, config, noNeedConfirm, withCode) + err = CommitCase(productId, caseId, title, steps, script, config, noNeedConfirm, withCode) if err == nil { count++ diff --git a/internal/server/modules/v1/controller/test-script.go b/internal/server/modules/v1/controller/test-script.go index 29c9ca790..7d1723432 100644 --- a/internal/server/modules/v1/controller/test-script.go +++ b/internal/server/modules/v1/controller/test-script.go @@ -2,9 +2,10 @@ package controller import ( "fmt" - serverConfig "github.com/easysoft/zentaoatf/internal/server/config" "strings" + serverConfig "github.com/easysoft/zentaoatf/internal/server/config" + 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" @@ -249,9 +250,9 @@ func (c *TestScriptCtrl) SyncFromZentao(ctx iris.Context) { func (c *TestScriptCtrl) SyncToZentao(ctx iris.Context) { currSiteId, _ := ctx.URLParamInt("currSiteId") - currProductId, _ := ctx.URLParamInt("currProductId") + currProductId := ctx.URLParam("currProductId") - if currProductId == 0 { + if len(currProductId) == 0 { ctx.JSON(c.ErrResp(commConsts.ParamErr, "")) return } @@ -271,7 +272,7 @@ func (c *TestScriptCtrl) SyncToZentao(ctx iris.Context) { for _, set := range sets { totalNum += len(set.Cases) - count, _ := zentaoHelper.CheckIn(set.Cases, config, true, true) + count, _ := zentaoHelper.CheckIn(currProductId, set.Cases, config, true, true) successNum += count } @@ -284,6 +285,7 @@ func (c *TestScriptCtrl) SyncToZentao(ctx iris.Context) { func (c *TestScriptCtrl) SyncDirToZentao(ctx iris.Context) { dir := ctx.URLParam("dir") + productId := ctx.URLParam("productId") cases := scriptHelper.GetCaseByDirAndFile([]string{dir}) @@ -291,7 +293,8 @@ func (c *TestScriptCtrl) SyncDirToZentao(ctx iris.Context) { Url: serverConfig.CONFIG.Server, } - zentaoHelper.CheckIn(cases, config, true, true) + // TODO 产品ID 新增 + zentaoHelper.CheckIn(productId, cases, config, true, true) return }