MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / Run

Method Run

rest/utilities_testing_isgr.go:68–91  ·  view source on GitHub ↗
(test func(t *testing.T))

Source from the content-addressed store, hash-verified

66}
67
68func (runner *SGRTestRunner) Run(test func(t *testing.T)) {
69 if runner.initialisedInsideRunnerCode {
70 require.FailNow(runner.TB(), "must not initialise SGRPeers outside Run() method")
71 }
72
73 runner.initialisedInsideRunnerCode = true
74 defer func() {
75 // reset bool post test run to ensure no one can setup SetupSGRPeers outside run method upon completion of Run()
76 runner.initialisedInsideRunnerCode = false
77 }()
78
79 if !runner.SkipSubtest[RevtreeSubtestName] {
80 runner.t.Run(RevtreeSubtestName, func(t *testing.T) {
81 runner.SupportedSubprotocols = []string{db.CBMobileReplicationV3.SubprotocolString()}
82 test(t)
83 })
84 }
85 if !runner.SkipSubtest[VersionVectorSubtestName] {
86 runner.t.Run(VersionVectorSubtestName, func(t *testing.T) {
87 runner.SupportedSubprotocols = []string{db.CBMobileReplicationV4.SubprotocolString()}
88 test(t)
89 })
90 }
91}
92
93func (runner *SGRTestRunner) RunSubprotocolV3(test func(t *testing.T)) {
94 if runner.initialisedInsideRunnerCode {

Calls 4

TBMethod · 0.95
testStruct · 0.85
SubprotocolStringMethod · 0.80
RunMethod · 0.65