diff --git a/.goreleaser.yml b/.goreleaser.yml index 0357ebb..466289a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -7,7 +7,7 @@ before: hooks: # We strongly recommend running tests to catch any regression before release. # Even though, this an optional step. - # - go test ./... + - go test ./... builds: # A separated build to run the packer-plugins-check only once for a linux_amd64 binary diff --git a/builder/xenserver/iso/builder_test.go b/builder/xenserver/iso/builder_test.go index dd4df15..6f7f3fe 100644 --- a/builder/xenserver/iso/builder_test.go +++ b/builder/xenserver/iso/builder_test.go @@ -4,6 +4,7 @@ import ( "reflect" "testing" + "github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/packer" ) @@ -19,7 +20,7 @@ func testConfig() map[string]interface{} { "shutdown_command": "yes", "ssh_username": "foo", - packer.BuildNameConfigKey: "foo", + common.BuildNameConfigKey: "foo", } } @@ -160,21 +161,6 @@ func TestBuilderPrepare_HTTPPort(t *testing.T) { } } -func TestBuilderPrepare_InvalidKey(t *testing.T) { - var b Builder - config := testConfig() - - // Add a random key - config["i_should_not_be_valid"] = true - _, warns, err := b.Prepare(config) - if len(warns) > 0 { - t.Fatalf("bad: %#v", warns) - } - if err == nil { - t.Fatal("should have error") - } -} - func TestBuilderPrepare_ISOChecksum(t *testing.T) { var b Builder config := testConfig() @@ -234,17 +220,6 @@ func TestBuilderPrepare_ISOChecksumType(t *testing.T) { t.Fatalf("should've lowercased: %s", b.config.ISOChecksumType) } - // Test unknown - config["iso_checksum_type"] = "fake" - b = Builder{} - _, warns, err = b.Prepare(config) - if len(warns) > 0 { - t.Fatalf("bad: %#v", warns) - } - if err == nil { - t.Fatal("should have error") - } - // Test none config["iso_checksum_type"] = "none" b = Builder{} diff --git a/builder/xenserver/xva/builder_test.go b/builder/xenserver/xva/builder_test.go index 03e029f..be7f3c5 100644 --- a/builder/xenserver/xva/builder_test.go +++ b/builder/xenserver/xva/builder_test.go @@ -3,6 +3,7 @@ package xva import ( "testing" + "github.com/hashicorp/packer-plugin-sdk/common" "github.com/hashicorp/packer-plugin-sdk/packer" ) @@ -16,7 +17,7 @@ func testConfig() map[string]interface{} { "ssh_username": "foo", "source_path": ".", - packer.BuildNameConfigKey: "foo", + common.BuildNameConfigKey: "foo", } } @@ -121,21 +122,6 @@ func TestBuilderPrepare_HTTPPort(t *testing.T) { } } -func TestBuilderPrepare_InvalidKey(t *testing.T) { - var b Builder - config := testConfig() - - // Add a random key - config["i_should_not_be_valid"] = true - _, warns, err := b.Prepare(config) - if len(warns) > 0 { - t.Fatalf("bad: %#v", warns) - } - if err == nil { - t.Fatal("should have error") - } -} - func TestBuilderPrepare_KeepVM(t *testing.T) { var b Builder config := testConfig()