Documentation ¶
Index ¶
- Constants
- func AssertGrpcError(t *testing.T, err error, expectedCode codes.Code, containsText string)
- func AuthorsEqual(a *pb.CommitAuthor, b *pb.CommitAuthor) bool
- func CommitsEqual(a *pb.GitCommit, b *pb.GitCommit) bool
- func FindLocalBranchCommitAuthorsEqual(a *pb.FindLocalBranchCommitAuthor, b *pb.FindLocalBranchCommitAuthor) bool
- func FindLocalBranchResponsesEqual(a *pb.FindLocalBranchResponse, b *pb.FindLocalBranchResponse) bool
- func GitlabTestStoragePath() string
- func MustReadFile(t *testing.T, filename string) []byte
- func MustRunCommand(t *testing.T, stdin io.Reader, name string, args ...string) []byte
- func TestRepository() *pb.Repository
Constants ¶
const TestRelativePath = "gitlab-test.git"
TestRelativePath is the path inside its storage of the gitlab-test repo
Variables ¶
This section is empty.
Functions ¶
func AssertGrpcError ¶ added in v0.5.0
AssertGrpcError asserts the passed err is of the same code as expectedCode. Optionally, it can assert the error contains the text of containsText if the latter is not an empty string.
func AuthorsEqual ¶ added in v0.15.0
func AuthorsEqual(a *pb.CommitAuthor, b *pb.CommitAuthor) bool
AuthorsEqual tests if two `CommitAuthor`s are equal
func CommitsEqual ¶ added in v0.15.0
CommitsEqual tests if two `GitCommit`s are equal
func FindLocalBranchCommitAuthorsEqual ¶ added in v0.15.0
func FindLocalBranchCommitAuthorsEqual(a *pb.FindLocalBranchCommitAuthor, b *pb.FindLocalBranchCommitAuthor) bool
FindLocalBranchCommitAuthorsEqual tests if two `FindLocalBranchCommitAuthor`s are equal
func FindLocalBranchResponsesEqual ¶ added in v0.15.0
func FindLocalBranchResponsesEqual(a *pb.FindLocalBranchResponse, b *pb.FindLocalBranchResponse) bool
FindLocalBranchResponsesEqual tests if two `FindLocalBranchResponse`s are equal
func GitlabTestStoragePath ¶ added in v0.8.0
func GitlabTestStoragePath() string
GitlabTestStoragePath returns the storage path to the gitlab-test repo.
func MustReadFile ¶
MustReadFile returns the content of a file or fails at once.
func MustRunCommand ¶ added in v0.5.0
MustRunCommand runs a command with an optional standard input and returns the standard output, or fails.
func TestRepository ¶ added in v0.12.0
func TestRepository() *pb.Repository
TestRepository returns the `Repository` object for the gitlab-test repo. Tests should be calling this function instead of cloning the repo themselves. Tests that involve modifications to the repo should copy/clone the repo via the `Repository` returned from this function.
Types ¶
This section is empty.