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

Commit

Permalink
Partial refactor of /plugin tests
Browse files Browse the repository at this point in the history
* Including  in each subdirectory
* Leaving more complex system testing in  until we decide on whether its a medium or throw away for other testing options
  • Loading branch information
mbbroberg committed May 23, 2016
1 parent 3b5c732 commit 29ce8ea
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 22 deletions.
36 changes: 36 additions & 0 deletions plugin/collector/snap-collector-mock1/main_small_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2015 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"os"
"testing"

. "github.com/smartystreets/goconvey/convey"
)

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
7 changes: 0 additions & 7 deletions plugin/collector/snap-collector-mock1/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,3 @@ func TestMockPluginLoad(t *testing.T) {
fmt.Printf("SNAP_PATH not set. Cannot test %s plugin.\n", PluginName)
}
}

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
36 changes: 36 additions & 0 deletions plugin/collector/snap-collector-mock2/main_small_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2015 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"os"
"testing"

. "github.com/smartystreets/goconvey/convey"
)

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
7 changes: 0 additions & 7 deletions plugin/collector/snap-collector-mock2/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,3 @@ func TestMockPluginLoad(t *testing.T) {
fmt.Printf("SNAP_PATH not set. Cannot test %s plugin.\n", PluginName)
}
}

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
36 changes: 36 additions & 0 deletions plugin/processor/snap-processor-passthru/main_small_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2015 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"os"
"testing"

. "github.com/smartystreets/goconvey/convey"
)

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build legacy
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Expand Down
36 changes: 36 additions & 0 deletions plugin/publisher/snap-publisher-file/main_small_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// +build small

/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2015 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package main

import (
"os"
"testing"

. "github.com/smartystreets/goconvey/convey"
)

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}
7 changes: 0 additions & 7 deletions plugin/publisher/snap-publisher-file/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,3 @@ func TestFilePublisherLoad(t *testing.T) {
fmt.Printf("SNAP_PATH not set. Cannot test %s plugin.\n", PluginName)
}
}

func TestMain(t *testing.T) {
Convey("ensure plugin loads and responds", t, func() {
os.Args = []string{"", "{\"NoDaemon\": true}"}
So(func() { main() }, ShouldNotPanic)
})
}

0 comments on commit 29ce8ea

Please sign in to comment.