Documentation ¶
Index ¶
- func GetBuild(ctx context.Context, args *ClientArgs, ID int64, fields ...string) (*buildbucketpb.Build, error)
- func TestPlanForSuites(suiteNames []string) *test_platform.Request_TestPlan
- func TestPlanForTests(testArgs string, testHarness string, testNames []string) *test_platform.Request_TestPlan
- type CTPBuilder
- func (c *CTPBuilder) AddDefaultBBClient(ctx context.Context) error
- func (c *CTPBuilder) CtpTags() map[string]string
- func (c *CTPBuilder) ScheduleCTPBuild(ctx context.Context) (*buildbucketpb.Build, error)
- func (c *CTPBuilder) TestPlatformRequest(buildTags map[string]string) (*test_platform.Request, error)
- func (c *CTPBuilder) TestRunnerTags() map[string]string
- type ClientArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBuild ¶
func GetBuild(ctx context.Context, args *ClientArgs, ID int64, fields ...string) (*buildbucketpb.Build, error)
GetBuild fetches a build with the fields specified. If no fields are specified, all fields are returned
func TestPlanForSuites ¶
func TestPlanForSuites(suiteNames []string) *test_platform.Request_TestPlan
TestPlanForSuites constructs a Test Platform test plan for the given suites.
func TestPlanForTests ¶
func TestPlanForTests(testArgs string, testHarness string, testNames []string) *test_platform.Request_TestPlan
TestPlanFor Tests constructs a Test Platform test plan for the given tests. testArgs meanings depend on tests
Types ¶
type CTPBuilder ¶
type CTPBuilder struct { // AuthOptions represent configuration for LUCI Auth used when sending // builds to buildbucket such as the location of the client tokens or scope // These should match the options used to log into LUCI // For more context, see https://pkg.go.dev/go.chromium.org/luci/auth AuthOptions *auth.Options // BBClient is the client used to create buildbucket requests // If nil, a client will be created as part of scheduling the request BBClient buildbucket.BBClient // BBService is the URL of the buildbucket service to run against // Defaults to https://cr-buildbucket.appspot.com/ BBService string // TODO // Board is the board to run against // Board is REQUIRED Board string // BuilderID is the builder we want to submit the CTP requests to. // If not provided, will submit to chromeos/testplatform/cros_test_platform builder BuilderID *buildbucketpb.BuilderID // TODO // CFT determines whether we will use CFT to run tests. CFT bool // TRV2 determines whether we will use Test Runner V2 TRV2 bool // CpconPublish determines whether we will upload to cpcon CpconPublish bool // CTPBuildTags are any tags that should be associated solely with the CTP // build and not passed down to the test_runner builds. CTPBuildTags map[string]string // Dimensions contains required dimensions for swarming bots Dimensions map[string]string // Image is the image to be provisioned on the DUT when running the test // Image is REQUIRED Image string // ImageBucket is the GS bucket name where we will pull the image // If not provided, ImageBucket will be `chromeos-image-archive` ImageBucket string // Keyvals will be passed into autotest Keyvals map[string]string // LacrosPath is the GS path to a Lacros object LacrosPath string // MaxRetries controls the amount of times CTP will attempt to retry a test MaxRetries int // Model specifies what model a test should run on Model string // Pool specifies what `label-pool` dimension we should run a test on // Pool is REQUIRED Pool string // Priority is the swarming priority to run tests under // Priority and QSAccount cannot both be set Priority int64 // Properties are any input properties to the CTP build that aren't a part // of the CTP request built. Should not include a key with `requests` Properties map[string]interface{} // ProvisionLabels are any labels impacting how we provision a test ProvisionLabels map[string]string // QSAccount is what QuotaScheduler account the tests should run under // Priority and QSAccount cannot both be set QSAccount string // ResultsUploadConfig contains the desired ResultsUploadConfig. ResultsUploadConfig *test_platform.Request_Params_ResultsUploadConfig // SecondaryBoards is a list containing the boards of any secondary devices SecondaryBoards []string // SecondaryModels is a list containing the models of any secondary devices // Should either be equal to the length of SecondaryBoards or zero SecondaryModels []string // SecondaryImages is a list containing the images of any secondary devices // Should be of equal length to SecondaryBoards or zero SecondaryImages []string // SecondaryBoards is a list containing the LacrosPath of any secondary devices // Should either be equal to the length of SecondaryBoards or zero SecondaryLacrosPaths []string // TestPlan is the test plan we want to execute // These should not be built by hand, instead using a method in the CTP client lib TestPlan *test_platform.Request_TestPlan // TestRunnerBuildTags are any tags that should be applied to the // downstream Test Runner builds. TestRunnerBuildTags map[string]string // TimeoutMins is the timeout of the CTP run in minutes // If not set, will default to 360 TimeoutMins int // UseScheduke determines if we use Scheduke to schedule the CTP build UseScheduke bool }
CTP builder contains fields needed to send a build to CTP
func (*CTPBuilder) AddDefaultBBClient ¶
func (c *CTPBuilder) AddDefaultBBClient(ctx context.Context) error
AddDefaultBBClient adds a client respecting the CTPBuilder's configuration and should suffice for most use cases
func (*CTPBuilder) CtpTags ¶
func (c *CTPBuilder) CtpTags() map[string]string
CtpTags returns the tags we should attach to the parent CTP build.
func (*CTPBuilder) ScheduleCTPBuild ¶
func (c *CTPBuilder) ScheduleCTPBuild(ctx context.Context) (*buildbucketpb.Build, error)
ScheduleCTPBuild sends a buildbucket request based on CTPBuilder
func (*CTPBuilder) TestPlatformRequest ¶
func (c *CTPBuilder) TestPlatformRequest(buildTags map[string]string) (*test_platform.Request, error)
TestPlatformRequest constructs a cros_test_platform.Request from the given CTPBuilder
func (*CTPBuilder) TestRunnerTags ¶
func (c *CTPBuilder) TestRunnerTags() map[string]string
TestRunnerTags returns the tags we should attach to each test runner build by combining user supplied tags with generic metadata tags.
type ClientArgs ¶
ClientArgs are whatever args the bb client used to fetch the builds should use All fields have a sensible default for "standard" chromeos usage