* Fix APM and CSFLE tests for Windows CI
* Add Windows to GitHub CI and build DLLs for releases
* Add --enable-debug-pack configure opt to generate PDB files
* Reminder to check for Windows build artifacts before publishing releases
* Revise advice on publicizing releases
v1.14 pointed to libmongoc 1.14.2, which was released some time after the submodule target in the master branch (a dev commit before libmongoc 1.23.0). To resolve this conflict, the libmongoc submodule has been bumped to 1.23.0.
Note: a libmongoc 1.23.1 tag also exists, but that bump can be done in a subsequent PHPC ticket related to the libmongoc changes therein.
This also adds a section to CONTRIBUTING.md to provide guidance on resolving submodule merge conflicts.
* Match error message variations between libmongoc 1.23+ and older
This typo was corrected in mongodb/mongo-c-driver@1d7229f0e9 and will appear in the 1.23.0 release.
* PHPC-2103: Report loaded crypt_shared version in phpinfo()
* PHPC-2132: Fix pattern for matching phpinfo() values
* Add missing macros for declaring arguments
* Add macros to define disabled constructor and __wakeup
* Define arginfo via stubs for BSON classes
* Declare tentative return types in interfaces
* Add correct return type for __set_state methods
* Generate class entries for BSON classes
* Declare Binary class constants in stub file
* Use stubs in exception classes
* Add stubs for monitoring classes
* Fix wrong JsonSerializable class in BSON stubs
* Disable declaration-after-statement
This is necessary to let the generated arginfo files compile
* Use stubs for driver classes
* Fix deprecation messages in tests
* Add missing macro
* Fix tests relying on value injection
* Parse parameters in disabled constructor/wakup function
* Add note about arginfo files to contribution docs
* Add GitHub action to check generated arginfo files
* PHPC-2115: Use DateTimeInterface in UTCDateTime constructor signature
* Don't install mongodb extension in GitHub actions workflows
* Change indentation in stub files
* Use individual #if conditions for each stub method
* Make disabled constructor/wakeup methods static
* Fix bulkWrite parameter name
* Use %d to match property count in tests
* Ensure all classes with disabled serialisation declare __wakeup
* Use non-breaking space in OS axis labels
* Revise titles and Manager construction in autoEncryption tests
* Define CSFLE_KEY_VAULT_NS and CSFLE_LOCAL_KEY constants
The value for CSFLE_KEY_VAULT_NS is based on the example from PHPLIB-826. This was not required but helps makes all tests consistent and will make it easier if we need to add functionality to a helper to drop the key vault collection before a test.
Using CSFLE_LOCAL_KEY allows removal of a duplicated string literal in various CSFLE tests. Although the new constant wasn't required for all tests (empty strings worked fine to satisfy option validation), using a constant helps ensure consistency across the test suite.
Also use create_test_manager() in more places when basic.inc is included. The remaining instances of direct Manager construction should only be in tests where basic.inc isn't used.
* Remove pre-3.6 server versions from Evergreen matrix
* Remove skipped tests for pre-3.6 servers
* Remove old mongo-orchestration configs and Evergreen tasks
* Remove flaky replica set tests
These tests assume a particular replica set member is always the primary, so tag assertions may fail if a different member is elected. The server-getTags-002.phpt test has more flexible assertions for replica set tags, so we can safely remove these tests.
"nocache" output from skip_if_not_clean may cause "skip" output from other functions to be ignored. Changing the order so that skip_if_not_clean is always called last will fix this in most cases (excluding tests that call skip_if_not_clean multiple times).
* PHPC-2047: Update load balancer testing config
Upstream changes in drivers-evergreen-tools now require passing LOAD_BALANCER to run-orchestration.sh. Additionally, service ID mocking is no longer required as of server version 5.1.
* Add missing live server checks in tests
Now that URI option validation is consistent between connection strings and array options, we can remove the previous test for authSource without credentials.
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)
* 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
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.
* Re-enable PHP 8.1 build on GH Actions
* Work around different error wording in PHP 8.1
* Limit failing tests to PHP < 8.1
* Add tests for PHPC-1839 for PHP >= 8.1
Bump libmongoc 1.19.0 to pull in changes from CDRIVER-3502.
Unfortunately, the restriction is still in place for authSource in the URI options array (pending PHPC-1950).
* Bump libmongoc to 1.19-dev
* PHPC-1890: Constant for ReadConcern snapshot level
* Move Manager::startSession() error test and delete obsolete test
The deleted error test was redundant. It was originally created in ca4c52eb1c to work around changes in PHP 8, but 60febd0f28 subsequently reintroduced a portable version of the test case.
Also adds missing SKIPIF to startSession test.
* PHPC-1889: Session snapshot option
* PHPC-1875: Session with snapshot=true cannot perform writes
* PHPC-1876: Session with snapshot=true requires MongoDB 5.0+
* PHPC-1762: CRUD spec prose tests for WriteError and WriteConcernError errInfo
Note: the prose test for WriteConcernError.info was originally in PHPLIB but was inadvertently removed in mongodb/mongo-php-library@a9e29770ea (mongodb/mongo-php-library#820).
* Require 5.0+ server for versioned API test
* Add links to prose tests
* Use latest version of libmongoc
* Remove deprecated terminology for primary
* Remove deprecated terminology for secondary
* Fix clang-format
* Remove check for legacy field
* Fix missing space in error expectation
* Harden test expectation around primary checks
* Add 5.0 to the test matrix
* Use different query operator to trigger error
5.0 throws a different error for top-level fields with dollars, so we're using an unknown operator instead.
* Introduce edge-versions axis to test against latest stable
* Use zend_exception_ce instead of zend_exception_get_default()
zend_exception_get_default() has been deprecated since PHP 7.0. See: php/php-src@f9e9d3a437
* Check retval from php_phongo_set_monitoring_callbacks
This ensures that php_phongo_client_register is never called in the event this method fails (however unlikely).
* Index subscriber HashTable by numeric object handles
This also updates add/removeSubscriber to use the new argument parsing macros from deead9687e.
* PHPC-1804: Manager::addSubscriber and removeSubscriber
Implements per-client event subscribers. Moves existing APM code to a new phongo_apm.c module and adds logic to coordinate dispatching between global and per-client subscribers.
* Introduce MongoDB\Driver\ServerApi
* Accept serverApi driver option
* Introduce create_test_manager factory to create manager
A centralised entry point is required to inject the API_VERSION env variable later.
* Add build variant to test with requireApiVersion=true
* Fix wrong configuration for auth variable
This changed when migrating from our own scripts to drivers-evergreen-tools and was not updated properly, causing all tests to run with auth disabled.
* Declare ZEND_PARSE_PARAMETERS_NONE macro
This macro is missing on PHP < 7.3
* Remove duplicated API param storage
* Add missing semicolons
* Add ZEND_PARSE_PARAMETERS_NON_EX macro
* Extract error handling functionality to separate macros
* Throw if internal mongoc_server_api_t is already initialised
* Use imported namespaces in tools file
* Fix type info for reflection
* Use American English spelling
* Only use typed serialize signature on PHP 8+
* Update PHONGO_PARSE_PARAMETERS_NONE macro for PHP < 7.3
* Remove usage of ZEND_STRL within zend_hash_str_add
This causes compile failures on PHP < 7.3 that I have yet to understand.
* Fix errors in new PHONGO_PARSE_PARAMETERS macros
* v1.9:
PHPC-1739 Move from travis-ci to GitHub Actions (#1199)
PHPC-1774 Fix truncation of PHP_VERSION constant in handshake metadata (#1202)
PHPC-1775 Use correct size for strncpy in when initialising DBPointer (#1203)
* Replace client pointers on object structs with Manager references
* Request-scoped Manager registry for APM events
* Ensure Manager is registered regardless of persistent client
* Reset request-scoped clients when forking
* Test for freeing Manager during RSHUTDOWN via subscriber reference
Co-authored-by: Andreas Braun <git@alcaeus.org>
MongoDB 4.0.x (and possibly earlier) happens to require an $out stage for aggregate if a writeConcern option would be used. While this test doesn't use a write concern, it could inherit one from MONGODB_URI.
As for findAndModify, that is only considered a write command (does not accept a readConcern option).
The previous inconsistency was likely the result of copypasta (especially where executeReadCommand was used). There is no issue with using executeCommand here since an explicit write concern is provided (nothing will be inherited).