go: go.chromium.org/chromiumos/infra/go/internal/repo_harness Index | Files

package repo_harness

import "go.chromium.org/chromiumos/infra/go/internal/repo_harness"

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.


Package Files



var (
    CommandRunnerImpl cmd.CommandRunner = cmd.RealCommandRunner{}

type File Uses

type File struct {
    Name     string
    Contents []byte
    Perm     os.FileMode

type RemoteProject Uses

type RemoteProject struct {
    RemoteName  string
    ProjectName string

Identifies a remote project.

func GetRemoteProject Uses

func GetRemoteProject(project repo.Project) RemoteProject

type RepoHarness Uses

type RepoHarness struct {
    // contains filtered or unexported fields

func (*RepoHarness) AddFile Uses

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 Uses

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 Uses

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 Uses

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 Uses

func (r *RepoHarness) AssertProjectBranches(project RemoteProject, branches []string) error

AssertProjectBranches asserts that the remote project has the correct branches.

func (*RepoHarness) AssertProjectBranchesExact Uses

func (r *RepoHarness) AssertProjectBranchesExact(project RemoteProject, branches []string) error

AssertProjectBranchesExact asserts that the remote project has only the correct branches.

func (*RepoHarness) AssertProjectBranchesMissing Uses

func (r *RepoHarness) AssertProjectBranchesMissing(project RemoteProject, branches []string) error

AssertProjectBranchesMissing asserts that the remote project does not have the specified branches.

func (*RepoHarness) CreateRemoteRef Uses

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 Uses

func (r *RepoHarness) GetRemotePath(project RemoteProject) string

GetRemotePath returns the path to the remote project repo.

func (*RepoHarness) HarnessRoot Uses

func (r *RepoHarness) HarnessRoot() string

func (*RepoHarness) Initialize Uses

func (r *RepoHarness) Initialize(config *RepoHarnessConfig) error

func (*RepoHarness) Manifest Uses

func (r *RepoHarness) Manifest() repo.Manifest

func (*RepoHarness) ReadFile Uses

func (r *RepoHarness) ReadFile(project RemoteProject, branch, filePath string) ([]byte, error)

ReadFile reads a file from a remote.

func (*RepoHarness) Snapshot Uses

func (r *RepoHarness) Snapshot(path string) (string, error)

Snapshot recursively copies a directory's contents to a temp dir.

func (*RepoHarness) Teardown Uses

func (r *RepoHarness) Teardown() error

type RepoHarnessConfig Uses

type RepoHarnessConfig struct {
    // Initialize() will create a test harness with
    // the appropriate remote repos and a local repo.
    // Both remote and local repos will have the appropriate
    // projects created (with initialized git repos inside them).
    Manifest repo.Manifest

Package repo_harness imports 14 packages (graph) and is imported by 1 packages. Updated 2021-01-28. Refresh now. Tools for package owners.