Documentation
¶
Overview ¶
Package testkit provides the single in-process GitHub API double for adapter and gateway conformance. It has no external credentials or I/O.
Index ¶
- type FakeGitHub
- type GitHub
- func (f *GitHub) AdvanceBranch(branch string) string
- func (f *GitHub) AppliedPull(head string) int
- func (f *GitHub) AppliedRef(head string) int
- func (f *GitHub) BaseSHA() string
- func (f *GitHub) CompleteMerge(number int64)
- func (f *GitHub) EditPull(number int64, edit func(*PullRequest))
- func (f *GitHub) Head(branch string) string
- func (f *GitHub) HeadSHA(head string) string
- func (f *GitHub) MarkReady(number int64)
- func (f *GitHub) MergeReads() int
- func (f *GitHub) MergeRequests() int
- func (f *GitHub) Name() string
- func (f *GitHub) Owner() string
- func (f *GitHub) PullNumber(head string) int64
- func (f *GitHub) PullReads(head string) int
- func (f *GitHub) PushRequests() int
- func (f *GitHub) RefReads(head string) int
- func (f *GitHub) Repository() string
- func (f *GitHub) RewindBranch(branch string) string
- func (f *GitHub) RewriteBranchFile(branch, path, content string) string
- func (f *GitHub) SetApplyThenDrop(ref, pull bool)
- func (f *GitHub) SetMergeMode(mode string)
- func (f *GitHub) SetReadback(branch, pull ReadbackMode)
- func (f *GitHub) Token() string
- func (f *GitHub) URL() string
- type PullRequest
- type ReadbackMode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeGitHub ¶
type FakeGitHub = GitHub
FakeGitHub is the reconciliation suite's name for the shared adapter fake.
type GitHub ¶
type GitHub struct {
// contains filtered or unexported fields
}
GitHub is an httptest GitHub that models the endpoints the adapter uses, with git's content addressing for blobs: a blob's ID is its real SHA-1, so the adapter's blob checks are exercised for real. Trees and commits get stable made-up IDs, and every commit is unique, as on GitHub, where the commit time is part of the ID.
func NewFakeGitHub ¶
func (*GitHub) AdvanceBranch ¶
AdvanceBranch models another writer advancing a branch after preparation.
func (*GitHub) AppliedPull ¶
AppliedPull counts successful provider pull creation writes for a branch.
func (*GitHub) AppliedRef ¶
AppliedRef counts successful provider ref writes for the full ref name.
func (*GitHub) CompleteMerge ¶
CompleteMerge makes the queued effect visible through the authoritative read.
func (*GitHub) EditPull ¶
func (f *GitHub) EditPull(number int64, edit func(*PullRequest))
EditPull models an independent provider-side change under the fixture lock.
func (*GitHub) MergeReads ¶
MergeReads counts authoritative pull-number reads for merge reconciliation.
func (*GitHub) MergeRequests ¶
MergeRequests counts attempted provider merge writes, including refusals.
func (*GitHub) PullNumber ¶
PullNumber returns the pull created from the named fixture branch.
func (*GitHub) PushRequests ¶
PushRequests counts attempted ref updates, including refused ones.
func (*GitHub) Repository ¶
Repository is the fixture repository's name.
func (*GitHub) RewindBranch ¶
RewindBranch models a concurrent forced move to the current commit's parent.
func (*GitHub) RewriteBranchFile ¶
RewriteBranchFile models a concurrent force rewrite with the same parents and a different blob, keeping content and parent mismatch controls distinct.
func (*GitHub) SetApplyThenDrop ¶
SetApplyThenDrop drops the response after a successful ref or pull write.
func (*GitHub) SetMergeMode ¶
SetMergeMode selects an acknowledged queue, pending request, or actual merge.
func (*GitHub) SetReadback ¶
func (f *GitHub) SetReadback(branch, pull ReadbackMode)
SetReadback controls provider read visibility without changing provider state.
type PullRequest ¶
type ReadbackMode ¶
type ReadbackMode string
ReadbackMode controls visibility while preserving applied provider state.
const ( ReadbackNormal ReadbackMode = "normal" ReadbackAbsent ReadbackMode = "absent" ReadbackMismatch ReadbackMode = "mismatch" ReadbackInconclusive ReadbackMode = "inconclusive" )