Documentation
¶
Overview ¶
Package runs provides the types used by test_all
Index ¶
- func GOPATH() string
- type Backend
- type Config
- type Report
- type ReportRun
- type Run
- func (r *Run) BinaryName() string
- func (r *Run) BinaryPath() string
- func (r *Run) FailedTestsCSV() string
- func (r *Run) Init(Opt RunOpt)
- func (r *Run) Logs() []string
- func (r *Run) MakeTestBinary(Opt RunOpt)
- func (r *Run) Name() string
- func (r *Run) PackagePath() string
- func (r *Run) RemoveTestBinary(Opt RunOpt)
- func (r *Run) Run(Opt RunOpt, LogDir string, result chan<- *Run)
- type RunOpt
- type Runs
- type Test
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
Backend string // name of the backend directory
Remote string // name of the test remote
FastList bool // set to test with -fast-list
Short bool // set to test with -short
OneOnly bool // set to run only one backend test at once
MaxFile string // file size limit
CleanUp bool // when running clean, run cleanup first
Ignore []string // test names to ignore the failure of
Tests []string // paths of tests to run, blank for all
IgnoreTests []string // paths of tests not to run, blank for none
ListRetries int // -list-retries if > 0
ExtraTime float64 // factor to multiply the timeout by
Env []string // environment variables to set in form KEY=VALUE
}
Backend describes a backend test
FIXME make bucket-based remotes set sub-dir automatically???
type Config ¶
Config describes the config for this program
func (*Config) FilterBackendsByBackends ¶
FilterBackendsByBackends filters the Backends with the backendNames passed in
func (*Config) FilterBackendsByRemotes ¶
FilterBackendsByRemotes filters the Backends with the remotes passed in.
If no backend is found with a remote is found then synthesize one
func (*Config) FilterTests ¶
FilterTests filters the incoming tests into the backends selected
type Report ¶
type Report struct {
LogDir string // output directory for logs and report
StartTime time.Time // time started
DateTime string // directory name for output
Duration time.Duration // time the run took
Failed Runs // failed runs
Passed Runs // passed runs
Runs []ReportRun // runs to report
Version string // rclone version
Previous string // previous test name if known
IndexHTML string // path to the index.html file
URL string // online version
Branch string // rclone branch
Commit string // rclone commit
GOOS string // Go OS
GOARCH string // Go Arch
GoVersion string // Go Version
}
Report holds the info to make a report on a series of test runs
func (*Report) LogHTML ¶
func (r *Report) LogHTML()
LogHTML writes the summary to index.html in LogDir
func (*Report) LogJSON ¶
func (r *Report) LogJSON()
LogJSON writes the summary to index.json in LogDir
func (*Report) LogSummary ¶
func (r *Report) LogSummary()
LogSummary writes the summary to the log file
func (*Report) RecordResult ¶
RecordResult should be called with a Run when it has finished to be recorded into the Report
type Run ¶
type Run struct {
// Config
Remote string // name of the test remote
Backend string // name of the backend
Path string // path to the source directory
FastList bool // add -fast-list to tests
Short bool // add -short
NoRetries bool // don't retry if set
OneOnly bool // only run test for this backend at once
NoBinary bool // set to not build a binary
SizeLimit int64 // maximum test file size
Ignore map[string]struct{}
ListRetries int // -list-retries if > 0
ExtraTime float64 // multiply the timeout by this
Env []string // environment variables in form KEY=VALUE
// Internals
CmdLine []string
CmdString string
Try int
FailedTests []string
RunFlag string
LogDir string // directory to place the logs
TrialName string // name/log file name of current trial
TrialNames []string // list of all the trials
// contains filtered or unexported fields
}
Run holds info about a running test
A run just runs one command line, but it can be run multiple times if retries are needed.
func (*Run) BinaryName ¶
BinaryName turns a package name into a binary name
func (*Run) BinaryPath ¶
BinaryPath turns a package name into a binary path
func (*Run) FailedTestsCSV ¶
FailedTestsCSV returns the failed tests as a comma separated string, limiting the number
func (*Run) MakeTestBinary ¶
MakeTestBinary makes the binary we will run
func (*Run) PackagePath ¶
PackagePath returns the path to the package
func (*Run) RemoveTestBinary ¶
RemoveTestBinary removes the binary made in makeTestBinary
type RunOpt ¶
type RunOpt struct {
MaxTries int // Number of times to try each test
MaxN int // Maximum number of tests to run at once
TestRemotes string // Comma separated list of remotes to test, e.g. 'TestSwift:,TestS3'
TestBackends string // Comma separated list of backends to test, e.g. 's3,googlecloudstorage
TestTests string // Comma separated list of tests to test, e.g. 'fs/sync,fs/operations'
Clean bool // Instead of testing, clean all left over test directories
RunOnly string // Run only those tests matching the regexp supplied
Timeout time.Duration // Maximum time to run each test for before giving up
Race bool // If set run the tests under the race detector
ConfigFile string // Path to config file
OutputDir string // Place to store results
EmailReport string // Set to email the report to the address supplied
DryRun bool // Print commands which would be executed only
URLBase string // Base for the online version
UploadPath string // Set this to an rclone path to upload the results here
Verbose bool // Set to enable verbose logging in the tests
ListRetries int // Number or times to retry listing - set to override the default
}
RunOpt holds the options for the Run
type Test ¶
type Test struct {
Path string // path to the source directory
FastList bool // if it is possible to add -fast-list to tests
Short bool // if it is possible to run the test with -short
AddBackend bool // set if Path needs the current backend appending
NoRetries bool // set if no retries should be performed
NoBinary bool // set to not build a binary in advance
LocalOnly bool // if set only run with the local backend
}
Test describes an integration test to run with `go test`