Documentation
¶
Overview ¶
Package artifacts controls how files generated by Fuchsia's CI tasks are written to and read from Cloud Storage. The directory layout is defined below:
gs://BUCKET/
builds/ BUILD/ tests/ TEST/ ENVIRONMENT/
BUCKET
The Cloud Storage bucket used to store CI artifacts. Multiple buckets can exist exist using this scheme.
BUILD
Contains all artifacts for a build. The directory's name is the unique BuildBucket build ID.
TEST
Contains all artifacts relevant to a particular test. The directory's name is the canonical name of the test - which is usually a test "suite".
ENVIRONMENT
Contains all test artifacts relevant to a particular test environment. The directory's name is the canonical name of the test environment. Tests will often have multiple environment directories, because they often run in multiple environments per build.
Index ¶
- Constants
- type BuildDirectory
- func (d BuildDirectory) CopyFile(ctx context.Context, src, dest string) (int64, error)
- func (d BuildDirectory) List(ctx context.Context, prefix string) ([]string, error)
- func (d BuildDirectory) NewTestOutputObject(ctx context.Context, testName, envName string) *storage.ObjectHandle
- func (d BuildDirectory) Object(objPath string) *storage.ObjectHandle
- type Client
- type Directory
- type ErrNothingMatchedPrefix
Constants ¶
const DefaultTestOutputName = "stdout-stderr.txt"
The default name of a test's output file. We only store a single file containing a test's combined stdout and stderr streams today. This will change in the future.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildDirectory ¶
type BuildDirectory struct {
// contains filtered or unexported fields
}
BuildDirectory represents a Fuchsia CI build's artifact directory. Refer to the layout in doc.go for the layout of this directory. When amending the layout, prefer adding convenience methods on this type to encourages all clients to create objects within this BuildDirectory using the same layout.
func (BuildDirectory) CopyFile ¶
CopyFile copies the object from src to dst, creating all the parent directories of dest if they don't exist. It returns the (compressed, if applicable) size of the object even if it fails to download it.
func (BuildDirectory) List ¶
List lists all of the objects in this directory with the given prefix. If prefix == "", it will list everything in this directory.
func (BuildDirectory) NewTestOutputObject ¶
func (d BuildDirectory) NewTestOutputObject(ctx context.Context, testName, envName string) *storage.ObjectHandle
NewTestOutputObject creates a new ObjectHandle to hold the output of the given test execution in this BuildDirectory. testName is the name of the test, envName is the canonical name of the test environment. Both are normalized according to normalizePathSegment.
func (BuildDirectory) Object ¶
func (d BuildDirectory) Object(objPath string) *storage.ObjectHandle
Object returns a handle to the given object within this directory. objPath is the path to the object relative to this directory.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides access to the artifacts produced by Fuchsia CI tasks.
func (*Client) GetBuildDir ¶
GetBuildDir returns the BuildDirectory for the given build. bucket is the GCS bucket. build is the BuildBucket build ID.
type Directory ¶
type Directory interface { Object(string) *storage.ObjectHandle CopyFile(ctx context.Context, src, dest string) (int64, error) List(context.Context, string) ([]string, error) }
Directory is an interface for interacting with a Cloud Storage "directory".
type ErrNothingMatchedPrefix ¶
ErrNothingMatchedPrefix is returned when `List()` fails to find any objects in a bucket that match the given prefix.
func (*ErrNothingMatchedPrefix) Error ¶
func (e *ErrNothingMatchedPrefix) Error() string