Documentation ¶
Index ¶
Constants ¶
View Source
const ( ReleaseBranchName = "__release__" OtherProtectedBranchName = "__protected__" )
Variables ¶
This section is empty.
Functions ¶
func RunTestSuite ¶
func RunTestSuite(t *testing.T, handlerProvider func() TestHandler)
RunTestSuite runs a set of test cases using Syncer with the provided TestHandler. Use this test suite to ensure compliance with Sync behavior.
The following behavior is asserted:
Local validation ¶
- Prevent duplicate module identities across module dirs on a branch.
Syncing commits ¶
CONDITION RESUME FROM (-> means fallback) new remote branch: unprotected: any synced commit from any branch -> START of branch protected: not release branch: START of branch release lineage: empty: START of branch not empty: content match(HEAD of Release) -> HEAD of branch existing remote branch: not previously synced: content match -> HEAD of branch previously synced: protected: protect branch && any synced commit from branch -> error unprotected: any synced commit from any branch -> content match -> HEAD of branch
Types ¶
type TestHandler ¶
type TestHandler interface { bufsync.Handler ManuallyPushModule( ctx context.Context, t *testing.T, targetModuleIdentity bufmoduleref.ModuleIdentity, branchName string, manifest *modulev1alpha1.Blob, blobs []*modulev1alpha1.Blob, ) }
TestHandler is a bufsync.Handler with a few helpful utilities for tests to set up and assert some state.
Click to show internal directories.
Click to hide internal directories.