Documentation ¶
Overview ¶
Package config defines common structs to carry configuration and associated stateful data.
Index ¶
- func ShouldConnect(target string) bool
- type Config
- func (c *Config) Build() bool
- func (c *Config) BuildArtifactsURLOverride() string
- func (c *Config) BuildBucketID() string
- func (c *Config) BuildBundle() string
- func (c *Config) BuildCfg() *build.Config
- func (c *Config) BuildOutDir() string
- func (c *Config) BuildWorkspace() string
- func (c *Config) BundleWorkspaces() []string
- func (c *Config) CheckPortageDeps() bool
- func (c *Config) CheckTestDeps() bool
- func (c *Config) CollectSysInfo() bool
- func (c *Config) CommonWorkspaces() []string
- func (c *Config) CompanionDUTs() map[string]string
- func (c *Config) ContinueAfterFailure() bool
- func (c *Config) DebuggerPortForwarding() bool
- func (c *Config) DebuggerPorts() map[debugger.DebugTarget]int
- func (c *Config) DefaultVarsDirs() []string
- func (c *Config) Devservers() []string
- func (c *Config) DownloadMode() protocol.DownloadMode
- func (c *Config) DownloadPrivateBundles() bool
- func (c *Config) ExcludeSkipped() bool
- func (c *Config) ExtraAllowedBuckets() []string
- func (c *Config) ExtraUSEFlags() []string
- func (c *Config) Features(dut *frameworkprotocol.DUTFeatures, ...) *protocol.Features
- func (c *Config) ForceSkips() map[string]*protocol.ForceSkip
- func (c *Config) InstallPortageDeps() bool
- func (c *Config) KeyDir() string
- func (c *Config) KeyFile() string
- func (c *Config) LocalBundleDir() string
- func (c *Config) LocalBundleGlob() string
- func (c *Config) LocalDataDir() string
- func (c *Config) LocalOutDir() string
- func (c *Config) LocalRunner() string
- func (c *Config) LocalTempDir() string
- func (c *Config) MaxSysMsgLogSize() int64
- func (c *Config) MaxTestFailures() int
- func (c *Config) MaybeMissingVars() string
- func (c *Config) Mode() Mode
- func (c *Config) MsgTimeout() time.Duration
- func (c *Config) Patterns() []string
- func (c *Config) PrimaryBundle() string
- func (c *Config) ProtoSSHConfig() *protocol.SSHConfig
- func (c *Config) Proxy() ProxyMode
- func (c *Config) ProxyCommand() string
- func (c *Config) RemoteBundleDir() string
- func (c *Config) RemoteBundleGlob() string
- func (c *Config) RemoteDataDir() string
- func (c *Config) RemoteOutDir() string
- func (c *Config) RemoteRunner() string
- func (c *Config) RemoteTempDir() string
- func (c *Config) ReportsServer() string
- func (c *Config) ResDir() string
- func (c *Config) Retries() int
- func (c *Config) SSHRetries() int
- func (c *Config) ShardIndex() int
- func (c *Config) ShardMethod() string
- func (c *Config) SwarmingTaskID() string
- func (c *Config) SystemServicesTimeout() time.Duration
- func (c *Config) TLWServer() string
- func (c *Config) Target() string
- func (c *Config) TastDir() string
- func (c *Config) TestVars() map[string]string
- func (c *Config) TotalShards() int
- func (c *Config) TrunkDir() string
- func (c *Config) UseEphemeralDevserver() bool
- func (c *Config) VarsFiles() []string
- func (c *Config) WaitUntilReady() bool
- func (c *Config) WaitUntilReadyTimeout() time.Duration
- type DeprecatedState
- type Mode
- type MutableConfig
- type ProxyMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ShouldConnect ¶
ShouldConnect tells whether we should connect to the specified target.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config contains shared configuration information for running or listing tests. All Config values are frozen and cannot be altered after construction.
func (*Config) BuildArtifactsURLOverride ¶
BuildArtifactsURLOverride is Google Cloud Storage URL of build artifacts specified in the command line. If it is empty, it should be detected from the DUT.
func (*Config) BuildBucketID ¶
BuildBucketID specifies the build bucket ID of the scheduled job that run Tast tests.
func (*Config) BuildBundle ¶
BuildBundle is name of the test bundle to rebuild (e.g. "cros").
func (*Config) BuildOutDir ¶
BuildOutDir is path to base directory under which executables are stored.
func (*Config) BuildWorkspace ¶
BuildWorkspace is path to workspace containing test bundle source code.
func (*Config) BundleWorkspaces ¶
BundleWorkspaces returns Go workspaces containing source code needed to build c.BuildBundle.
func (*Config) CheckPortageDeps ¶
CheckPortageDeps is check whether test bundle's dependencies are installed before building.
func (*Config) CheckTestDeps ¶
CheckTestDeps is whether test dependencies should be checked.
func (*Config) CollectSysInfo ¶
CollectSysInfo is collect system info (logs, crashes, etc.) generated during testing.
func (*Config) CommonWorkspaces ¶
CommonWorkspaces returns Go workspaces containing source code needed to build all Tast-related executables.
func (*Config) CompanionDUTs ¶
CompanionDUTs is role to address mapping of companion DUTs..
func (*Config) ContinueAfterFailure ¶
ContinueAfterFailure is try to run remaining local tests after bundle/DUT crash or lost SSH connection.
func (*Config) DebuggerPortForwarding ¶
DebuggerPortForwarding is whether port forwarding should be performed for you when debugging.
func (*Config) DebuggerPorts ¶
func (c *Config) DebuggerPorts() map[debugger.DebugTarget]int
DebuggerPorts is a mapping from binary to the port we want to debug said binary on.
func (*Config) DefaultVarsDirs ¶
DefaultVarsDirs is dirs containing default variable files.
func (*Config) Devservers ¶
Devservers is list of devserver URLs; set by -devservers but may be dynamically modified.
func (*Config) DownloadMode ¶
func (c *Config) DownloadMode() protocol.DownloadMode
DownloadMode is strategy to download external data files.
func (*Config) DownloadPrivateBundles ¶
DownloadPrivateBundles is whether to download private bundles if missing.
func (*Config) ExcludeSkipped ¶
ExcludeSkipped is whether tests which would be skipped are excluded.
func (*Config) ExtraAllowedBuckets ¶
ExtraAllowedBuckets is extra Google Cloud Storage buckets ephemeral devserver is allowed to access.
func (*Config) ExtraUSEFlags ¶
ExtraUSEFlags is additional USE flags to inject when determining features.
func (*Config) Features ¶
func (c *Config) Features(dut *frameworkprotocol.DUTFeatures, companions map[string]*frameworkprotocol.DUTFeatures) *protocol.Features
Features constructs Features from Config and protocol.DUTFeatures.
func (*Config) ForceSkips ¶
ForceSkips returns the mapping between name of disabled tests and the reason of disabling the test.
func (*Config) InstallPortageDeps ¶
InstallPortageDeps is install old or missing test bundle dependencies; no-op if CheckPortageDeps is false.
func (*Config) KeyFile ¶
KeyFile is the path to a private SSH key to use to connect to the target device.
func (*Config) LocalBundleDir ¶
LocalBundleDir is dir where packaged local test bundles are installed.
func (*Config) LocalBundleGlob ¶
LocalBundleGlob returns a file path glob that matches local test bundle executables.
func (*Config) LocalDataDir ¶
LocalDataDir is dir containing packaged local test data.
func (*Config) LocalOutDir ¶
LocalOutDir is dir where intermediate outputs of local tests are written.
func (*Config) LocalRunner ¶
LocalRunner is path to executable that runs local test bundles.
func (*Config) LocalTempDir ¶
LocalTempDir is dir where temporary files of local tests are written.
func (*Config) MaxSysMsgLogSize ¶
MaxSysMsgLogSize is size for truncate log files.
func (*Config) MaxTestFailures ¶
MaxTestFailures is maximum number of test failures.
func (*Config) MaybeMissingVars ¶
MaybeMissingVars is regex matching with variables which may be missing.
func (*Config) MsgTimeout ¶
MsgTimeout is timeout for reading control messages; default used if zero.
func (*Config) PrimaryBundle ¶
PrimaryBundle is the name of the primary bundle that remote fixtures are linked to.
func (*Config) ProtoSSHConfig ¶
ProtoSSHConfig returns an SSHConfig proto.
func (*Config) ProxyCommand ¶
ProxyCommand specifies the command to use to connect to the DUT.
func (*Config) RemoteBundleDir ¶
RemoteBundleDir is dir where packaged remote test bundles are installed.
func (*Config) RemoteBundleGlob ¶
RemoteBundleGlob returns a file path glob that matches remote test bundle executables.
func (*Config) RemoteDataDir ¶
RemoteDataDir is dir containing packaged remote test data.
func (*Config) RemoteOutDir ¶
RemoteOutDir is dir where intermediate outputs of remote tests are written.
func (*Config) RemoteRunner ¶
RemoteRunner is path to executable that runs remote test bundles.
func (*Config) RemoteTempDir ¶
RemoteTempDir is dir where temporary files of remote tests are written.
func (*Config) ReportsServer ¶
ReportsServer is address of Reports server if available.
func (*Config) ResDir ¶
ResDir is the path to the directory where test results should be written. It is only used for RunTestsMode.
func (*Config) SSHRetries ¶
SSHRetries is number of SSH connect retries.
func (*Config) ShardIndex ¶
ShardIndex specifies the index of shard to used in the current run.
func (*Config) ShardMethod ¶
ShardMethod specifies which sharding method we should use.
func (*Config) SwarmingTaskID ¶
SwarmingTaskID specifies the swarming task ID of the scheduled job that run Tast tests.
func (*Config) SystemServicesTimeout ¶
SystemServicesTimeout for waiting for system services to be ready in seconds. (Default: 120 seconds)
func (*Config) Target ¶
Target is the target device for testing, in the form "[<user>@]host[:<port>]".
func (*Config) TestVars ¶
TestVars is names and values of variables used to pass out-of-band data to tests.
func (*Config) TotalShards ¶
TotalShards is total number of shards to be used in a test run.
func (*Config) UseEphemeralDevserver ¶
UseEphemeralDevserver is start an ephemeral devserver if no devserver is specified.
func (*Config) WaitUntilReady ¶
WaitUntilReady is whether to wait for DUT to be ready before running tests.
func (*Config) WaitUntilReadyTimeout ¶
WaitUntilReadyTimeout set a timeout for the entire ready.Wait function. (Default: 120 seconds)
type DeprecatedState ¶
type DeprecatedState struct { RemoteDevservers []string // list of devserver URLs used by remote tests. TestNamesToSkip []string // tests that match patterns but are not sent to runners to run }
DeprecatedState hold state attributes which are accumulated over the course of the run.
DEPRECATED: DO NOT add new fields to this struct. DeprecatedState makes it difficult to reason about function contracts. Pass arguments explicitly instead. This struct will be removed eventually (b/191230756).
type MutableConfig ¶
type MutableConfig struct { KeyFile string KeyDir string Target string Patterns []string ResDir string Mode Mode TastDir string TrunkDir string Build bool BuildBundle string BuildWorkspace string BuildOutDir string CheckPortageDeps bool InstallPortageDeps bool UseEphemeralDevserver bool ExtraAllowedBuckets []string Devservers []string BuildArtifactsURLOverride string DownloadPrivateBundles bool DownloadMode protocol.DownloadMode TLWServer string ReportsServer string CompanionDUTs map[string]string SwarmingTaskID string BuildBucketID string LocalRunner string LocalBundleDir string LocalDataDir string LocalOutDir string LocalTempDir string RemoteRunner string RemoteBundleDir string PrimaryBundle string RemoteDataDir string RemoteOutDir string RemoteTempDir string TotalShards int ShardIndex int ShardMethod string SSHRetries int ContinueAfterFailure bool CheckTestDeps bool WaitUntilReady bool ExtraUSEFlags []string Proxy ProxyMode CollectSysInfo bool MaxTestFailures int ExcludeSkipped bool ProxyCommand string TestVars map[string]string VarsFiles []string DefaultVarsDirs []string MaybeMissingVars string DebuggerPorts map[debugger.DebugTarget]int DebuggerPortForwarding bool Retries int SystemServicesTimeout time.Duration MsgTimeout time.Duration WaitUntilReadyTimeout time.Duration MaxSysMsgLogSize int64 // ForceSkips is a mapping from a test name to the filter file name which specified // the test should be disabled. // Filter file example: // # The following tests will disabled. // -meta.DisabledTest1 // -meta.DisabledTest2 ForceSkips map[string]*protocol.ForceSkip }
MutableConfig is similar to Config, but its fields are mutable. Call Freeze to obtain a Config from MutableConfig.
func NewMutableConfig ¶
func NewMutableConfig(mode Mode, tastDir, trunkDir string) *MutableConfig
NewMutableConfig returns a new configuration for executing test runners in the supplied mode. It sets fields that are required by SetFlags. tastDir is the base directory under which files are written (e.g. /tmp/tast). trunkDir is the path to the ChromeOS checkout (within the chroot).
func (*MutableConfig) DeriveDefaults ¶
func (c *MutableConfig) DeriveDefaults() error
DeriveDefaults sets default config values to unset members, possibly deriving from already set members. It should be called after non-default values are set to c.
func (*MutableConfig) Freeze ¶
func (c *MutableConfig) Freeze() *Config
Freeze returns a frozen configuration object.
func (*MutableConfig) SetFlags ¶
func (c *MutableConfig) SetFlags(f *flag.FlagSet)
SetFlags adds common run-related flags to f that store values in Config.