testutils

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2024 License: MPL-2.0 Imports: 3 Imported by: 3

Documentation

Overview

Package testutils provides some simple ease-of-use tools for implementing acceptance testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupFiles

func CleanupFiles(moreFiles ...string)

CleanupFiles removes all the provided filenames.

func FileExists

func FileExists(filename string) bool

FileExists returns true if the filename is found.

Types

type ManifestArtifact added in v0.1.4

type ManifestArtifact struct {
	BuildName     string                 `json:"name"`
	BuilderType   string                 `json:"builder_type"`
	BuildTime     int64                  `json:"build_time,omitempty"`
	ArtifactFiles []ManifestArtifactFile `json:"files"`
	ArtifactId    string                 `json:"artifact_id"`
	PackerRunUUID string                 `json:"packer_run_uuid"`
	CustomData    map[string]string      `json:"custom_data"`
}

type ManifestArtifactFile added in v0.1.4

type ManifestArtifactFile struct {
	Name string `json:"name"`
	Size int64  `json:"size"`
}

type ManifestFile added in v0.1.4

type ManifestFile struct {
	Builds      []ManifestArtifact `json:"builds"`
	LastRunUUID string             `json:"last_run_uuid"`
}

"A little copying is better than a lot of dependecy" This code comes from the manifest post-processor shipped with Packer core. These structs allow us to re-decode the manifest

func GetArtifact added in v0.1.4

func GetArtifact(manifestfilepath string) (ManifestFile, error)

Use the manifest to load information about artifact ID and region. to properly use this, you should make sure the manifestfilepath is unique for each test, and remember to clean up the manifest file when your build is done!

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL