Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
Fixed a few more broken unit test references
Browse files Browse the repository at this point in the history
  • Loading branch information
Taylor Thomas committed Jul 8, 2016
1 parent a1b5fe6 commit 9937cd3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion control/available_plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func TestAvailablePlugins(t *testing.T) {
Version: 1,
},
Type: plugin.CollectorPluginType,
ListenAddress: "localhost:",
ListenAddress: "localhost:asdf",
}
ap, err := newAvailablePlugin(resp, nil, nil)
So(ap, ShouldBeNil)
Expand Down
4 changes: 2 additions & 2 deletions control/control_grpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func TestGRPCServerScheduler(t *testing.T) {
})
// start plugin pools/provide task info so we can do collect/process/publishMetrics
// errors here indicate problems outside the scope of this test.
plugins := []string{"collector:mock:1", "processor:passthru:1", "publisher:file:3"}
plugins := []string{"collector:mock:1", "processor:passthru:1", "publisher:mock-file:3"}
lps := make([]*loadedPlugin, len(plugins))
pools := make([]strategy.Pool, len(plugins))
for i, v := range plugins {
Expand Down Expand Up @@ -343,7 +343,7 @@ func TestGRPCServerScheduler(t *testing.T) {
Convey("should not error with valid inputs", func() {
config := make(map[string]ctypes.ConfigValue)
config["file"] = ctypes.ConfigValueStr{Value: "/tmp/grpcservertest.snap"}
req := controlproxy.GetPubProcReq("snap.gob", content, "file", 3, config, "my-snowflake-id")
req := controlproxy.GetPubProcReq("snap.gob", content, "mock-file", 3, config, "my-snowflake-id")
reply, err := client.PublishMetrics(context.Background(), req)
// we don't expect rpc errors
So(err, ShouldBeNil)
Expand Down
8 changes: 4 additions & 4 deletions control/control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1459,15 +1459,15 @@ func TestPublishMetrics(t *testing.T) {
So(err, ShouldBeNil)
<-lpe.done
So(len(c.pluginManager.all()), ShouldEqual, 1)
lp, err2 := c.pluginManager.get("publisher:file:3")
lp, err2 := c.pluginManager.get("publisher:mock-file:3")
So(err2, ShouldBeNil)
So(lp.Name(), ShouldResemble, "file")
So(lp.Name(), ShouldResemble, "mock-file")
So(lp.ConfigPolicy, ShouldNotBeNil)

Convey("Subscribe to file publisher with good config", func() {
n := cdata.NewNode()
c.Config.Plugins.Publisher.Plugins[lp.Name()] = newPluginConfigItem(optAddPluginConfigItem("file", ctypes.ConfigValueStr{Value: "/tmp/snap-TestPublishMetrics.out"}))
pool, errp := c.pluginRunner.AvailablePlugins().getOrCreatePool("publisher:file:3")
pool, errp := c.pluginRunner.AvailablePlugins().getOrCreatePool("publisher:mock-file:3")
So(errp, ShouldBeNil)
pool.Subscribe("1", strategy.UnboundSubscriptionType)
err := c.pluginRunner.runPlugin(lp.Details)
Expand All @@ -1482,7 +1482,7 @@ func TestPublishMetrics(t *testing.T) {
enc := gob.NewEncoder(&buf)
enc.Encode(metrics)
contentType := plugin.SnapGOBContentType
errs := c.PublishMetrics(contentType, buf.Bytes(), "file", 3, n.Table(), uuid.New())
errs := c.PublishMetrics(contentType, buf.Bytes(), "mock-file", 3, n.Table(), uuid.New())
So(errs, ShouldBeNil)
ap := c.AvailablePlugins()
So(ap, ShouldNotBeEmpty)
Expand Down
8 changes: 4 additions & 4 deletions mgmt/rest/client/client_func_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ func TestSnapClient(t *testing.T) {
Convey("invalid task (missing publisher)", func() {
tf := c.CreateTask(sch, wf, "baron", "", false, rest.DefaultMaxFailures)
So(tf.Err, ShouldNotBeNil)
So(tf.Err.Error(), ShouldContainSubstring, "Plugin not found: type(publisher) name(file)")
So(tf.Err.Error(), ShouldContainSubstring, "Plugin not found: type(publisher) name(mock-file)")
})
Convey("plugin already loaded", func() {
p1 := c.LoadPlugin(MOCK_PLUGIN_PATH1)
Expand Down Expand Up @@ -323,7 +323,7 @@ func TestSnapClient(t *testing.T) {
So(p3, ShouldNotBeNil)
So(p3.Err, ShouldBeNil)
So(p3.LoadedPlugins, ShouldNotBeEmpty)
So(p3.LoadedPlugins[0].Name, ShouldEqual, "file")
So(p3.LoadedPlugins[0].Name, ShouldEqual, "mock-file")
So(p3.LoadedPlugins[0].Version, ShouldEqual, 3)
So(p3.LoadedPlugins[0].LoadedTime().Unix(), ShouldBeLessThanOrEqualTo, time.Now().Unix())
})
Expand Down Expand Up @@ -530,9 +530,9 @@ func TestSnapClient(t *testing.T) {
So(p2.Version, ShouldEqual, 2)
So(p2.Type, ShouldEqual, "collector")

p3 := c.UnloadPlugin("publisher", "file", 3)
p3 := c.UnloadPlugin("publisher", "mock-file", 3)
So(p3.Err, ShouldBeNil)
So(p3.Name, ShouldEqual, "file")
So(p3.Name, ShouldEqual, "mock-file")
So(p3.Version, ShouldEqual, 3)
So(p3.Type, ShouldEqual, "publisher")
})
Expand Down
2 changes: 1 addition & 1 deletion mgmt/rest/wmap_sample/1.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"process": [],
"publish": [
{
"plugin_name": "file",
"plugin_name": "mock-file",
"config": {
"file": "/tmp/rest.test"
}
Expand Down
2 changes: 1 addition & 1 deletion mgmt/rest/wmap_sample/bad.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"process": [],
"publish": [
{
"plugin_name": "file",
"plugin_name": "mock-file",
"config": {
"file": "/tmp/rest.test"
}
Expand Down

0 comments on commit 9937cd3

Please sign in to comment.