Skip to content

Commit

Permalink
worker: use external worker package
Browse files Browse the repository at this point in the history
The package gopkg.in/worker.v1 has existed for a while
and will soon have some changes that we need in Juju,
so use it instead of the locally defined Runner type
and delete that.

Although large, there are no significant semantic
changes introduced by this PR.
  • Loading branch information
rogpeppe committed Mar 7, 2017
1 parent 3baa794 commit f21749c
Show file tree
Hide file tree
Showing 282 changed files with 503 additions and 1,142 deletions.
2 changes: 1 addition & 1 deletion api/migrationminion/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import (
jujutesting "github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

apitesting "github.com/juju/juju/api/base/testing"
"github.com/juju/juju/api/migrationminion"
"github.com/juju/juju/apiserver/params"
"github.com/juju/juju/core/migration"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
)

type ClientSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion api/watcher/watcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/juju/utils"
gc "gopkg.in/check.v1"
"gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/api"
"github.com/juju/juju/api/migrationminion"
Expand All @@ -22,7 +23,6 @@ import (
"github.com/juju/juju/testing/factory"
corewatcher "github.com/juju/juju/watcher"
"github.com/juju/juju/watcher/watchertest"
"github.com/juju/juju/worker"
)

type watcherSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion apiserver/client/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/juju/utils/clock"
gc "gopkg.in/check.v1"
"gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/api"
commontesting "github.com/juju/juju/apiserver/common/testing"
Expand All @@ -27,7 +28,6 @@ import (
"github.com/juju/juju/status"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/testing/factory"
"github.com/juju/juju/worker"
)

type baseSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion apiserver/client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
gc "gopkg.in/check.v1"
"gopkg.in/juju/charm.v6-unstable"
"gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/apiserver/client"
Expand All @@ -42,7 +43,6 @@ import (
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/testing/factory"
jujuversion "github.com/juju/juju/version"
"github.com/juju/juju/worker"
)

type serverSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion apiserver/highavailability/highavailability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/juju/errors"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/apiserver/common"
commontesting "github.com/juju/juju/apiserver/common/testing"
Expand All @@ -21,7 +22,6 @@ import (
"github.com/juju/juju/state/presence"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/testing/factory"
"github.com/juju/juju/worker"
)

func TestAll(t *stdtesting.T) {
Expand Down
2 changes: 1 addition & 1 deletion apiserver/presence/pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (
"github.com/juju/loggo"
"github.com/juju/utils/clock"
"gopkg.in/juju/names.v2"
"gopkg.in/juju/worker.v1"

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

Expand Down
2 changes: 1 addition & 1 deletion apiserver/presence/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ import (
"github.com/juju/utils/clock"
gc "gopkg.in/check.v1"
"gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/apiserver/presence"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/workertest"
)

Expand Down
3 changes: 2 additions & 1 deletion apiserver/testing/fakenotifywatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package testing

import (
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/state"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/workertest"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
jc "github.com/juju/testing/checkers"
"github.com/juju/utils/series"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/cmd/jujud/agent/agenttest"
cmdutil "github.com/juju/juju/cmd/jujud/util"
Expand All @@ -16,7 +17,6 @@ import (
"github.com/juju/juju/mongo"
"github.com/juju/juju/network"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/proxyupdater"
)

Expand Down
3 changes: 2 additions & 1 deletion cmd/jujud/agent/engine/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package engine

import (
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
dt "github.com/juju/juju/worker/dependency/testing"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/jujud/agent/engine/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
package engine

import (
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/api/base"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/api/base"
"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
dt "github.com/juju/juju/worker/dependency/testing"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/jujud/agent/engine/apiagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
package engine

import (
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/api/base"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
)

Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/apiagent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/api/base"
"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
dt "github.com/juju/juju/worker/dependency/testing"
)
Expand Down
3 changes: 2 additions & 1 deletion cmd/jujud/agent/engine/enginetest/agentapimanifold.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
package enginetest

import (
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/api/base"
basetesting "github.com/juju/juju/api/base/testing"
"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
dt "github.com/juju/juju/worker/dependency/testing"
)
Expand Down
3 changes: 1 addition & 2 deletions cmd/jujud/agent/engine/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ package engine

import (
"github.com/juju/errors"

"github.com/juju/juju/worker"
worker "gopkg.in/juju/worker.v1"
)

// Flag represents a single boolean used to determine whether a given
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/flag_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
)

type FlagSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/housing.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ package engine

import (
"github.com/juju/errors"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
"github.com/juju/juju/worker/fortress"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/housing_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/cmd/jujud/agent/engine"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
dt "github.com/juju/juju/worker/dependency/testing"
"github.com/juju/juju/worker/fortress"
Expand Down
3 changes: 1 addition & 2 deletions cmd/jujud/agent/engine/valueworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@ import (
"reflect"

"github.com/juju/errors"
worker "gopkg.in/juju/worker.v1"
"gopkg.in/tomb.v1"

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

// NewValueWorker returns a degenerate worker that exposes the supplied value
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine/valueworker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"github.com/juju/testing"
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/cmd/jujud/agent/engine"
"github.com/juju/juju/worker"
)

type ValueWorkerSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ import (
"github.com/juju/errors"
"github.com/juju/utils/set"
gc "gopkg.in/check.v1"
worker "gopkg.in/juju/worker.v1"
goyaml "gopkg.in/yaml.v2"

"github.com/juju/juju/cmd/jujud/agent/machine"
"github.com/juju/juju/cmd/jujud/agent/model"
"github.com/juju/juju/cmd/jujud/agent/unit"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
)

Expand Down
5 changes: 3 additions & 2 deletions cmd/jujud/agent/imagemetadataworker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ package agent
import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/juju/worker.v1"

"github.com/juju/juju/api/imagemetadata"
"github.com/juju/juju/environs"
"github.com/juju/juju/environs/config"
"github.com/juju/juju/environs/simplestreams"
"github.com/juju/juju/state"
"github.com/juju/juju/testing"
"github.com/juju/juju/worker"
jworker "github.com/juju/juju/worker"
)

// MachineMockProviderSuite runs worker tests that depend
Expand All @@ -30,7 +31,7 @@ func (s *MachineMockProviderSuite) TestMachineAgentRunsMetadataWorker(c *gc.C) {
started := make(chan struct{})
newWorker := func(cl *imagemetadata.Client) worker.Worker {
close(started)
return worker.NewNoOpWorker()
return jworker.NewNoOpWorker()
}
s.PatchValue(&newMetadataUpdater, newWorker)
s.PatchValue(&newEnvirons, func(environs.OpenParams) (environs.Environ, error) {
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/introspection.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
"github.com/juju/errors"
"github.com/prometheus/client_golang/prometheus"
names "gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
"github.com/juju/juju/worker/introspection"
)
Expand Down
2 changes: 1 addition & 1 deletion cmd/jujud/agent/introspection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
jc "github.com/juju/testing/checkers"
gc "gopkg.in/check.v1"
"gopkg.in/juju/names.v2"
worker "gopkg.in/juju/worker.v1"

"github.com/juju/juju/agent"
cmdutil "github.com/juju/juju/cmd/jujud/util"
coretesting "github.com/juju/juju/testing"
"github.com/juju/juju/worker"
"github.com/juju/juju/worker/dependency"
"github.com/juju/juju/worker/introspection"
)
Expand Down
Loading

0 comments on commit f21749c

Please sign in to comment.