github.com/hashicorp/packer@v1.14.3/packer_test/plugin_tests/gob_test_suite.go (about) 1 package plugin_tests 2 3 import ( 4 "testing" 5 6 "github.com/hashicorp/packer/packer_test/common" 7 "github.com/stretchr/testify/suite" 8 ) 9 10 type PackerGobTestSuite struct { 11 *common.PackerTestSuite 12 } 13 14 func Test_PackerGobPBSuite(t *testing.T) { 15 baseSuite, cleanup := common.InitBaseSuite(t) 16 defer cleanup() 17 18 ts := &PackerGobTestSuite{ 19 baseSuite, 20 } 21 22 var compilationJobs []chan common.CompilationResult 23 24 // Build two versions of each plugin, one with gob only, one with protobuf only 25 // 26 // We'll install them manually in tests, as they'll need to be installed as 27 // different plugin sources in order for discovery to trigger the 28 // gob-only/pb-supported behaviours we want to test. 29 compilationJobs = append(compilationJobs, ts.CompilePlugin("1.1.0+pb", common.UseDependency(common.SDKModule, "v0.6.0"))) 30 compilationJobs = append(compilationJobs, ts.CompilePlugin("1.0.0+pb", common.UseDependency(common.SDKModule, "v0.6.0"))) 31 32 compilationJobs = append(compilationJobs, ts.CompilePlugin("1.0.0+gob")) 33 compilationJobs = append(compilationJobs, ts.CompilePlugin("1.1.0+gob")) 34 35 common.Ready(t, compilationJobs) 36 37 suite.Run(t, ts) 38 }