Skip to content

RUST-2107 Remove deprecated fields from gridfs tests #1343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 26, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/test/spec/gridfs.rs
Original file line number Diff line number Diff line change
@@ -23,8 +23,6 @@ async fn run_unified() {
run_unified_tests(&["gridfs"])
// The Rust driver doesn't support the disableMD5 option.
.skip_files(&["upload-disableMD5.json"])
// The Rust driver doesn't support the contentType option.
.skip_tests(&["upload when contentType is provided"])
.await;
}

28 changes: 28 additions & 0 deletions src/test/spec/json/gridfs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# GridFS Tests

______________________________________________________________________

## Introduction

The YAML and JSON files in this directory are platform-independent tests meant to exercise a driver's implementation of
GridFS. These tests utilize the [Unified Test Format](../../unified-test-format/unified-test-format.md).

## Conventions for Expressing Binary Data

The unified test format allows binary stream data to be expressed and matched with `$$hexBytes` (for uploads) and
`$$matchesHexBytes` (for downloads), respectively; however, those operators are not supported in all contexts, such as
`insertData` and `outcome`. When binary data must be expressed as a base64-encoded string
([Extended JSON](../../extended-json/extended-json.md) for a BSON binary type), the test SHOULD include a comment noting
the equivalent value in hexadecimal for human-readability. For example:

```yaml
data: { $binary: { base64: "ESIzRA==", subType: "00" } } # hex 11223344
```

Creating the base64-encoded string for a sequence of hexadecimal bytes is left as an exercise to the developer. Consider
the following PHP one-liner:

```shell-session
$ php -r 'echo base64_encode(hex2bin('11223344')), "\n";'
ESIzRA==
```
37 changes: 0 additions & 37 deletions src/test/spec/json/gridfs/README.rst

This file was deleted.

60 changes: 0 additions & 60 deletions src/test/spec/json/gridfs/delete.json
Original file line number Diff line number Diff line change
@@ -49,10 +49,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -64,10 +61,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0-with-empty-chunk",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -79,10 +73,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -94,10 +85,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "dd254cdc958e53abaa67da9f797125f5",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
@@ -197,10 +185,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0-with-empty-chunk",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -212,10 +197,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -227,10 +209,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "dd254cdc958e53abaa67da9f797125f5",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
@@ -330,10 +309,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -345,10 +321,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -360,10 +333,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "dd254cdc958e53abaa67da9f797125f5",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
@@ -448,10 +418,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -463,10 +430,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0-with-empty-chunk",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -478,10 +442,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
@@ -554,10 +515,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -569,10 +527,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0-with-empty-chunk",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -584,10 +539,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -599,10 +551,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "dd254cdc958e53abaa67da9f797125f5",
"filename": "length-8",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
@@ -719,10 +668,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -734,10 +680,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "d41d8cd98f00b204e9800998ecf8427e",
"filename": "length-0-with-empty-chunk",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
},
{
@@ -749,10 +692,7 @@
"uploadDate": {
"$date": "1970-01-01T00:00:00.000Z"
},
"md5": "c700ed4fdb1d27055aa3faa2c2432283",
"filename": "length-2",
"contentType": "application/octet-stream",
"aliases": [],
"metadata": {}
}
]
12 changes: 0 additions & 12 deletions src/test/spec/json/gridfs/delete.yml
Original file line number Diff line number Diff line change
@@ -30,40 +30,28 @@ initialData:
length: 0
chunkSize: 4
uploadDate: { "$date": "1970-01-01T00:00:00.000Z" }
md5: "d41d8cd98f00b204e9800998ecf8427e"
filename: "length-0"
contentType: "application/octet-stream"
aliases: []
metadata: {}
- &file2
_id: { "$oid": "000000000000000000000002" }
length: 0
chunkSize: 4
uploadDate: { "$date": "1970-01-01T00:00:00.000Z" }
md5: "d41d8cd98f00b204e9800998ecf8427e"
filename: "length-0-with-empty-chunk"
contentType: "application/octet-stream"
aliases: []
metadata: {}
- &file3
_id: { "$oid": "000000000000000000000003" }
length: 2
chunkSize: 4
uploadDate: { "$date": "1970-01-01T00:00:00.000Z" }
md5: "c700ed4fdb1d27055aa3faa2c2432283"
filename: "length-2"
contentType: "application/octet-stream"
aliases: []
metadata: {}
- &file4
_id: { "$oid": "000000000000000000000004" }
length: 8
chunkSize: 4
uploadDate: { "$date": "1970-01-01T00:00:00.000Z" }
md5: "dd254cdc958e53abaa67da9f797125f5"
filename: "length-8"
contentType: "application/octet-stream"
aliases: []
metadata: {}
- collectionName: *bucket0_chunks_collectionName
databaseName: *database0Name
Loading