packer/packer_test/common/plugin_tester/main.go
Lucas Bajolet 35b2317ef3 packer_test: rename/split lib into common/check
The lib name for the common components for writing packer_test suites
was not clear, and did not follow the convention established in Packer
core and plugins.
Therefore this commit does two things: first the lib is renamed into
common as to follow this convention, and clearly document which
components are common to all tests.
Also checkers are placed in a subpackage of common, common/check, so
that it is clearer what is meant to be used as checks for a command's
execution status after it's been run, as part of Assert.
2024-09-11 16:08:51 -04:00

34 lines
1.1 KiB
Go

// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package main
import (
"fmt"
"os"
"github.com/hashicorp/packer-plugin-sdk/plugin"
"github.com/hashicorp/packer-plugin-tester/builder/dynamic"
dynamicDS "github.com/hashicorp/packer-plugin-tester/datasource/dynamic"
"github.com/hashicorp/packer-plugin-tester/datasource/parrot"
"github.com/hashicorp/packer-plugin-tester/datasource/sleeper"
dynamicPP "github.com/hashicorp/packer-plugin-tester/post-processor/dynamic"
dynamicProv "github.com/hashicorp/packer-plugin-tester/provisioner/dynamic"
"github.com/hashicorp/packer-plugin-tester/version"
)
func main() {
pps := plugin.NewSet()
pps.RegisterBuilder("dynamic", new(dynamic.Builder))
pps.RegisterProvisioner("dynamic", new(dynamicProv.Provisioner))
pps.RegisterPostProcessor("dynamic", new(dynamicPP.PostProcessor))
pps.RegisterDatasource("dynamic", new(dynamicDS.Datasource))
pps.RegisterDatasource("parrot", new(parrot.Datasource))
pps.RegisterDatasource("sleeper", new(sleeper.Datasource))
pps.SetVersion(version.PluginVersion)
err := pps.Run()
if err != nil {
fmt.Fprintln(os.Stderr, err.Error())
os.Exit(1)
}
}