Skip to content

Commit 8e65be8

Browse files
staging for commit
1 parent f44fe83 commit 8e65be8

File tree

4 files changed

+131
-119
lines changed

4 files changed

+131
-119
lines changed

.evergreen/config.in.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1423,14 +1423,14 @@ task_groups:
14231423
- command: expansions.update
14241424
params:
14251425
file: src/atlas-expansion.yml
1426-
teardown_group:
1427-
- command: subprocess.exec
1428-
params:
1429-
working_dir: src
1430-
binary: bash
1431-
add_expansions_to_env: true
1432-
args:
1433-
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
1426+
# teardown_group:
1427+
# - command: subprocess.exec
1428+
# params:
1429+
# working_dir: src
1430+
# binary: bash
1431+
# add_expansions_to_env: true
1432+
# args:
1433+
# - ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
14341434
setup_group_can_fail_task: true
14351435
setup_group_timeout_secs: 1800
14361436
tasks:

.evergreen/config.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3465,14 +3465,6 @@ task_groups:
34653465
- command: expansions.update
34663466
params:
34673467
file: src/atlas-expansion.yml
3468-
teardown_group:
3469-
- command: subprocess.exec
3470-
params:
3471-
working_dir: src
3472-
binary: bash
3473-
add_expansions_to_env: true
3474-
args:
3475-
- ${DRIVERS_TOOLS}/.evergreen/atlas/teardown-atlas-cluster.sh
34763468
setup_group_can_fail_task: true
34773469
setup_group_timeout_secs: 1800
34783470
tasks:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/bash
22

3-
source "${PROJECT_DIRECTORY}/.evergreen/init-nvm.sh"
3+
source "${PROJECT_DIRECTORY}/.evergreen/init-node-and-npm-env.sh"
44

55
npm run check:search-indexes

test/manual/search-index-management.prose.test.ts

Lines changed: 122 additions & 102 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,32 @@ describe('Index Management Prose Tests', function () {
7373
}
7474
},
7575
async function () {
76-
const collection = await client
77-
.db('test-db')
78-
.createCollection(new ObjectId().toHexString());
79-
80-
await collection.createSearchIndex({
81-
name: 'test-search-index',
82-
definition: {
83-
mappings: { dynamic: false }
84-
}
85-
});
86-
87-
const [index] = await waitForIndexes(
88-
collection,
89-
indexes => indexes.every(index => index.queryable),
90-
'test-search-index'
91-
);
92-
93-
expect(index).to.exist;
94-
expect(index)
95-
.to.have.property('latestDefinition')
96-
.to.deep.equal({ mappings: { dynamic: false } });
76+
try {
77+
const collection = await client
78+
.db('test-db')
79+
.createCollection(new ObjectId().toHexString());
80+
81+
await collection.createSearchIndex({
82+
name: 'test-search-index',
83+
definition: {
84+
mappings: { dynamic: false }
85+
}
86+
});
87+
88+
const [index] = await waitForIndexes(
89+
collection,
90+
indexes => indexes.every(index => index.queryable),
91+
'test-search-index'
92+
);
93+
94+
expect(index).to.exist;
95+
expect(index)
96+
.to.have.property('latestDefinition')
97+
.to.deep.equal({ mappings: { dynamic: false } });
98+
} catch (error) {
99+
console.error({ error });
100+
throw error;
101+
}
97102
}
98103
);
99104

@@ -105,38 +110,43 @@ describe('Index Management Prose Tests', function () {
105110
}
106111
},
107112
async function () {
108-
const collection = await client
109-
.db('test-db')
110-
.createCollection(new ObjectId().toHexString());
111-
112-
const indexDefinitions = [
113-
{
114-
name: 'test-search-index-1',
115-
definition: {
116-
mappings: { dynamic: false }
117-
}
118-
},
119-
{
120-
name: 'test-search-index-2',
121-
definition: {
122-
mappings: { dynamic: false }
113+
try {
114+
const collection = await client
115+
.db('test-db')
116+
.createCollection(new ObjectId().toHexString());
117+
118+
const indexDefinitions = [
119+
{
120+
name: 'test-search-index-1',
121+
definition: {
122+
mappings: { dynamic: false }
123+
}
124+
},
125+
{
126+
name: 'test-search-index-2',
127+
definition: {
128+
mappings: { dynamic: false }
129+
}
123130
}
124-
}
125-
];
131+
];
126132

127-
await collection.createSearchIndexes(indexDefinitions);
133+
await collection.createSearchIndexes(indexDefinitions);
128134

129-
const indexes = await waitForIndexes(collection, indexes =>
130-
indexes.every(index => index.queryable)
131-
);
135+
const indexes = await waitForIndexes(collection, indexes =>
136+
indexes.every(index => index.queryable)
137+
);
132138

133-
for (const indexDescription of indexDefinitions) {
134-
const index = indexes.find(({ name }) => name === indexDescription.name);
135-
expect(index, `expected ${indexDescription.name} to exist`).to.exist;
139+
for (const indexDescription of indexDefinitions) {
140+
const index = indexes.find(({ name }) => name === indexDescription.name);
141+
expect(index, `expected ${indexDescription.name} to exist`).to.exist;
136142

137-
expect(index)
138-
.to.have.property('latestDefinition')
139-
.to.deep.equal({ mappings: { dynamic: false } });
143+
expect(index)
144+
.to.have.property('latestDefinition')
145+
.to.deep.equal({ mappings: { dynamic: false } });
146+
}
147+
} catch (error) {
148+
console.error({ error });
149+
throw error;
140150
}
141151
}
142152
);
@@ -149,32 +159,37 @@ describe('Index Management Prose Tests', function () {
149159
}
150160
},
151161
async function () {
152-
const collection = await client
153-
.db('test-db')
154-
.createCollection(new ObjectId().toHexString());
155-
156-
await collection.createSearchIndex({
157-
name: 'test-search-index',
158-
definition: {
159-
mappings: { dynamic: false }
160-
}
161-
});
162-
163-
await waitForIndexes(
164-
collection,
165-
indexes => indexes.every(index => index.queryable),
166-
'test-search-index'
167-
);
168-
169-
await collection.dropSearchIndex('test-search-index');
170-
171-
const indexes = await waitForIndexes(
172-
collection,
173-
indexes => indexes.length === 0,
174-
'test-search-index'
175-
);
162+
try {
163+
const collection = await client
164+
.db('test-db')
165+
.createCollection(new ObjectId().toHexString());
176166

177-
expect(indexes).to.deep.equal([]);
167+
await collection.createSearchIndex({
168+
name: 'test-search-index',
169+
definition: {
170+
mappings: { dynamic: false }
171+
}
172+
});
173+
174+
await waitForIndexes(
175+
collection,
176+
indexes => indexes.every(index => index.queryable),
177+
'test-search-index'
178+
);
179+
180+
await collection.dropSearchIndex('test-search-index');
181+
182+
const indexes = await waitForIndexes(
183+
collection,
184+
indexes => indexes.length === 0,
185+
'test-search-index'
186+
);
187+
188+
expect(indexes).to.deep.equal([]);
189+
} catch (error) {
190+
console.error({ error });
191+
throw error;
192+
}
178193
}
179194
);
180195

@@ -186,35 +201,40 @@ describe('Index Management Prose Tests', function () {
186201
}
187202
},
188203
async function () {
189-
const collection = await client
190-
.db('test-db')
191-
.createCollection(new ObjectId().toHexString());
192-
193-
await collection.createSearchIndex({
194-
name: 'test-search-index',
195-
definition: {
196-
mappings: { dynamic: false }
197-
}
198-
});
199-
200-
await waitForIndexes(
201-
collection,
202-
indexes => indexes.every(index => index.queryable),
203-
'test-search-index'
204-
);
205-
206-
await collection.updateSearchIndex('test-search-index', { mappings: { dynamic: true } });
207-
208-
const [updatedIndex] = await waitForIndexes(
209-
collection,
210-
indexes => indexes.every(index => index.queryable && index.status === 'READY'),
211-
'test-search-index'
212-
);
213-
214-
expect(updatedIndex).to.have.property('name', 'test-search-index');
215-
expect(updatedIndex)
216-
.to.have.property('latestDefinition')
217-
.to.deep.equal({ mappings: { dynamic: true } });
204+
try {
205+
const collection = await client
206+
.db('test-db')
207+
.createCollection(new ObjectId().toHexString());
208+
209+
await collection.createSearchIndex({
210+
name: 'test-search-index',
211+
definition: {
212+
mappings: { dynamic: false }
213+
}
214+
});
215+
216+
await waitForIndexes(
217+
collection,
218+
indexes => indexes.every(index => index.queryable),
219+
'test-search-index'
220+
);
221+
222+
await collection.updateSearchIndex('test-search-index', { mappings: { dynamic: true } });
223+
224+
const [updatedIndex] = await waitForIndexes(
225+
collection,
226+
indexes => indexes.every(index => index.queryable && index.status === 'READY'),
227+
'test-search-index'
228+
);
229+
230+
expect(updatedIndex).to.have.property('name', 'test-search-index');
231+
expect(updatedIndex)
232+
.to.have.property('latestDefinition')
233+
.to.deep.equal({ mappings: { dynamic: true } });
234+
} catch (error) {
235+
console.error({ error });
236+
throw error;
237+
}
218238
}
219239
);
220240

0 commit comments

Comments
 (0)