Skip to content

Commit 445713a

Browse files
committed
CSHARP-1191: Remove JSON driven tests related to detecting extra chunks.
1 parent abfffbf commit 445713a

File tree

4 files changed

+8
-290
lines changed

4 files changed

+8
-290
lines changed

src/MongoDB.Driver.GridFS.Tests/Specifications/gridfs/tests/delete.json

Lines changed: 4 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -69,24 +69,6 @@
6969
"contentType": "application/octet-stream",
7070
"aliases": [
7171

72-
],
73-
"metadata": {
74-
}
75-
},
76-
{
77-
"_id": {
78-
"$oid": "000000000000000000000005"
79-
},
80-
"length": 8,
81-
"chunkSize": 4,
82-
"uploadDate": {
83-
"$date": "1970-01-01T00:00:00.000Z"
84-
},
85-
"md5": "dd254cdc958e53abaa67da9f797125f5",
86-
"filename": "length-8-with-empty-chunk",
87-
"contentType": "application/octet-stream",
88-
"aliases": [
89-
9072
],
9173
"metadata": {
9274
}
@@ -140,42 +122,6 @@
140122
"data": {
141123
"$hex": "55667788"
142124
}
143-
},
144-
{
145-
"_id": {
146-
"$oid": "000000000000000000000005"
147-
},
148-
"files_id": {
149-
"$oid": "000000000000000000000005"
150-
},
151-
"n": 0,
152-
"data": {
153-
"$hex": "11223344"
154-
}
155-
},
156-
{
157-
"_id": {
158-
"$oid": "000000000000000000000006"
159-
},
160-
"files_id": {
161-
"$oid": "000000000000000000000005"
162-
},
163-
"n": 1,
164-
"data": {
165-
"$hex": "55667788"
166-
}
167-
},
168-
{
169-
"_id": {
170-
"$oid": "000000000000000000000007"
171-
},
172-
"files_id": {
173-
"$oid": "000000000000000000000005"
174-
},
175-
"n": 2,
176-
"data": {
177-
"$hex": ""
178-
}
179125
}
180126
]
181127
},
@@ -293,48 +239,6 @@
293239
]
294240
}
295241
},
296-
{
297-
"description": "Delete when length is 8 and there is one extra empty chunk",
298-
"act": {
299-
"operation": "delete",
300-
"arguments": {
301-
"id": {
302-
"$oid": "000000000000000000000005"
303-
}
304-
}
305-
},
306-
"assert": {
307-
"result": "void",
308-
"data": [
309-
{
310-
"delete": "expected.files",
311-
"deletes": [
312-
{
313-
"q": {
314-
"_id": {
315-
"$oid": "000000000000000000000005"
316-
}
317-
},
318-
"limit": 1
319-
}
320-
]
321-
},
322-
{
323-
"delete": "expected.chunks",
324-
"deletes": [
325-
{
326-
"q": {
327-
"files_id": {
328-
"$oid": "000000000000000000000005"
329-
}
330-
},
331-
"limit": 0
332-
}
333-
]
334-
}
335-
]
336-
}
337-
},
338242
{
339243
"description": "Delete when files entry does not exist",
340244
"act": {
@@ -359,7 +263,7 @@
359263
{
360264
"q": {
361265
"_id": {
362-
"$oid": "000000000000000000000005"
266+
"$oid": "000000000000000000000004"
363267
}
364268
},
365269
"limit": 1
@@ -372,7 +276,7 @@
372276
"operation": "delete",
373277
"arguments": {
374278
"id": {
375-
"$oid": "000000000000000000000005"
279+
"$oid": "000000000000000000000004"
376280
}
377281
}
378282
},
@@ -385,7 +289,7 @@
385289
{
386290
"q": {
387291
"_id": {
388-
"$oid": "000000000000000000000005"
292+
"$oid": "000000000000000000000004"
389293
}
390294
},
391295
"limit": 1
@@ -398,7 +302,7 @@
398302
{
399303
"q": {
400304
"files_id": {
401-
"$oid": "000000000000000000000005"
305+
"$oid": "000000000000000000000004"
402306
}
403307
},
404308
"limit": 0

src/MongoDB.Driver.GridFS.Tests/Specifications/gridfs/tests/delete.yml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -40,24 +40,11 @@
4040
contentType: "application/octet-stream"
4141
aliases: []
4242
metadata: {}
43-
-
44-
_id: { "$oid" : "000000000000000000000005" }
45-
length: 8
46-
chunkSize: 4
47-
uploadDate: { "$date" : "1970-01-01T00:00:00.000Z" }
48-
md5: "dd254cdc958e53abaa67da9f797125f5"
49-
filename: "length-8-with-empty-chunk"
50-
contentType: "application/octet-stream"
51-
aliases: []
52-
metadata: {}
5343
chunks:
5444
- { _id : { "$oid" : "000000000000000000000001" }, files_id : { "$oid" : "000000000000000000000002" }, n : 0, data : { $hex : "" } }
5545
- { _id : { "$oid" : "000000000000000000000002" }, files_id : { "$oid" : "000000000000000000000003" }, n : 0, data : { $hex : "1122" } }
5646
- { _id : { "$oid" : "000000000000000000000003" }, files_id : { "$oid" : "000000000000000000000004" }, n : 0, data : { $hex : "11223344" } }
5747
- { _id : { "$oid" : "000000000000000000000004" }, files_id : { "$oid" : "000000000000000000000004" }, n : 1, data : { $hex : "55667788" } }
58-
- { _id : { "$oid" : "000000000000000000000005" }, files_id : { "$oid" : "000000000000000000000005" }, n : 0, data : { $hex : "11223344" } }
59-
- { _id : { "$oid" : "000000000000000000000006" }, files_id : { "$oid" : "000000000000000000000005" }, n : 1, data : { $hex : "55667788" } }
60-
- { _id : { "$oid" : "000000000000000000000007" }, files_id : { "$oid" : "000000000000000000000005" }, n : 2, data : { $hex : "" } }
6148

6249
tests:
6350
-
@@ -107,23 +94,6 @@ tests:
10794
{ delete : "expected.chunks", deletes : [
10895
{ q : { files_id : { "$oid" : "000000000000000000000004" } }, limit : 0 }
10996
] }
110-
-
111-
description: "Delete when length is 8 and there is one extra empty chunk"
112-
act:
113-
operation: delete
114-
arguments:
115-
id: { "$oid" : "000000000000000000000005" }
116-
assert:
117-
result: void
118-
data:
119-
-
120-
{ delete : "expected.files", deletes : [
121-
{ q : { _id : { "$oid" : "000000000000000000000005" } }, limit : 1 }
122-
] }
123-
-
124-
{ delete : "expected.chunks", deletes : [
125-
{ q : { files_id : { "$oid" : "000000000000000000000005" } }, limit : 0 }
126-
] }
12797
-
12898
description: "Delete when files entry does not exist"
12999
act:
@@ -138,20 +108,20 @@ tests:
138108
data:
139109
-
140110
{ delete : "fs.files", deletes : [
141-
{ q : { _id : { "$oid" : "000000000000000000000005" } }, limit : 1 }
111+
{ q : { _id : { "$oid" : "000000000000000000000004" } }, limit : 1 }
142112
] }
143113
act:
144114
operation: delete
145115
arguments:
146-
id: { "$oid" : "000000000000000000000005" }
116+
id: { "$oid" : "000000000000000000000004" }
147117
assert:
148118
error: "FileNotFound"
149119
data:
150120
-
151121
{ delete : "expected.files", deletes : [
152-
{ q : { _id : { "$oid" : "000000000000000000000005" } }, limit : 1 }
122+
{ q : { _id : { "$oid" : "000000000000000000000004" } }, limit : 1 }
153123
] }
154124
-
155125
{ delete : "expected.chunks", deletes : [
156-
{ q : { files_id : { "$oid" : "000000000000000000000005" } }, limit : 0 }
126+
{ q : { files_id : { "$oid" : "000000000000000000000004" } }, limit : 0 }
157127
] }

src/MongoDB.Driver.GridFS.Tests/Specifications/gridfs/tests/download.json

Lines changed: 0 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -87,24 +87,6 @@
8787
"contentType": "application/octet-stream",
8888
"aliases": [
8989

90-
],
91-
"metadata": {
92-
}
93-
},
94-
{
95-
"_id": {
96-
"$oid": "000000000000000000000006"
97-
},
98-
"length": 12,
99-
"chunkSize": 4,
100-
"uploadDate": {
101-
"$date": "1970-01-01T00:00:00.000Z"
102-
},
103-
"md5": "6289ac1db331d1c7677a4b7e123178f9",
104-
"filename": "length-12-with-empty-chunk",
105-
"contentType": "application/octet-stream",
106-
"aliases": [
107-
10890
],
10991
"metadata": {
11092
}
@@ -194,54 +176,6 @@
194176
"data": {
195177
"$hex": "99aa"
196178
}
197-
},
198-
{
199-
"_id": {
200-
"$oid": "000000000000000000000008"
201-
},
202-
"files_id": {
203-
"$oid": "000000000000000000000006"
204-
},
205-
"n": 0,
206-
"data": {
207-
"$hex": "11223344"
208-
}
209-
},
210-
{
211-
"_id": {
212-
"$oid": "000000000000000000000009"
213-
},
214-
"files_id": {
215-
"$oid": "000000000000000000000006"
216-
},
217-
"n": 1,
218-
"data": {
219-
"$hex": "55667788"
220-
}
221-
},
222-
{
223-
"_id": {
224-
"$oid": "000000000000000000000010"
225-
},
226-
"files_id": {
227-
"$oid": "000000000000000000000006"
228-
},
229-
"n": 2,
230-
"data": {
231-
"$hex": "99aabbcc"
232-
}
233-
},
234-
{
235-
"_id": {
236-
"$oid": "000000000000000000000011"
237-
},
238-
"files_id": {
239-
"$oid": "000000000000000000000006"
240-
},
241-
"n": 3,
242-
"data": {
243-
"$hex": ""
244-
}
245179
}
246180
]
247181
},
@@ -336,24 +270,6 @@
336270
}
337271
}
338272
},
339-
{
340-
"description": "Download when there are three chunks and one extra empty chunk at the end",
341-
"act": {
342-
"operation": "download",
343-
"arguments": {
344-
"id": {
345-
"$oid": "000000000000000000000006"
346-
},
347-
"options": {
348-
}
349-
}
350-
},
351-
"assert": {
352-
"result": {
353-
"$hex": "112233445566778899aabbcc"
354-
}
355-
}
356-
},
357273
{
358274
"description": "Download when files entry does not exist",
359275
"act": {
@@ -434,41 +350,6 @@
434350
"error": "ChunkIsMissing"
435351
}
436352
},
437-
{
438-
"description": "Download when there is an extra chunk",
439-
"arrange": {
440-
"data": [
441-
{
442-
"insert": "fs.chunks",
443-
"documents": [
444-
{
445-
"_id": {
446-
"$oid": "000000000000000000000012"
447-
},
448-
"files_id": {
449-
"$oid": "000000000000000000000004"
450-
},
451-
"n": 2,
452-
"data": {
453-
"$hex": "99"
454-
}
455-
}
456-
]
457-
}
458-
]
459-
},
460-
"act": {
461-
"operation": "download",
462-
"arguments": {
463-
"id": {
464-
"$oid": "000000000000000000000004"
465-
}
466-
}
467-
},
468-
"assert": {
469-
"error": "ExtraChunk"
470-
}
471-
},
472353
{
473354
"description": "Download when an intermediate chunk is the wrong size",
474355
"arrange": {

0 commit comments

Comments
 (0)