Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
aad77ed
test report execution logic
Apr 7, 2025
802831e
fix(int): fix int types
Apr 7, 2025
e7a30eb
Merge branch 'fix_int_types' into feat_test_report_1
Apr 7, 2025
309d53a
changes
Apr 8, 2025
aeb5c30
chore(urfave cli): bump to v3
KellyMerrick Apr 8, 2025
e2749c2
converting some of the flags
KellyMerrick Apr 8, 2025
aa3edbf
Merge branch 'fix_int_types' of github.com:go-vela/worker into bump-u…
KellyMerrick Apr 8, 2025
86a2d9b
more v3
KellyMerrick Apr 8, 2025
f022c7a
more changes to v3
Apr 8, 2025
4a522db
Merge branch 'bump-urfave-v3' into feat_test_report_1
Apr 8, 2025
060aceb
chore(deps): update server to current main
KellyMerrick Apr 8, 2025
e2ec2b9
Merge branch 'bump-urfave-v3' into feat_test_report_1
Apr 9, 2025
a52952d
point to latest sdk-go
Apr 9, 2025
ec9dafa
add back missing code
Apr 9, 2025
6d37f5a
Merge branch 'main' into feat_test_report_1
timhuynh94 Apr 9, 2025
f42e676
add back missing code
Apr 9, 2025
76529b1
upload with build number
Apr 11, 2025
012d17e
fix(test reports): use build number instead of build id
KellyMerrick May 20, 2025
c26d850
feat(test reports): try testreport add db record
KellyMerrick Jun 17, 2025
7886bd1
Merge branch 'main' into feat_test_report_1
timhuynh94 Jun 24, 2025
e7fa8e6
Merge branch 'main' into feat_test_report_1
timhuynh94 Jul 3, 2025
9e63c7b
update docker package
Jul 3, 2025
b85a4c6
Merge branch 'main' into feat_test_report_1
timhuynh94 Jul 8, 2025
54eccc6
refactor code
Jul 14, 2025
02bc917
add testattachment
Jul 15, 2025
a3300f5
Merge branch 'main' into feat_test_report_1
timhuynh94 Aug 22, 2025
9c829e5
make clean
Aug 22, 2025
746ba27
point to sdk go branch
Aug 22, 2025
c0affe8
Merge branch 'main' into feat_test_report_1
timhuynh94 Aug 26, 2025
788af04
gomod tidy
Aug 26, 2025
085a207
fixing linters
Aug 27, 2025
e9a7ced
Potential fix for code scanning alert no. 5: Clear-text logging of se…
timhuynh94 Aug 27, 2025
fe11078
add and fix tests
Aug 28, 2025
14d8645
golanci run fix
Aug 28, 2025
ee65782
Merge branch 'main' into feat_test_report_1
timhuynh94 Sep 29, 2025
5e08770
point to server branch
Sep 29, 2025
319412f
non working code
Oct 14, 2025
2b63a1c
non working code
Oct 14, 2025
4bfe330
working but skip step
Oct 15, 2025
0fe9168
working with enabled
Oct 15, 2025
419a687
working with enabled
Oct 16, 2025
605d9a4
fix skip test
Oct 23, 2025
76efee5
point to server branch
Oct 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions cmd/vela-worker/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"sync"
"time"

"github.com/go-vela/server/storage"

Check failure on line 13 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L13

File is not properly formatted (gci)
Raw output
cmd/vela-worker/exec.go:13:1: File is not properly formatted (gci)
	"github.com/go-vela/server/storage"
^

Check failure on line 13 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / full-review

File is not properly formatted (gci)

Check failure on line 13 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / diff-review

File is not properly formatted (gci)

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

"github.com/sirupsen/logrus"

"github.com/go-vela/sdk-go/vela"
Expand All @@ -25,9 +26,11 @@
// exec is a helper function to poll the queue
// and execute Vela pipelines for the Worker.
//
//nolint:nilerr,funlen // ignore returning nil - don't want to crash worker
//nolint:funlen // ignore returning nil - don't want to crash worker
func (w *Worker) exec(index int, config *api.Worker) error {

Check failure on line 30 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L30

cyclomatic complexity 35 of func `(*Worker).exec` is high (> 30) (gocyclo)
Raw output
cmd/vela-worker/exec.go:30:1: cyclomatic complexity 35 of func `(*Worker).exec` is high (> 30) (gocyclo)
func (w *Worker) exec(index int, config *api.Worker) error {
^

Check failure on line 30 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / full-review

cyclomatic complexity 35 of func `(*Worker).exec` is high (> 30) (gocyclo)

Check failure on line 30 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / diff-review

cyclomatic complexity 35 of func `(*Worker).exec` is high (> 30) (gocyclo)

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
cyclomatic complexity 35 of func (*Worker).exec is high (> 30) (gocyclo)

var err error
var execStorage storage.Storage

Check failure on line 32 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L32

declarations should never be cuddled (wsl)
Raw output
cmd/vela-worker/exec.go:32:2: declarations should never be cuddled (wsl)
	var execStorage storage.Storage
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
declarations should never be cuddled (wsl)

var _executor executor.Engine

Check failure on line 33 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L33

declarations should never be cuddled (wsl)
Raw output
cmd/vela-worker/exec.go:33:2: declarations should never be cuddled (wsl)
	var _executor executor.Engine
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
declarations should never be cuddled (wsl)


// setup the version
v := version.New()
Expand Down Expand Up @@ -156,6 +159,13 @@
execOutputCtn := *w.Config.Executor.OutputCtn
execOutputCtn.ID = fmt.Sprintf("outputs_%s", p.ID)

if w.Storage != nil {
execStorage = w.Storage
logrus.Debugf("executor storage is available, setting up storage")

Check failure on line 164 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L164

only cuddled expressions if assigning variable or using from line above (wsl)
Raw output
cmd/vela-worker/exec.go:164:3: only cuddled expressions if assigning variable or using from line above (wsl)
		logrus.Debugf("executor storage is available, setting up storage")
		^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
only cuddled expressions if assigning variable or using from line above (wsl)

} else {
logrus.Debugf("executor storage is nil, skipping storage setup")
}

// create logger with extra metadata
//
// https://pkg.go.dev/github.com/sirupsen/logrus#WithFields
Expand Down Expand Up @@ -229,11 +239,10 @@
if err != nil {
return err
}

// setup the executor
//
// https://pkg.go.dev/github.com/go-vela/worker/executor#New
_executor, err := executor.New(&executor.Setup{
setup := &executor.Setup{
Logger: logger,
Mock: w.Config.Mock,
Driver: w.Config.Executor.Driver,
Expand All @@ -248,8 +257,17 @@
Pipeline: p.Sanitize(w.Config.Runtime.Driver),
Version: v.Semantic(),
OutputCtn: &execOutputCtn,
})
}

if execStorage != nil {
fmt.Printf("setting up executor storage\n")
setup.Storage = execStorage

Check failure on line 264 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L264

assignments should only be cuddled with other assignments (wsl)
Raw output
cmd/vela-worker/exec.go:264:3: assignments should only be cuddled with other assignments (wsl)
		setup.Storage = execStorage
		^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
assignments should only be cuddled with other assignments (wsl)

}
_executor, err = executor.New(setup)

Check failure on line 266 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L266

assignments should only be cuddled with other assignments (wsl)
Raw output
cmd/vela-worker/exec.go:266:2: assignments should only be cuddled with other assignments (wsl)
	_executor, err = executor.New(setup)
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
assignments should only be cuddled with other assignments (wsl)

if err != nil {

Check failure on line 267 in cmd/vela-worker/exec.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/exec.go#L267

only one cuddle assignment allowed before if statement (wsl)
Raw output
cmd/vela-worker/exec.go:267:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before if statement (wsl)

logger.Errorf("unable to setup executor: %v", err)
return err
}
// add the executor to the worker
w.Executors[index] = _executor

Expand Down
4 changes: 4 additions & 0 deletions cmd/vela-worker/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/urfave/cli/v3"

"github.com/go-vela/server/queue"
"github.com/go-vela/server/storage"
"github.com/go-vela/worker/executor"
"github.com/go-vela/worker/runtime"
)
Expand Down Expand Up @@ -120,5 +121,8 @@ func flags() []cli.Flag {

f = append(f, runtime.Flags...)

// Storage Flags
f = append(f, storage.Flags...)

return f
}
51 changes: 51 additions & 0 deletions cmd/vela-worker/operate.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"context"
"time"

"github.com/go-vela/server/storage"

Check failure on line 9 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L9

File is not properly formatted (gci)
Raw output
cmd/vela-worker/operate.go:9:1: File is not properly formatted (gci)
	"github.com/go-vela/server/storage"
^

Check failure on line 9 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / full-review

File is not properly formatted (gci)

Check failure on line 9 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / diff-review

File is not properly formatted (gci)

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"

Expand All @@ -19,7 +20,7 @@
// queue and execute Vela pipelines.
//
//nolint:funlen // refactor candidate
func (w *Worker) operate(ctx context.Context) error {

Check failure on line 23 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L23

cyclomatic complexity 32 of func `(*Worker).operate` is high (> 30) (gocyclo)
Raw output
cmd/vela-worker/operate.go:23:1: cyclomatic complexity 32 of func `(*Worker).operate` is high (> 30) (gocyclo)
func (w *Worker) operate(ctx context.Context) error {
^

Check failure on line 23 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / full-review

cyclomatic complexity 32 of func `(*Worker).operate` is high (> 30) (gocyclo)

Check failure on line 23 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / diff-review

cyclomatic complexity 32 of func `(*Worker).operate` is high (> 30) (gocyclo)
var err error
// create the errgroup for managing operator subprocesses
//
Expand All @@ -31,7 +32,7 @@
registryWorker.SetHostname(w.Config.API.Address.Hostname())
registryWorker.SetAddress(w.Config.API.Address.String())
registryWorker.SetActive(true)
registryWorker.SetBuildLimit(int32(w.Config.Build.Limit))

Check failure on line 35 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L35

G115: integer overflow conversion int -> int32 (gosec)
Raw output
cmd/vela-worker/operate.go:35:36: G115: integer overflow conversion int -> int32 (gosec)
	registryWorker.SetBuildLimit(int32(w.Config.Build.Limit))
	                                  ^

Check failure on line 35 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / full-review

G115: integer overflow conversion int -> int32 (gosec)

Check failure on line 35 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / diff-review

G115: integer overflow conversion int -> int32 (gosec)

// set routes from config if set or defaulted to `vela`
if (len(w.Config.Queue.Routes) > 0) && (w.Config.Queue.Routes[0] != "NONE" && w.Config.Queue.Routes[0] != "") {
Expand Down Expand Up @@ -77,6 +78,56 @@
w.updateWorkerStatus(registryWorker, constants.WorkerStatusError)
}

// getting storage creds
logrus.Trace("getting storage s3 creds..")
// fetching queue credentials using registration token
stCreds, _, err := w.VelaClient.Storage.GetInfo()
if err != nil {
logrus.Tracef("error getting storage creds: %v", err)
return err
}

if stCreds.GetEnabled() {
logrus.Trace("storage enabled")
// if an address was given at start up, use that — else use what is returned from server
if len(w.Config.Storage.Endpoint) == 0 {
w.Config.Storage.Endpoint = stCreds.GetStorageAddress()
}

// set access key in storage config
w.Config.Storage.AccessKey = stCreds.GetAccessKey()

// set secret key in storage config
w.Config.Storage.SecretKey = stCreds.GetSecretKey()

// set bucket name in storage config
w.Config.Storage.Bucket = stCreds.GetStorageBucket()

// set storage enabled to true
w.Config.Storage.Enable = stCreds.GetEnabled()

s, err := storage.New(w.Config.Storage)
if err != nil {
logrus.Error("storage setup failed")
// set to error as storage setup fails
w.updateWorkerStatus(registryWorker, constants.WorkerStatusError)
return err

Check failure on line 114 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L114

return statements should not be cuddled if block has more than two lines (wsl)
Raw output
cmd/vela-worker/operate.go:114:4: return statements should not be cuddled if block has more than two lines (wsl)
			return err
			^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
return statements should not be cuddled if block has more than two lines (wsl)

}
w.Storage = s

Check failure on line 116 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L116

assignments should only be cuddled with other assignments (wsl)
Raw output
cmd/vela-worker/operate.go:116:3: assignments should only be cuddled with other assignments (wsl)
		w.Storage = s
		^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
assignments should only be cuddled with other assignments (wsl)

logrus.WithFields(logrus.Fields{
"driver": w.Config.Storage.Driver,
"bucket": w.Config.Storage.Bucket,
"endpoint": w.Config.Storage.Endpoint,
}).Debug("storage initialized")

} else {

Check failure on line 123 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L123

unnecessary trailing newline (whitespace)
Raw output
cmd/vela-worker/operate.go:123:2: unnecessary trailing newline (whitespace)
	} else {
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
unnecessary trailing newline (whitespace)

logrus.Trace("storage not enabled")
// storage disabled; nothing to validate
w.Config.Storage.Enable = false
w.Storage = nil
logrus.Debug("storage disabled: worker storage unset")

Check failure on line 128 in cmd/vela-worker/operate.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/operate.go#L128

only cuddled expressions if assigning variable or using from line above (wsl)
Raw output
cmd/vela-worker/operate.go:128:3: only cuddled expressions if assigning variable or using from line above (wsl)
		logrus.Debug("storage disabled: worker storage unset")
		^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
only cuddled expressions if assigning variable or using from line above (wsl)

}

// spawn goroutine for phoning home
executors.Go(func() error {
// five second ticker for signal handling
Expand Down
13 changes: 11 additions & 2 deletions cmd/vela-worker/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"net/url"

"github.com/gin-gonic/gin"
"github.com/go-vela/server/storage"

Check failure on line 11 in cmd/vela-worker/run.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] cmd/vela-worker/run.go#L11

File is not properly formatted (gci)
Raw output
cmd/vela-worker/run.go:11:1: File is not properly formatted (gci)
	"github.com/go-vela/server/storage"
^

Check failure on line 11 in cmd/vela-worker/run.go

View workflow job for this annotation

GitHub Actions / full-review

File is not properly formatted (gci)

Check failure on line 11 in cmd/vela-worker/run.go

View workflow job for this annotation

GitHub Actions / diff-review

File is not properly formatted (gci)

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
File is not properly formatted (gci)

"github.com/sirupsen/logrus"
"github.com/urfave/cli/v3"

Expand Down Expand Up @@ -96,15 +97,15 @@
},
// build configuration
Build: &Build{
Limit: int(c.Int("build.limit")),
Limit: c.Int("build.limit"),
Timeout: c.Duration("build.timeout"),
},
// build configuration
CheckIn: c.Duration("checkIn"),
// executor configuration
Executor: &executor.Setup{
Driver: c.String("executor.driver"),
MaxLogSize: uint(c.Uint("executor.max_log_size")),
MaxLogSize: c.Uint("executor.max_log_size"),
LogStreamingTimeout: c.Duration("executor.log_streaming_timeout"),
EnforceTrustedRepos: c.Bool("executor.enforce-trusted-repos"),
OutputCtn: outputsCtn,
Expand Down Expand Up @@ -138,6 +139,13 @@
Address: c.String("server.addr"),
Secret: c.String("server.secret"),
},
Storage: &storage.Setup{
Driver: c.String("storage.driver"),
Endpoint: c.String("storage.endpoint.name"),
AccessKey: c.String("storage.access.key"),
SecretKey: c.String("storage.secret.key"),
Bucket: c.String("storage.bucket.name"),
},
// Certificate configuration
Certificate: &Certificate{
Cert: c.String("server.cert"),
Expand Down Expand Up @@ -172,5 +180,6 @@
}

// start the worker
//nolint: contextcheck // not using ctx yet
return w.Start()
}
6 changes: 6 additions & 0 deletions cmd/vela-worker/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,21 @@ func (w *Worker) Start() error {
select {
case sig := <-signalChannel:
logrus.Infof("Received signal: %s", sig)

err := server.Shutdown(ctx)
if err != nil {
logrus.Error(err)
}

done()
case <-gctx.Done():
logrus.Info("Closing signal goroutine")

err := server.Shutdown(ctx)
if err != nil {
logrus.Error(err)
}

return gctx.Err()
}

Expand All @@ -67,7 +71,9 @@ func (w *Worker) Start() error {
// spawn goroutine for starting the server
g.Go(func() error {
var err error

logrus.Info("starting worker server")

if tlsCfg != nil {
if err := server.ListenAndServeTLS(w.Config.Certificate.Cert, w.Config.Certificate.Key); !errors.Is(err, http.ErrServerClosed) {
// log a message indicating the start of the server
Expand Down
3 changes: 3 additions & 0 deletions cmd/vela-worker/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/go-vela/sdk-go/vela"
api "github.com/go-vela/server/api/types"
"github.com/go-vela/server/queue"
"github.com/go-vela/server/storage"
"github.com/go-vela/worker/executor"
"github.com/go-vela/worker/runtime"
)
Expand Down Expand Up @@ -57,6 +58,7 @@ type (
Server *Server
Certificate *Certificate
TLSMinVersion string
Storage *storage.Setup
}

// Worker represents all configuration and
Expand All @@ -72,5 +74,6 @@ type (
RunningBuilds []*api.Build
QueueCheckedIn bool
RunningBuildsMutex sync.Mutex
Storage storage.Storage
}
)
39 changes: 39 additions & 0 deletions executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"github.com/go-vela/server/compiler/types/pipeline"
"github.com/go-vela/server/constants"
"github.com/go-vela/server/mock/server"
"github.com/go-vela/server/storage"
"github.com/go-vela/worker/executor/linux"
"github.com/go-vela/worker/executor/local"
"github.com/go-vela/worker/runtime/docker"
Expand All @@ -37,6 +38,36 @@
t.Errorf("unable to create runtime engine: %v", err)
}

_storageT := &storage.Setup{
Enable: true,
Driver: "minio",
Endpoint: "http://localhost:9000",
AccessKey: "ad",
SecretKey: "asd",
Bucket: "vela",
Region: "",
Secure: false,
}
_sT, err := storage.New(_storageT)
if err != nil {

Check failure on line 52 in executor/executor_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/executor_test.go#L52

only one cuddle assignment allowed before if statement (wsl)
Raw output
executor/executor_test.go:52:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before if statement (wsl)

t.Errorf("unable to create storage engine: %v", err)
}

_storageF := &storage.Setup{
Enable: false,
Driver: "",
Endpoint: "",
AccessKey: "",
SecretKey: "",
Bucket: "",
Region: "",
Secure: false,
}
_sF, err := storage.New(_storageF)
if err != nil {

Check failure on line 67 in executor/executor_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] executor/executor_test.go#L67

only one cuddle assignment allowed before if statement (wsl)
Raw output
executor/executor_test.go:67:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^

Choose a reason for hiding this comment

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

🚫 [golangci] reported by reviewdog 🐶
only one cuddle assignment allowed before if statement (wsl)

t.Errorf("unable to create storage engine: %v", err)
}

_linux, err := linux.New(
linux.WithBuild(_build),
linux.WithHostname("localhost"),
Expand All @@ -45,6 +76,7 @@
linux.WithRuntime(_runtime),
linux.WithVelaClient(_client),
linux.WithVersion("v1.0.0"),
linux.WithStorage(_sT),
)
if err != nil {
t.Errorf("unable to create linux engine: %v", err)
Expand All @@ -57,6 +89,7 @@
local.WithRuntime(_runtime),
local.WithVelaClient(_client),
local.WithVersion("v1.0.0"),
local.WithStorage(_sT),
)
if err != nil {
t.Errorf("unable to create local engine: %v", err)
Expand All @@ -80,6 +113,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sF,
},
want: nil,
equal: reflect.DeepEqual,
Expand All @@ -95,6 +129,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sT,
},
want: _linux,
equal: linux.Equal,
Expand All @@ -109,6 +144,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sT,
},
want: _local,
equal: local.Equal,
Expand All @@ -123,6 +159,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sT,
},
want: nil,
equal: reflect.DeepEqual,
Expand All @@ -137,6 +174,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sT,
},
want: nil,
equal: reflect.DeepEqual,
Expand All @@ -151,6 +189,7 @@
Pipeline: _pipeline,
Runtime: _runtime,
Version: "v1.0.0",
Storage: _sT,
},
want: nil,
equal: reflect.DeepEqual,
Expand Down
Loading
Loading