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

Commit

Permalink
Added error checking of NewRequestedPlugin return values to properly …
Browse files Browse the repository at this point in the history
…catch problems with accessing plugins.
  • Loading branch information
IRCody committed Feb 3, 2016
1 parent 23efe61 commit 34a5245
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions scheduler/workflow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ import (
)

var (
SnapPath = os.Getenv("SNAP_PATH")
SnapPath = os.Getenv("SNAP_PATH")
snap_collector_mock2_path = path.Join(SnapPath, "plugin", "snap-collector-mock2")
snap_processor_passthru_path = path.Join(SnapPath, "plugin", "snap-processor-passthru")
snap_publisher_file_path = path.Join(SnapPath, "plugin", "snap-publisher-file")
)

type MockMetricType struct {
Expand Down Expand Up @@ -72,13 +75,16 @@ func TestCollectPublishWorkflow(t *testing.T) {
s := New()
s.SetMetricManager(c)
Convey("create a workflow", func() {
rp, _ := core.NewRequestedPlugin(path.Join(SnapPath, "plugin", "snap-collector-mock2"))
_, err := c.Load(rp)
rp, err := core.NewRequestedPlugin(snap_collector_mock2_path)
So(err, ShouldBeNil)
_, err = c.Load(rp)
So(err, ShouldBeNil)
rp2, err := core.NewRequestedPlugin(snap_publisher_file_path)
So(err, ShouldBeNil)
rp2, _ := core.NewRequestedPlugin(path.Join(SnapPath, "plugin", "snap-publisher-file"))
_, err = c.Load(rp2)
So(err, ShouldBeNil)
rp3, _ := core.NewRequestedPlugin(path.Join(SnapPath, "plugin", "snap-processor-passthru"))
rp3, err := core.NewRequestedPlugin(snap_processor_passthru_path)
So(err, ShouldBeNil)
_, err = c.Load(rp3)
So(err, ShouldBeNil)
time.Sleep(100 * time.Millisecond)
Expand Down

0 comments on commit 34a5245

Please sign in to comment.