Skip to content

Commit 367a62c

Browse files
authored
CBG-4810 blip test: separate user creation (#7686)
1 parent 39c65d7 commit 367a62c

17 files changed

+282
-379
lines changed

rest/adminapitest/admin_api_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ func TestFlush(t *testing.T) {
396396

397397
log.Printf("Flushing db...")
398398
rest.RequireStatus(t, rt.SendAdminRequest("POST", "/db/_flush", ""), 200)
399-
require.NoError(t, rt.SetAdminParty(true)) // needs to be re-enabled after flush since guest user got wiped
399+
rt.SetAdminParty(true) // needs to be re-enabled after flush since guest user got wiped
400400

401401
// After the flush, the db exists but the documents are gone:
402402
rest.RequireStatus(t, rt.SendAdminRequest("GET", "/db/", ""), 200)

rest/attachment_test.go

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2438,10 +2438,9 @@ func TestProveAttachmentNotFound(t *testing.T) {
24382438
dbConfig := rt.NewDbConfig()
24392439
dbConfig.AllowConflicts = base.Ptr(true)
24402440
RequireStatus(t, rt.CreateDatabase("db", dbConfig), http.StatusCreated)
2441-
require.NoError(t, rt.SetAdminParty(true))
2441+
rt.SetAdminParty(true)
24422442

2443-
bt, err := NewBlipTesterFromSpecWithRT(t, nil, rt)
2444-
assert.NoError(t, err, "Error creating BlipTester")
2443+
bt := NewBlipTesterFromSpecWithRT(rt, nil)
24452444
defer bt.Close()
24462445

24472446
attachmentData := []byte("attachmentA")
@@ -2527,13 +2526,10 @@ func TestPutInvalidAttachment(t *testing.T) {
25272526

25282527
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeySync, base.KeySyncMsg)
25292528

2530-
// Create blip tester
2531-
bt, err := NewBlipTesterFromSpec(t, BlipTesterSpec{
2532-
connectingUsername: "user1",
2533-
connectingPassword: "1234",
2534-
connectingUserChannelGrants: []string{"*"}, // All channels
2529+
const username = "user1"
2530+
bt := NewBlipTesterFromSpec(t, BlipTesterSpec{
2531+
connectingUsername: username,
25352532
})
2536-
require.NoError(t, err, "Unexpected error creating BlipTester")
25372533
defer bt.Close()
25382534

25392535
for _, test := range tests {
@@ -2878,6 +2874,7 @@ func TestBlipPushRevWithAttachment(t *testing.T) {
28782874
rt := NewRestTesterPersistentConfig(t)
28792875
defer rt.Close()
28802876
const username = "bernard"
2877+
rt.CreateUser(username, nil)
28812878

28822879
opts := &BlipTesterClientOpts{Username: username, SupportedBLIPProtocols: SupportedBLIPProtocols}
28832880
btc := btcRunner.NewBlipTesterClientOptsWithRT(rt, opts)

rest/blip_api_attachment_test.go

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,10 @@ func TestPutAttachmentViaBlipGetViaRest(t *testing.T) {
413413

414414
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeySync, base.KeySyncMsg)
415415

416-
// Create blip tester
417-
bt, err := NewBlipTesterFromSpec(t,
416+
bt := NewBlipTesterFromSpec(t,
418417
BlipTesterSpec{
419418
connectingUsername: "user1",
420-
connectingPassword: "1234",
421419
})
422-
require.NoError(t, err)
423420
defer bt.Close()
424421

425422
attachmentBody := "attach"
@@ -458,13 +455,9 @@ func TestPutAttachmentViaBlipGetViaRest(t *testing.T) {
458455
func TestPutAttachmentViaBlipGetViaBlip(t *testing.T) {
459456
base.SetUpTestLogging(t, base.LevelInfo, base.KeyHTTP, base.KeySync, base.KeySyncMsg)
460457

461-
// Create blip tester
462-
bt, err := NewBlipTesterFromSpec(t, BlipTesterSpec{
463-
connectingUsername: "user1",
464-
connectingPassword: "1234",
465-
connectingUserChannelGrants: []string{"*"}, // All channels
458+
bt := NewBlipTesterFromSpec(t, BlipTesterSpec{
459+
GuestEnabled: true,
466460
})
467-
require.NoError(t, err)
468461
defer bt.Close()
469462

470463
attachmentBody := "attach"

0 commit comments

Comments
 (0)