Documentation ¶
Overview ¶
Copyright 2019 The Chromium OS Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- type File
- type RemoteProject
- type RepoHarness
- func (r *RepoHarness) AddFile(project RemoteProject, branch string, file File) (string, error)
- func (r *RepoHarness) AddFiles(project RemoteProject, branch string, files []File) (string, error)
- func (r *RepoHarness) AssertProjectBranchEqual(project RemoteProject, branch, snapshotPath string) error
- func (r *RepoHarness) AssertProjectBranchHasAncestor(project RemoteProject, branch, snapshotPath, snapshotBranch string) error
- func (r *RepoHarness) AssertProjectBranches(project RemoteProject, branches []string) error
- func (r *RepoHarness) AssertProjectBranchesExact(project RemoteProject, branches []string) error
- func (r *RepoHarness) AssertProjectBranchesMissing(project RemoteProject, branches []string) error
- func (r *RepoHarness) CreateRemoteRef(project RemoteProject, ref string, commit string) error
- func (r *RepoHarness) GetRemotePath(project RemoteProject) string
- func (r *RepoHarness) HarnessRoot() string
- func (r *RepoHarness) Initialize(config *RepoHarnessConfig) error
- func (r *RepoHarness) Manifest() repo.Manifest
- func (r *RepoHarness) ReadFile(project RemoteProject, branch, filePath string) ([]byte, error)
- func (r *RepoHarness) Snapshot(path string) (string, error)
- func (r *RepoHarness) Teardown() error
- type RepoHarnessConfig
Constants ¶
This section is empty.
Variables ¶
var (
CommandRunnerImpl cmd.CommandRunner = cmd.RealCommandRunner{}
)
Functions ¶
This section is empty.
Types ¶
type RemoteProject ¶
Identifies a remote project.
func GetRemoteProject ¶
func GetRemoteProject(project repo.Project) RemoteProject
type RepoHarness ¶
type RepoHarness struct {
// contains filtered or unexported fields
}
func (*RepoHarness) AddFile ¶
func (r *RepoHarness) AddFile(project RemoteProject, branch string, file File) (string, error)
AddFile adds a file to the specified branch in the specified remote project. Returns the sha1 of the commit that adds the file.
func (*RepoHarness) AddFiles ¶
func (r *RepoHarness) AddFiles(project RemoteProject, branch string, files []File) (string, error)
AddFiles adds files to the specified branch in the specified remote project. Returns a map with the sha1's of the commits.
func (*RepoHarness) AssertProjectBranchEqual ¶
func (r *RepoHarness) AssertProjectBranchEqual(project RemoteProject, branch, snapshotPath string) error
AssertProjectBranchEqual asserts that the specified branch in the project matches the corresponding branch in the given snapshot.
func (*RepoHarness) AssertProjectBranchHasAncestor ¶
func (r *RepoHarness) AssertProjectBranchHasAncestor(project RemoteProject, branch, snapshotPath, snapshotBranch string) error
AssertProjectBranchHasAncestor asserts that the specified branch in the project descends from the given snapshot.
func (*RepoHarness) AssertProjectBranches ¶
func (r *RepoHarness) AssertProjectBranches(project RemoteProject, branches []string) error
AssertProjectBranches asserts that the remote project has the correct branches.
func (*RepoHarness) AssertProjectBranchesExact ¶
func (r *RepoHarness) AssertProjectBranchesExact(project RemoteProject, branches []string) error
AssertProjectBranchesExact asserts that the remote project has only the correct branches.
func (*RepoHarness) AssertProjectBranchesMissing ¶
func (r *RepoHarness) AssertProjectBranchesMissing(project RemoteProject, branches []string) error
AssertProjectBranchesMissing asserts that the remote project does not have the specified branches.
func (*RepoHarness) CreateRemoteRef ¶
func (r *RepoHarness) CreateRemoteRef(project RemoteProject, ref string, commit string) error
CreateRemoteRef creates a remote ref for a specific project. Otherwise, a temporary local checkout will be created and an empty commit will be used to create the remote ref.
func (*RepoHarness) GetRemotePath ¶
func (r *RepoHarness) GetRemotePath(project RemoteProject) string
GetRemotePath returns the path to the remote project repo.
func (*RepoHarness) HarnessRoot ¶
func (r *RepoHarness) HarnessRoot() string
func (*RepoHarness) Initialize ¶
func (r *RepoHarness) Initialize(config *RepoHarnessConfig) error
func (*RepoHarness) Manifest ¶
func (r *RepoHarness) Manifest() repo.Manifest
func (*RepoHarness) ReadFile ¶
func (r *RepoHarness) ReadFile(project RemoteProject, branch, filePath string) ([]byte, error)
ReadFile reads a file from a remote.
func (*RepoHarness) Snapshot ¶
func (r *RepoHarness) Snapshot(path string) (string, error)
Snapshot recursively copies a directory's contents to a temp dir.
func (*RepoHarness) Teardown ¶
func (r *RepoHarness) Teardown() error