Commit Graph

3944 Commits

Author SHA1 Message Date
Jeremy Mikola
91a1585db1 Remove _DARWIN_C_SOURCE definition for bundled sources on macOS
Reverts a change introduced in ab44b0cbeb. This was previously in mongodb/mongo-c-driver#920 but removed before merging in mongodb/mongo-c-driver@9d2d8b157c.
2022-01-05 15:50:21 -05:00
Jeremy Mikola
6f080aa3f3 Add SSL tests using non-deprecated URI options 2022-01-05 13:10:45 -05:00
Jeremy Mikola
31dcb61f91 PHPC-1950: Update authMechanism URI option tests
Now that URI option validation is consistent between connection strings and array options, we can remove the previous test for authSource without credentials.
2022-01-05 13:10:45 -05:00
Jeremy Mikola
f74a60982a PHPC-1900: Test srvServiceName URI option 2022-01-05 13:10:45 -05:00
Jeremy Mikola
963d720237 PHPC-1908: Test srvMaxHosts URI option 2022-01-05 13:10:45 -05:00
Jeremy Mikola
c67ed67e49 PHPC-2020: Test loadBalanced URI option validation 2022-01-05 13:10:45 -05:00
Jeremy Mikola
ab44b0cbeb PHPC-1647: Use mongoc_client_new_from_uri_with_error
This allows PHPC to defer entirely to libmongoc for cross-option URI validation

Bump libmongoc to 1.21-dev

Build changes are ported from upstream CMake changes (see: CDRIVER-4249)
2022-01-05 13:10:45 -05:00
Jeremy Mikola
968958fe46 PHPC-2019: Remove Solaris checks in m4 build scripts
libmongoc removed Solaris support in version 1.8.0 so there is no reason to retain these checks.
2022-01-05 13:10:45 -05:00
Jeremy Mikola
e9d569766b PHPC-2008: Re-enable writeresult-getserver-002 for replicaset-auth (#1286)
MO should now grant the necessary roles as of 10gen/mongo-orchestration@4e1ab405fe.
2021-12-30 11:36:59 -05:00
Jeremy Mikola
f972586b4c PHPC-2012: Remove extra AX_CHECK_COMPILE_FLAG args 2021-12-15 15:25:25 -05:00
Jeremy Mikola
007f09f9a3 Master branch is now 1.13-dev 2021-12-14 17:22:35 -05:00
Jeremy Mikola
9cb63373d4 Back to -dev 2021-12-14 17:20:33 -05:00
Jeremy Mikola
81e097f6d8 Package 1.12.0 1.12.0 2021-12-14 17:19:43 -05:00
Jeremy Mikola
59298f51df PHPC-2011: Bump pkg-config requirements for libmongoc and libmongocrypt 2021-12-14 17:09:50 -05:00
Jeremy Mikola
a039df758b PHPC-2004: Use tentative return types for BSON interface toString methods (#1283)
This should avoid the BC break introduced in 6c82ec8b52. PHP 8.1 will automatically add return type info for Stringable, which means the ReturnTypeWillChange attribute should not be necessary on userland classes.
2021-12-14 11:12:36 -05:00
Jeremy Mikola
da0f73a677 PHPC-1912: CSFLE 1.0 KMIP Support (#1280)
* PHPC-2009: Support tlsOptions encryption option

This also adds some missing option validation tests for the autoEncryption driver option and Manager::createClientEncryption().

* PHPC-2010: Type validation for autoEncryption.extraOptions
2021-12-13 20:10:07 -05:00
Jeremy Mikola
21fd5a6af6 PHPC-1942: BSON Binary subtype 0x07 (column) (#1281)
Defines new Binary::TYPE_COLUMN constant.

BSON corpus spec tests synced with mongodb/specifications@b3b74c97c3
2021-12-06 16:38:55 -05:00
Jeremy Mikola
8a4670becd PHPC-2011: Upgrade libmongoc to 1.20.0 and libmongocrypt to 1.3.0 (#1279)
* PHPC-2011: Bump libmongocrypt to 1.3.0

* PHPC-2011: Bump libmongoc to 1.20.0

* Script to update submodule sources in config.m4 and config.w32
2021-12-06 11:15:20 -05:00
Jeremy Mikola
36f6ce0ebc PHPC-1878 and PHPC-2008: Fix tests using local database (#1277)
* PHPC-1878: Explicitly use w:1 for local database

* PHPC-2008: Skip test requiring role to drop local collection

The "restore" role is required to drop collections in the "local" database. Mongo Orchestration does not yet grant that role for its users.
2021-11-30 10:54:16 -05:00
Jeremy Mikola
d32a44aeb2 Remove link to legacy extension 2021-11-29 18:05:39 -05:00
Jeremy Mikola
9d87767176 PHPC-1931: Add PHP 8.1 and rename OS axis labels (#1276) 2021-11-29 15:08:43 -05:00
Jeremy Mikola
6c82ec8b52 PHPC-2004 and PHPC-2007: Specify __toString() return type and implement Stringable (#1274)
* PHPC-2004: Specify string return type in __toString() arginfos

Adding return type info to the interface methods is a small subtle BC break. Userland classes will also need to add return type info prior to PHP 8.1, where it is added automatically. However, to leave the interface methods untyped would invite an error because BSON classes cannot otherwise conform to Stringable, which has return type info.

Additionally, PHP 8.2 will start raising a warning when return type info is automatically applied, so a BC break in some form is inevitable.

* PHPC-2007: Explicitly implement Stringable for PHP 8+

* Fix code formatting

This was missed in fe99deb32a
2021-11-29 13:14:10 -05:00
Jeremy Mikola
fe99deb32a PHPC-1880: Drop support for PHP 7.1 (#1273)
* PHPC-1880: Drop support for PHP 7.1

* Bump PHP versions in AppVeyor config

* PHPC-1880: Update Evergreen config for PHP 7.2+ and MongoDB 5.0

Bump edge-versions:latest-stable to MongoDB 5.0. Drops PHP 7.1 and adds PHP 8.0 to php-versions and newly created php-edge-versions axis.

Use oldest-supported or latest-stable PHP version for matrices other than test-php-versions.

Make variant display names consistent to help detect duplicates.

Remove WiredTiger from mongo-42-storage-engines since it's tested in most other variants by default.

* Revise "cursor not found" error message assertions for latest server version

* Temporarily remove 1.19.x from libmongoc-version axis
2021-11-10 10:28:21 -05:00
Jeremy Mikola
a8a2210488 PHPC-1997: Migrate to new libbson atomic API (#1272)
* Bump libmongoc to 1.20-dev

* PHPC-1997: Migrate to new libbson atomic API
2021-11-05 14:17:17 -04:00
Jeremy Mikola
366a9a1845 Update release notes template and forum link 2021-11-02 17:17:16 -04:00
Jeremy Mikola
a2503a1521 Merge branch 'v1.11' 2021-11-02 15:27:11 -04:00
Jeremy Mikola
a254bb73dd Back to -dev 2021-11-02 15:07:26 -04:00
Jeremy Mikola
a140972650 Package 1.11.1 1.11.1 2021-11-02 15:06:51 -04:00
Jeremy Mikola
25eb81dccf Master branch is now 1.12-dev 2021-11-02 14:57:09 -04:00
Jeremy Mikola
20899c5c35 PHPC-1994: Fix Evergreen testing for custom libmongoc versions (#1271)
Also updates versions in the libmongoc-version axis.
2021-11-02 14:52:11 -04:00
Jeremy Mikola
419891d369 PHPC-1995: Use https:// instead of git:// for git clone 2021-11-02 11:35:12 -04:00
Jeremy Mikola
16fb5cfc92 PHPC-1993: Require 1.19.1 for libmongoc and libbson system libraries (#1269) 2021-11-02 11:24:28 -04:00
Jeremy Mikola
a48026b418 Back to -dev 2021-10-29 16:11:44 -04:00
Jeremy Mikola
16604f9e06 Package 1.11.0 1.11.0 2021-10-29 16:10:08 -04:00
Jeremy Mikola
30a85132ca PHPC-1968, PHPC-1992: Update Atlas URIs for 4.0 clusters and serverless (#1268) 2021-10-27 13:30:50 -04:00
Jeremy Mikola
0e45605fa2 PHPC-1937: Manager::selectServer() defaults to primary read preference (#1267)
* Use .invalid TLD for invalid host in tests

See: https://datatracker.ietf.org/doc/html/rfc2606

* PHPC-1937: Manager::selectServer() defaults to primary read preference
2021-10-26 13:07:21 -04:00
Jeremy Mikola
93bd10bd21 PHPC-1897: Test serialization of BSON with embedded null bytes in strings (#1255)
* BSON corpus prose tests for null bytes

For tests that already existed we just add a reference to the prose test

* BSON corpus tests for null bytes

Synced with mongodb/specifications@c64fc79899

This sync also removes some old DBRef tests, which should have been removed in 6929bcb608.

* Bump libmongoc to 1.19.1 to pull in changes from CDRIVER-4083
2021-10-25 13:27:33 -04:00
Jeremy Mikola
a4740e8d43 PHPC-1989: Fix missing fields in CommandSucceededEvent debug output (#1266)
* PHPC-1989: Fix missing fields in CommandSucceededEvent debug output

Add debug output tests for APM event classes.

* Rename tests for APM event classes
2021-10-25 10:45:18 -04:00
Jeremy Mikola
f9fe7efe03 PHPC-1985: Report unset round_trip_time as null in Server debug output (#1265) 2021-10-15 15:32:45 -04:00
Jeremy Mikola
e37063d7a6 Merge pull request #1260 2021-10-15 14:16:03 -04:00
Jeremy Mikola
cfac8b8d1f PHPC-1985: Server::getLatency() should return null if unset 2021-10-15 13:44:32 -04:00
Jeremy Mikola
594e83bad4 PHPC-1976: Add serviceId to command monitoring events 2021-10-15 13:44:32 -04:00
Jeremy Mikola
ae74c7a1cd PHPC-1752: Fix tests for load balanced topologies
Skip tests expecting gossiped $clusterTime on first command. This may be a bug in libmongoc, per CDRIVER-4174.

Make exception assertion in TLS tests more flexible. Expect parent ConnectionException to accomodate load balanced clients, which do not use server selection. Both exception messages will include a common prefix from libmongoc.

Do not assert exception message for failed TLS connection. While the message will typically include "TLS handshake failed", that is not guaranteed.

Make ping response assertions in TLS tests more flexible. Sharded clusters and replica sets may return additional fields in the ping response (e.g. cluster time). These tests were originally written to expect a standalone response.

Allow unset RTT (-1) for load balanced client.

Note SRV caveat for is_replica_set test function.

Allow load balancers for tests that require sharded clusters. Load balancers should always proxy a mongos, so existing skip functions that check for mongos can now allow a load balancer. If there is some incompatibility specific to LBs, we can address that later with a LB-specific skip function.

Require mongos for pinning tests. Pinning does not apply to load balanced clients, since there is only one connection.
2021-10-15 13:44:32 -04:00
Jeremy Mikola
2fb1836358 PHPC-1979: Use mongoc_client_get_handshake_description for load balancers
This ensures that Server::getInfo() returns a usable hello response (e.g. for wire version checks). The debug info is also addressed for consistency.
2021-10-15 13:44:31 -04:00
Jeremy Mikola
797a5c81f7 PHPC-1980: Server::TYPE_LOAD_BALANCER constant 2021-10-15 13:44:31 -04:00
Jeremy Mikola
cfc6bbbe5d PHPC-1978: Expose mongoc_global_mock_service_id as INI option
This also consolidates INI functions (and trace logging) into a separate file and ensure that mongoc logging is disabled during GSHUTDOWN (avoiding a potential segfault).

Enable service ID mocking when testing load balancers with HAProxy.
2021-10-15 13:44:30 -04:00
Jeremy Mikola
442ae92b91 PHPC-1977: Add load balancer test to Evergreen matrix 2021-10-14 17:08:45 -04:00
Jeremy Mikola
f10e27a5d9 Remove AUTH and document other env vars for run-tests.sh
AUTH dates back to cee996bc79 and was likely derived from the drivers-evergreen-tools template. It is no longer set from the Evergreen task config and serves no functional purpose.
2021-10-14 17:06:59 -04:00
Jeremy Mikola
6eaa91b87b PHPC-1982, PHPC-1983: Fix some Windows build warnings (#1263)
* PHPC-1982: Use bson_gettimeofday for Windows compatibility

* PHPC-1983: Fix arg type for ADD_ASSOC_INT64_AS_STRING
2021-10-05 10:49:47 -04:00
Jeremy Mikola
e32f59bad8 PHPC-1875: Skip snapshot error test on sharded clusters (#1262)
skip_if_not_replica_set will be more portable once we start testing on load balancers, which will back sharded clusters.
2021-10-01 16:03:38 -04:00