Commit Graph

34 Commits

Author SHA1 Message Date
Jeremy Mikola
51f0dd5399 PHPC-2143: Build Windows DLLs with GitHub Actions (#1380)
* 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
2022-11-21 10:09:46 -05:00
Andreas Braun
6ffcb1f1dd PHPC-2117: Test on PHP 8.2 (#1340)
* Test on PHP 8.2

* Fix tests relating to dynamic properties

* Fix tests failing due to different __set_state output

* Duplicate clone test without dynamic properties for PHP >= 8.2
2022-08-04 08:53:25 +02:00
Andreas Braun
6887226d34 PHPC-1709: Add typing information to arginfo (#1337)
* 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
2022-08-03 08:42:07 +02:00
Jeremy Mikola
dc3973d0a8 PHPC-1899: getServerConnectionId for command monitoring events (#1316) 2022-04-29 10:06:04 -04:00
Jeremy Mikola
93efe0aeb6 PHPC-2073: Remove references to pre-3.6 servers (#1305)
* 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.
2022-03-01 20:30:00 -05:00
Jeremy Mikola
c2410ab0e7 PHPC-2023 and PHPC-2030: Allow observation of events dispatched during client destruction (#1292)
* PHPC-2023: Allow observation of TopologyClosedEvent

Observation is only possible for non-persistent clients freed before RSHUTDOWN. This change also allows for reliable testing of ServerClosedEvent.

* PHPC-2030: Test observation of commands issued during client destruction

Command monitoring events can only be observed for non-persistent clients freed before RSHUTDOWN.
2022-01-14 10:08:12 -05:00
Jeremy Mikola
7d26cfcba7 PHPC-2022: Use mongoc_host_list in event structs (#1291)
Limit ServerHeartbeatFailedEvent test to non-auth standalone
2022-01-11 14:39:39 -05:00
Jeremy Mikola
10b3a1fe70 PHPC-1150: SDAM Monitoring (#1289)
* PHPC-1805: Implement ServerDescription class

* PHPC-1910: Implement Server::getServerDescription()

* PHPC-1934: Check for uninitialized intern in ServerDescription get_properties_hash

* PHPC-1925: Change ServerDescription::getType() to return a string

* PHPC-1891: Implement TopologyDescription class

* PHPC-1892: Implement SDAMSubscriber interface

* PHPC-1893: Implement SDAM event classes

* Revise server and topology event classes and tests

Use phongo_objectid_init in getTopologyId() methods. Report topologyId as an ObjectId in debug info. Report TopologyDescription servers as ServerDescription in debug info.

Copy parameters in phongo_serverdescription_init and phongo_topologydescription_init for consistency with other functions (e.g. phongo_readconcern_init). This also creates phongo_serverdescription_init_ex for when we want to skip copying in Server::getServerDescription().

* PHPC-1953: Add tests for debug handlers

* PHPC-1959: Utilize Manager::addSubscriber() in tests

Skip TopologyClosedEvent test (pending PHPC-2023)

* PHPC-1958: Assert same topologyId for SDAM events

* PHPC-2025: Support load balancer in ServerDescription and TopologyDescription

* PHPC-2026: Handle 64-bit lastUpdateTime for 32-bit platforms

Co-authored-by: Tanli Su <46271307+tanlisu@users.noreply.github.com>
Co-authored-by: Andreas Braun <git@alcaeus.org>
Co-authored-by: Tanli Su <tanli.su@gmail.com>
2022-01-10 13:14:10 -05: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
594e83bad4 PHPC-1976: Add serviceId to command monitoring events 2021-10-15 13:44:32 -04:00
Andreas Braun
deead9687e PHPC-1716 Allow configuring server API version in manager (#1204)
* 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
2021-03-26 15:43:48 +01:00
Jeremy Mikola
ca4c52eb1c PHPC-1692: Test suite fixes for PHP 8 2020-10-13 15:24:02 +02:00
Jeremy Mikola
9ae06e236e Skip known/expected test failures in AppVeyor 2020-05-11 17:43:08 -04:00
Derick Rethans
3678fa5236 PHPC-1184: Add alternative topologies to Travis 2018-07-16 10:30:39 +01:00
Jeremy Mikola
476c7f947b Test suite compatibility with server 4.0.0-rc5 2018-06-15 16:47:12 -04:00
Jeremy Mikola
afa752f73d PHPC-1076: Allow for extra command output on 3.6 servers
3.6 replica sets may include additional fields in the command response (e.g. operationTime, $clusterTime).
2018-05-22 08:31:01 -04:00
Jeremy Mikola
cfeefaff4e PHPC-1076: Include CommandFailedEvent reply in APM test output
MongoDB 3.4 introduced a codeName field to error replies, so we use a wildcard to ignore that for 3.2 servers.
2018-05-22 08:31:01 -04:00
Katherine Walker
814d49cacf PHPC-1076: Expose result document for failed commands via CommandFailedEvent 2018-05-22 08:31:01 -04:00
Jeremy Mikola
aee1d13943 PHPC-1113: Replace CLEANUP() calls in APM tests
Some of these calls are NOPs and can be removed, while others should use drop_collection().
2018-05-02 16:04:09 -04:00
Jeremy Mikola
58fa85e85e PHPC-1113: Use common URI constant 2018-05-02 16:04:09 -04:00
Jeremy Mikola
5f7f350670 PHPC-1113: Replace NEEDS('STANDALONE') with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
b4062f880c PHPC-1113: Replace CLEANUP() with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
fe52b484be PHPC-1113: Replace NEEDS_ATLEAST_MONGODB_VERSION() with skip function 2018-05-02 16:04:07 -04:00
Jeremy Mikola
3fad0c56c2 Merge branch 'v1.4' 2018-04-17 10:36:14 -04:00
Katherine Walker
0e8cf55649 PHPC-1159: Test on specific server versions in Travis CI 2018-04-17 09:35:51 -04:00
Katherine Walker
1ad6d75b5c PHPC-1090: Clean up switch statements for exception class selection 2018-03-13 13:21:59 -04:00
Derick Rethans
2dd9f1f219 PHPC-1038: "documents" key in "command" in APM's commandStarted for "insert" is missing 2018-01-02 12:40:52 +00:00
Jeremy Mikola
5d21397e97 Update APM test for libmongoc CRUD changes
As of mongodb/mongo-c-driver@c2639c821d, libmongoc no longer adds a default write concern to commands.
2017-12-12 15:11:46 -05:00
Jeremy Mikola
ecaeb2c1a2 Replace tabs with spaces in test files 2017-12-12 08:17:59 -05:00
Derick Rethans
f609ac7d35 PHPC-1037: Upgrade bundled libmongoc and libbson to 1.9 2017-11-21 14:47:12 +00:00
Jeremy Mikola
94ee50e5ef PHPC-1004: Rename ObjectID to ObjectId 2017-08-30 10:12:22 -04:00
Jeremy Mikola
c79f57c1de PHPC-981: Move APM functions to MongoDB\Driver\Monitoring namespace 2017-07-26 14:02:10 -04:00
Jeremy Mikola
e089c2bd01 PHPC-950: Skip APM callbacks if subscriber HashTable is uninitialized 2017-07-25 15:32:31 -04:00
Derick Rethans
77a68728e2 PHPC-349: Implement APM specification 2017-03-31 13:44:46 +01:00