Skip to content

Commit

Permalink
update prose test
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Aug 11, 2023
1 parent 7bf5054 commit 1ae015c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mongo/search_index_prose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ func newTestCollection(t *testing.T, client *Client) *Collection {
t.Helper()

id, err := uuid.New()
assert.NoError(t, err)
require.NoError(t, err)
collName := fmt.Sprintf("col%s", id.String())
return client.Database("test").Collection(collName)
}

func TestSearchIndexProse(t *testing.T) {
t.Parallel()

const timeout = 5 * time.Minute

ctx := context.Background()
Expand All @@ -46,6 +48,8 @@ func TestSearchIndexProse(t *testing.T) {
defer client.Disconnect(ctx)

t.Run("case 1: Driver can successfully create and list search indexes", func(t *testing.T) {
t.Parallel()

ctx := context.Background()

collection := newTestCollection(t, client)
Expand Down Expand Up @@ -93,6 +97,8 @@ func TestSearchIndexProse(t *testing.T) {
})

t.Run("case 2: Driver can successfully create multiple indexes in batch", func(t *testing.T) {
t.Parallel()

ctx := context.Background()

collection := newTestCollection(t, client)
Expand Down Expand Up @@ -171,6 +177,8 @@ func TestSearchIndexProse(t *testing.T) {
})

t.Run("case 3: Driver can successfully drop search indexes", func(t *testing.T) {
t.Parallel()

ctx := context.Background()

collection := newTestCollection(t, client)
Expand Down Expand Up @@ -227,6 +235,8 @@ func TestSearchIndexProse(t *testing.T) {
})

t.Run("case 4: Driver can update a search index", func(t *testing.T) {
t.Parallel()

ctx := context.Background()

collection := newTestCollection(t, client)
Expand Down Expand Up @@ -286,6 +296,8 @@ func TestSearchIndexProse(t *testing.T) {
})

t.Run("case 5: dropSearchIndex suppresses namespace not found errors", func(t *testing.T) {
t.Parallel()

ctx := context.Background()

collection := newTestCollection(t, client)
Expand Down

0 comments on commit 1ae015c

Please sign in to comment.