@@ -16,7 +16,52 @@ $ make -j8 all
1616```
1717
1818Be aware that we are submoduling the ` 1.2-dev ` branch of libmongoc and libbson as
19- during the development of phongo there are occasional things we require that simply
19+ during the development of phongo there are things we require that simply
2020are not yet in a release (or even finished) :)
2121
2222
23+ ## Testing
24+
25+ The test suites expects to find ` PHONGO-SERVERS.json ` in the system temp directory (typically ` /tmp ` ).
26+ This file should contain JSON object with MONGODB URIs, similar to the following template
27+
28+ ```
29+ {
30+ "STANDALONE": "mongodb:\/\/192.168.112.10:2000",
31+ "STANDALONE_SSL": "mongodb:\/\/192.168.112.10:2100",
32+ "STANDALONE_AUTH": "mongodb:\/\/root:[email protected] :2200\/?authSource=admin", 33+ "STANDALONE_X509": "mongodb:\/\/C=US,ST=New York,L=New York City,O=MongoDB,OU=KernelUser,[email protected] :2300\/?authSource=$external&authMechanism=MONGODB-X509", 34+ "STANDALONE_PLAIN": "mongodb:\/\/root:[email protected] :2400\/?authSource=admin", 35+ "REPLICASET": "mongodb:\/\/192.168.112.10:3000,192.168.112.10:3001,192.168.112.10:3002\/?replicaSet=REPLICASET"
36+ }
37+ ```
38+ The location of this PHONGO-SERVERS.json file can be configured by exporting
39+ ` PHONGO_SERVERS ` environment variable with a absolute path to the json configuration file.
40+
41+ Alternatively, we provide, and use, [ Vagrant] ( https://www.vagrantup.com/ ) to spin up handful of VMs
42+ where we setup and configure MongoDB according to our needs.
43+ This is the preferred way of creating PHONGO-SERVERS.json and running the test suite.
44+
45+
46+ ```
47+ $ make vm # requires vagrant (www.vagrantup.com)
48+ $ make test-bootstrap # Spins up mongod's in the virtual machines
49+ ```
50+
51+ The ` test-bootstrap ` make target will then generate the required ` PHONGO-SERVERS.json ` .
52+
53+
54+ To execute the test suite:
55+
56+ ```
57+ $ make test # Executes the test suite against the virtual machines
58+ ```
59+
60+ The bundled [ Vagrantfile] ( Vagrantfile ) also contains few other (growing) list of VMs
61+ that can be provisioned to execute the test suite on various platforms.
62+
63+ These are automatically executed by the ` make distcheck ` , which will package a new PECL archive,
64+ spin up the various operating systems, install the newly packaged archive, and execute
65+ the test suite.
66+
67+
0 commit comments