diff --git a/Makefile b/Makefile index 50fea99..692c1a8 100644 --- a/Makefile +++ b/Makefile @@ -27,9 +27,14 @@ install: .PHONY: coverage coverage: - @go test -coverprofile=coverage.out ./... + @go test ./... -coverprofile=coverage.out @go tool cover -func=coverage.out +.PHONY: coverhtml +coverhtml: + @go test ./... -coverprofile=coverage.out + @go tool cover -html=coverage.out + .PHONY: docker docker: @docker build -t ghcr.io/qase-tms/qase-cli:$(version) -t ghcr.io/qase-tms/qase-cli:$latest -f ./build/Dockerfile --build-arg VERSION=$(version) . diff --git a/internal/service/result/result_test.go b/internal/service/result/result_test.go index daecb6d..7ce6872 100644 --- a/internal/service/result/result_test.go +++ b/internal/service/result/result_test.go @@ -48,6 +48,40 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 20, + Suite: "", + }, + err: nil, + isUsed: true, + count: 1, + runID: 1, + }, + pArgs: pArgs{ + models: prepareModels(), + err: nil, + isUsed: true, + }, + rArgs: rArgs{ + model: 1, + err: nil, + isUsed: true, + }, + cArgs: cArgs{ + err: nil, + isUsed: true, + }, + wantErr: false, + errMessage: "", + }, + { + name: "success with create test run and suite", + args: args{ + p: UploadParams{ + Project: "project", + Title: "title", + Description: "description", + RunID: 0, + Batch: 20, + Suite: "suite", }, err: nil, isUsed: true, @@ -80,6 +114,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 1, Batch: 20, + Suite: "", }, err: nil, isUsed: true, @@ -112,6 +147,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 1, Batch: 20, + Suite: "", }, err: nil, isUsed: false, @@ -144,6 +180,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 1, Batch: 20, + Suite: "", }, err: nil, isUsed: false, @@ -176,6 +213,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 20, + Suite: "", }, err: nil, isUsed: false, @@ -208,6 +246,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 1, + Suite: "", }, err: nil, isUsed: true, @@ -240,6 +279,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 1, + Suite: "", }, err: errors.New("failed upload data"), isUsed: true, @@ -272,6 +312,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 20, + Suite: "", }, err: errors.New("failed upload data"), isUsed: true, @@ -304,6 +345,7 @@ func TestService_Upload(t *testing.T) { Description: "description", RunID: 0, Batch: 20, + Suite: "", }, err: nil, isUsed: true,