Documentation ¶
Overview ¶
Package thirdparty executes integration tests based on third-party projects that use avo.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StoreSuite ¶ added in v0.5.0
StoreSuite writes a test suite in JSON format.
func StoreSuiteFile ¶ added in v0.5.0
StoreSuiteFile writes a test suite to a JSON file.
Types ¶
type Context ¶ added in v0.3.0
type Context struct { // Path to the avo version under test. AvoDirectory string // Path to the checked out third-party repository. RepositoryDirectory string }
Context specifies execution environment parameters for a third-party test.
type GithubRepository ¶ added in v0.3.0
GithubRepository specifies a repository on github.
func (GithubRepository) CloneURL ¶ added in v0.3.0
func (r GithubRepository) CloneURL() string
CloneURL returns the git clone URL.
func (GithubRepository) String ¶ added in v0.3.0
func (r GithubRepository) String() string
func (GithubRepository) URL ¶ added in v0.5.0
func (r GithubRepository) URL() string
URL returns the Github repository URL.
type Metadata ¶ added in v0.4.0
type Metadata struct { // Repository description. Description string `json:"description,omitempty"` // Homepage URL. Not the same as the Github page. Homepage string `json:"homepage,omitempty"` // Number of Github stars. Stars int `json:"stars,omitempty"` }
Metadata about the repository.
type Package ¶
type Package struct { // Sub-package within the project under test. Used as the root directory for // the test unless explicitly overridden. SubPackage string `json:"pkg,omitempty"` // Path to the module file for the avo generator package. This is necessary // so the integration test can insert replace directives to point at the avo // version under test. Module string `json:"module"` // Root directory for all steps in the test. All file path references will // be relative to this directory. If empty, the sub-package directory is // used, or otherwise the root of the repository. Root string `json:"root,omitempty"` // Setup steps. These run prior to the insertion of avo replace directives, // therefore should be used if it's necessary to initialize new go modules // within the repository. Setup []*Step `json:"setup,omitempty"` // Steps to run the avo code generator. Generate []*Step `json:"generate"` // Test steps. If empty, defaults to "go test ./...". Test []*Step `json:"test,omitempty"` }
Package defines an integration test for a package within a project.
func (*Package) IsRoot ¶ added in v0.5.0
IsRoot reports whether the package is the root of the containing project.
func (*Package) Steps ¶ added in v0.3.0
Steps generates the list of steps required to execute the integration test for this package. Context specifies execution environment parameters.
func (*Package) WorkingDirectory ¶ added in v0.6.0
WorkingDirectory returns the base directory for all steps in the test.
type Project ¶ added in v0.5.0
type Project struct { // Repository for the project. At the moment, all projects are available on // github. Repository GithubRepository `json:"repository"` // Repository metadata. Metadata Metadata `json:"metadata"` // Default git branch. This is used when testing against the latest version. DefaultBranch string `json:"default_branch,omitempty"` // Version as a git sha, tag or branch. Version string `json:"version"` // If the project test has a known problem, record it by setting this to a // non-zero avo issue number. If set, the project will be skipped in // testing. KnownIssue int `json:"known_issue,omitempty"` // Packages within the project to test. Packages []*Package `json:"packages"` }
Project defines an integration test based on a third-party project using avo.
type Projects ¶ added in v0.5.0
type Projects []*Project
Projects is a collection of third-party integration tests.
func (Projects) Ranked ¶ added in v0.5.0
Ranked returns a copy of the projects list ranked in desending order of popularity.
type Step ¶ added in v0.3.0
type Step struct { Name string `json:"name,omitempty"` WorkingDirectory string `json:"dir,omitempty"` Commands []string `json:"commands"` }
Step represents a set of commands to run as part of the testing plan for a third-party package.
type Suite ¶ added in v0.5.0
type Suite struct { // Projects to test. Projects Projects `json:"projects"` // Time of the last update to project metadata. MetadataLastUpdate time.Time `json:"metadata_last_update"` }
Suite defines a third-party test suite.
func LoadSuiteFile ¶ added in v0.5.0
LoadSuiteFile loads a test suite from a JSON file.