Documentation
¶
Index ¶
- func AWS(schemaDirectoryPath string) (plugin.Provider, error)
- func Azure(schemaDirectoryPath string) (plugin.Provider, error)
- func AzureNative(schemaDirectoryPath string) (plugin.Provider, error)
- func CheckAllFilesGenerated(t *testing.T, actual, expected map[string][]byte)
- func GeneratePackageFilesFromSchema(schemaPath string, genPackageFunc GenPkgSignature) (map[string][]byte, error)
- func GetSchema(schemaDirectoryPath, providerName string) ([]byte, error)
- func Kubernetes(schemaDirectoryPath string) (plugin.Provider, error)
- func LoadBaseline(dir, lang string) (map[string][]byte, error)
- func LoadFiles(dir, lang string, files []string) (map[string][]byte, error)
- func NewHost(schemaDirectoryPath string) plugin.Host
- func Random(schemaDirectoryPath string) (plugin.Provider, error)
- func RewriteFilesWhenPulumiAccept(t *testing.T, dir, lang string, actual map[string][]byte) bool
- func TestSDKCodegen(t *testing.T, language string, genPackage GenPkgSignature)
- func TestTypeNameCodegen(t *testing.T, language string, newTypeNameGenerator NewTypeNameGeneratorFunc)
- func ValidateFileEquality(t *testing.T, actual, expected map[string][]byte)
- type GenPkgSignature
- type NewTypeNameGeneratorFunc
- type TypeNameGeneratorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AzureNative ¶ added in v3.2.0
func CheckAllFilesGenerated ¶
CheckAllFilesGenerated ensures that the set of expected and actual files generated are exactly equivalent.
func GeneratePackageFilesFromSchema ¶
func GeneratePackageFilesFromSchema(schemaPath string, genPackageFunc GenPkgSignature) (map[string][]byte, error)
GeneratePackageFilesFromSchema loads a schema and generates files using the provided GeneratePackage function.
func LoadBaseline ¶ added in v3.6.1
LoadBaseline loads the contents of the given baseline directory.
func RewriteFilesWhenPulumiAccept ¶ added in v3.2.0
If PULUMI_ACCEPT is set, writes out actual output to the expected file set, so we can continue enjoying golden tests without manually modifying the expected output.
func TestSDKCodegen ¶ added in v3.6.1
func TestSDKCodegen(t *testing.T, language string, genPackage GenPkgSignature)
TestSDKCodegen runs the complete set of SDK code generation tests against a particular language's code generator.
An SDK code generation test consists of a schema and a set of expected outputs for each language. Each test is structured as a directory that contains that information:
test-directory/
schema.(json|yaml)
language-0
...
language-n
The schema is the only piece that must be manually authored. Once the schema has been written, the expected outputs can be generated by running `PULUMI_ACCEPT=true go test ./..." from the `pkg/codegen` directory.
func TestTypeNameCodegen ¶ added in v3.7.0
func TestTypeNameCodegen(t *testing.T, language string, newTypeNameGenerator NewTypeNameGeneratorFunc)
Types ¶
type GenPkgSignature ¶
GenPkgSignature corresponds to the shape of the codegen GeneratePackage functions.
type NewTypeNameGeneratorFunc ¶ added in v3.7.0
type NewTypeNameGeneratorFunc func(pkg *schema.Package) TypeNameGeneratorFunc