Documentation
¶
Index ¶
- Constants
- Variables
- func NewBQClient(ctx context.Context, auth *auth.Authenticator) (*bigquery.Client, error)
- func PrepareOutDir(path string, append bool, clearPattern string) error
- func ReadTestFiles(r io.Reader, callback func(*TestFile) error) error
- func SubcommandCommandFetchDurations(authOpt *auth.Options) *subcommands.Command
- func SubcommandCommandFetchRejections(authOpt *auth.Options) *subcommands.Command
- func WriteFilterFile(fileName string, toSkip []string) error
- func WriteInvertedFilterFile(fileName string, toSkip []string) error
- func WriteTestFiles(ctx context.Context, bqClient *bigquery.Client, w io.Writer) error
- type BaseCommandRun
- type BaseSelectRun
- func (r *BaseSelectRun) LoadChangedFiles() error
- func (r *BaseSelectRun) LoadGraph(fileName string) error
- func (r *BaseSelectRun) LoadStrategy(cfgFileName string) error
- func (r *BaseSelectRun) LoadTestFileSet(fileName string) error
- func (r *BaseSelectRun) LogChangedFiles(ctx context.Context)
- func (r *BaseSelectRun) ValidateFlags() error
- type GitBasedStrategyConfig
- func (*GitBasedStrategyConfig) Descriptor() ([]byte, []int)deprecated
- func (x *GitBasedStrategyConfig) GetChangeLogDistanceFactor() float32
- func (x *GitBasedStrategyConfig) GetFileStructureDistanceFactor() float32
- func (x *GitBasedStrategyConfig) GetThresholds() []*proto.Threshold
- func (*GitBasedStrategyConfig) ProtoMessage()
- func (x *GitBasedStrategyConfig) ProtoReflect() protoreflect.Message
- func (x *GitBasedStrategyConfig) Reset()
- func (x *GitBasedStrategyConfig) String() string
- type TestFile
- func (*TestFile) Descriptor() ([]byte, []int)deprecated
- func (x *TestFile) GetPath() string
- func (x *TestFile) GetTestNames() []string
- func (x *TestFile) GetTestTargets() []string
- func (*TestFile) ProtoMessage()
- func (x *TestFile) ProtoReflect() protoreflect.Message
- func (x *TestFile) Reset()
- func (x *TestFile) String() string
Constants ¶
const ( MinChangedFiles = 1 MaxChangedFiles = 100 )
The range of the number of changed files to enable RTS. If the number of changed files is not in this range, then RTS is disabled. Note that 99.3% of developer-authored git commits change <= 100 files, see bit.ly/chromium-rts
Variables ¶
var File_infra_rts_internal_chromium_rts_chromium_proto protoreflect.FileDescriptor
Functions ¶
func NewBQClient ¶
func PrepareOutDir ¶
prepareOutDir ensures that a dir exists and does not have files that match clearPattern glob, e.g. "*.jsonl.gz".
func ReadTestFiles ¶
ReadTestFiles reads test files written by writeTestFilesFrom().
func SubcommandCommandFetchDurations ¶
func SubcommandCommandFetchDurations(authOpt *auth.Options) *subcommands.Command
func SubcommandCommandFetchRejections ¶
func SubcommandCommandFetchRejections(authOpt *auth.Options) *subcommands.Command
func WriteFilterFile ¶
func WriteInvertedFilterFile ¶
Types ¶
type BaseCommandRun ¶
type BaseCommandRun struct {
subcommands.CommandRunBase
}
func (*BaseCommandRun) Done ¶
func (r *BaseCommandRun) Done(err error) int
type BaseSelectRun ¶
type BaseSelectRun struct { BaseCommandRun Checkout string ModelDir string Out string TargetChangeRecall float64 IgnoreExceptions bool ChangeRef string GenerateInverse bool ChangedFiles stringset.Set // files different between origin/main and the working tree TestFiles map[string]*TestFile // indexed by source-absolute test file name Strategy git.SelectionStrategy }
func (*BaseSelectRun) LoadChangedFiles ¶
func (r *BaseSelectRun) LoadChangedFiles() error
LoadChangedFiles initializes r.changedFiles.
func (*BaseSelectRun) LoadGraph ¶
func (r *BaseSelectRun) LoadGraph(fileName string) error
LoadGraph loads r.strategy.Graph from the model.
func (*BaseSelectRun) LoadStrategy ¶
func (r *BaseSelectRun) LoadStrategy(cfgFileName string) error
loadStrategy initializes r.strategy fields, except r.strategy.Graph.
func (*BaseSelectRun) LoadTestFileSet ¶
func (r *BaseSelectRun) LoadTestFileSet(fileName string) error
LoadTestFileSet loads r.testFiles.
func (*BaseSelectRun) LogChangedFiles ¶
func (r *BaseSelectRun) LogChangedFiles(ctx context.Context)
func (*BaseSelectRun) ValidateFlags ¶
func (r *BaseSelectRun) ValidateFlags() error
type GitBasedStrategyConfig ¶
type GitBasedStrategyConfig struct { // Value for git.EdgeReader.ChangeLogDistanceFactor; ChangeLogDistanceFactor float32 `` /* 136-byte string literal not displayed */ // Value for git.EdgeReader.FileStructureDistanceFactor. FileStructureDistanceFactor float32 `` /* 148-byte string literal not displayed */ // Thresholds with change recalls and savings, // ordered by change recall. Thresholds []*proto.Threshold `protobuf:"bytes,3,rep,name=thresholds,proto3" json:"thresholds,omitempty"` // contains filtered or unexported fields }
Configuration of a git-based selection strategy.
func (*GitBasedStrategyConfig) Descriptor
deprecated
func (*GitBasedStrategyConfig) Descriptor() ([]byte, []int)
Deprecated: Use GitBasedStrategyConfig.ProtoReflect.Descriptor instead.
func (*GitBasedStrategyConfig) GetChangeLogDistanceFactor ¶
func (x *GitBasedStrategyConfig) GetChangeLogDistanceFactor() float32
func (*GitBasedStrategyConfig) GetFileStructureDistanceFactor ¶
func (x *GitBasedStrategyConfig) GetFileStructureDistanceFactor() float32
func (*GitBasedStrategyConfig) GetThresholds ¶
func (x *GitBasedStrategyConfig) GetThresholds() []*proto.Threshold
func (*GitBasedStrategyConfig) ProtoMessage ¶
func (*GitBasedStrategyConfig) ProtoMessage()
func (*GitBasedStrategyConfig) ProtoReflect ¶
func (x *GitBasedStrategyConfig) ProtoReflect() protoreflect.Message
func (*GitBasedStrategyConfig) Reset ¶
func (x *GitBasedStrategyConfig) Reset()
func (*GitBasedStrategyConfig) String ¶
func (x *GitBasedStrategyConfig) String() string
type TestFile ¶
type TestFile struct { // Source-absolute path to the test file, e.g. // "//chrome/renderer/autofill/password_autofill_agent_browsertest.cc". Path string `protobuf:"bytes,1,opt,name=path,proto3" json:"path,omitempty"` // Names of tests known to be defined in the the file. // The names are native to the test framework, e.g. // "PasswordAutofillAgentTest.NoMayUsePlaceholderAndPlaceholderOnForm". TestNames []string `protobuf:"bytes,2,rep,name=test_names,json=testNames,proto3" json:"test_names,omitempty"` // Test targets where the test file was observed, e.g. "browser_tests". TestTargets []string `protobuf:"bytes,3,rep,name=test_targets,json=testTargets,proto3" json:"test_targets,omitempty"` // contains filtered or unexported fields }
A test file used in Chromium.
Used in an RTS model, in file "test-files.jsonl" encoded as JSON Lines of TestFile protojson messages.
func (*TestFile) Descriptor
deprecated
func (*TestFile) GetTestNames ¶
func (*TestFile) GetTestTargets ¶
func (*TestFile) ProtoMessage ¶
func (*TestFile) ProtoMessage()
func (*TestFile) ProtoReflect ¶
func (x *TestFile) ProtoReflect() protoreflect.Message