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 ¶
StoreSuite writes a test suite in JSON format.
func StoreSuiteFile ¶
StoreSuiteFile writes a test suite to a JSON file.
Types ¶
type Context ¶
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 ¶
GithubRepository specifies a repository on github.
func (GithubRepository) CloneURL ¶
func (r GithubRepository) CloneURL() string
CloneURL returns the git clone URL.
func (GithubRepository) String ¶
func (r GithubRepository) String() string
func (GithubRepository) URL ¶
func (r GithubRepository) URL() string
URL returns the Github repository URL.
type Metadata ¶
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. All file path references will // be relative to this directory. If empty the root of the repository is // used. 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"` // 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.
type Project ¶
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 ¶
type Projects []*Project
Projects is a collection of third-party integration tests.
func (Projects) Ranked ¶
Ranked returns a copy of the projects list ranked in desending order of popularity.
type Step ¶
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 ¶
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 ¶
LoadSuiteFile loads a test suite from a JSON file.