Skip to content

Commit

Permalink
Update version - v4
Browse files Browse the repository at this point in the history
This is a breaking change, so we should bump from v3 to v4.
  • Loading branch information
SimonRichardson committed Sep 20, 2023
1 parent 6b9c0d4 commit 0594441
Show file tree
Hide file tree
Showing 20 changed files with 38 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT := github.com/juju/worker/v3
PROJECT := github.com/juju/worker/v4

.PHONY: check-licence check-go check

Expand Down
2 changes: 1 addition & 1 deletion catacomb/catacomb.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/juju/errors"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// Catacomb is a variant of tomb.Tomb with its own internal goroutine, designed
Expand Down
4 changes: 2 additions & 2 deletions catacomb/catacomb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v3/catacomb"
"github.com/juju/worker/v4"
"github.com/juju/worker/v4/catacomb"
)

type CatacombSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions catacomb/fixture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v3/catacomb"
"github.com/juju/worker/v4"
"github.com/juju/worker/v4/catacomb"
)

type cleaner interface {
Expand Down
2 changes: 1 addition & 1 deletion dependency/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
"github.com/juju/errors"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// Logger represents the various logging methods used by the runner.
Expand Down
6 changes: 3 additions & 3 deletions dependency/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3"
"github.com/juju/worker/v3/dependency"
"github.com/juju/worker/v3/workertest"
"github.com/juju/worker/v4"
"github.com/juju/worker/v4/dependency"
"github.com/juju/worker/v4/workertest"
)

type EngineSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion dependency/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/juju/errors"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// Manifold defines the behaviour of a node in an Engine's dependency graph. It's
Expand Down
4 changes: 2 additions & 2 deletions dependency/reporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3/dependency"
"github.com/juju/worker/v3/workertest"
"github.com/juju/worker/v4/dependency"
"github.com/juju/worker/v4/workertest"
)

type ReportSuite struct {
Expand Down
4 changes: 2 additions & 2 deletions dependency/self_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3/dependency"
"github.com/juju/worker/v3/workertest"
"github.com/juju/worker/v4/dependency"
"github.com/juju/worker/v4/workertest"
)

type SelfSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion dependency/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/juju/errors"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// snapshot encapsulates a snapshot of workers and output funcs and implements
Expand Down
2 changes: 1 addition & 1 deletion dependency/testing/stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/juju/errors"

"github.com/juju/worker/v3/dependency"
"github.com/juju/worker/v4/dependency"
)

// NewStubResource creates a single StubResource with the given
Expand Down
2 changes: 1 addition & 1 deletion dependency/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"github.com/juju/errors"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// Installer exposes an Engine's Install method.
Expand Down
6 changes: 3 additions & 3 deletions dependency/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v3/dependency"
"github.com/juju/worker/v3/workertest"
"github.com/juju/worker/v4"
"github.com/juju/worker/v4/dependency"
"github.com/juju/worker/v4/workertest"
)

type engineFixture struct {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/juju/worker/v3
module github.com/juju/worker/v4

go 1.19
go 1.20

require (
github.com/juju/clock v0.0.0-20220203021603-d9deb868a28a
Expand Down
2 changes: 1 addition & 1 deletion runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

type RunnerSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/juju/testing"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

type WorkerSuite struct {
Expand Down
20 changes: 10 additions & 10 deletions workertest/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

var (
Expand Down Expand Up @@ -71,9 +71,9 @@ func CheckKill(c *gc.C, w worker.Worker) error {
// CleanKill calls CheckKill with the supplied arguments, and Checks that the
// returned error is nil. It's particularly suitable for deferring:
//
// someWorker, err := some.NewWorker()
// c.Assert(err, jc.ErrorIsNil)
// defer workertest.CleanKill(c, someWorker)
// someWorker, err := some.NewWorker()
// c.Assert(err, jc.ErrorIsNil)
// defer workertest.CleanKill(c, someWorker)
//
// ...in the large number (majority?) of situations where a worker is expected
// to run successfully; and it doesn't Assert, and is therefore suitable for use
Expand All @@ -86,9 +86,9 @@ func CleanKill(c *gc.C, w worker.Worker) {
// DirtyKill calls CheckKill with the supplied arguments, and logs the returned
// error. It's particularly suitable for deferring:
//
// someWorker, err := some.NewWorker()
// c.Assert(err, jc.ErrorIsNil)
// defer workertest.DirtyKill(c, someWorker)
// someWorker, err := some.NewWorker()
// c.Assert(err, jc.ErrorIsNil)
// defer workertest.DirtyKill(c, someWorker)
//
// ...in the cases where we expect a worker to fail, but aren't specifically
// testing that failure; and it doesn't Assert, and is therefore suitable for
Expand All @@ -104,9 +104,9 @@ func DirtyKill(c *gc.C, w worker.Worker) {
// and tries to stop the (non-nil) worker via CleanKill(). It's suitable
// for testing constructor failure:
//
// someWorker, err := some.NewWorker(badConfig)
// workertest.CheckNilOrKill(c, someWorker)
// c.Check(err, ...
// someWorker, err := some.NewWorker(badConfig)
// workertest.CheckNilOrKill(c, someWorker)
// c.Check(err, ...
//
// ...because it will do the right thing if your constructor succeeds
// unexpectedly, and make every effort to prevent a rogue worker living
Expand Down
2 changes: 1 addition & 1 deletion workertest/fake_watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package workertest
import (
"errors"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

type NotAWatcher struct {
Expand Down
2 changes: 1 addition & 1 deletion workertest/workers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package workertest
import (
"gopkg.in/tomb.v2"

"github.com/juju/worker/v3"
"github.com/juju/worker/v4"
)

// NewErrorWorker returns a Worker that runs until Kill()ed; at which point it
Expand Down
2 changes: 1 addition & 1 deletion workertest/workertest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/juju/testing"
gc "gopkg.in/check.v1"

"github.com/juju/worker/v3/workertest"
"github.com/juju/worker/v4/workertest"
)

type Suite struct {
Expand Down

0 comments on commit 0594441

Please sign in to comment.