Skip to content
This repository was archived by the owner on Oct 18, 2021. It is now read-only.

Commit 01e2eab

Browse files
authored
Add test documentation to README (#181)
* Add test documentation to README * Add notice/warning * PR feedback -- generalize mongoDB setup
1 parent 9fd7744 commit 01e2eab

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,3 +112,41 @@ fn main() {
112112
...
113113
}
114114
```
115+
116+
Testing
117+
-------
118+
119+
The driver test suite is largely composed of integration tests and behavioral unit-tests, relying on the official [MongoDB specifications repo](https://github.com/mongodb/specifications).
120+
121+
The easiest way to thoroughly test the driver is to set your fork up with TravisCI. However, if you'd rather test the driver locally, you'll need to setup integration and specification tests.
122+
123+
> NOTE: Each integration test uses a unique database/collection to allow tests to be parallelized, and will drop their dependencies before running. However, effects are _not_ cleaned up afterwards.
124+
125+
#### Setting up integration tests
126+
127+
All integration tests run on the default MongoDB port, 27017. Before running the tests, ensure that a test database is setup to listen on that port.
128+
129+
If you don't have mongodb installed, download and install a version from [the MongoDB Download Center](https://www.mongodb.com/download-center). You can see a full list of versions being tested on Travis in [the travis config](/.travis.yml).
130+
131+
After installation, run a MongoDB server on 27017:
132+
133+
```
134+
mkdir -p ./data/test_db
135+
mongod --dbpath ./data/test_db
136+
```
137+
138+
#### Setting up the specifications submodule
139+
140+
Pull in the specifications submodule at `tests/json/data/specs`.
141+
142+
```
143+
git submodule update --init
144+
```
145+
146+
#### Running Tests
147+
148+
Run tests like a regular Rust program:
149+
150+
```
151+
cargo test --verbose
152+
```

0 commit comments

Comments
 (0)