Commit Graph

67 Commits

Author SHA1 Message Date
Andreas Braun
5f3503c01c PHPC-2165: Expose server error replies in BulkWriteResult (#1385) 2022-12-06 08:18:16 +01: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
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
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
Andreas Braun
a612c370f6 PHPC-1756: Remove oppressive terminology from source code (#1221)
* 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
2021-06-22 19:30:56 +02: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
Andreas Braun
ed31cba5cb PHPC-1739 Move from travis-ci to GitHub Actions (#1199)
* Add GitHub Action workflow for tests

* Add workflow to check formatting

* Remove travis-ci config

* Fix clang-format error

* Add shared json extension for tests

* Hide output for xfail tests

* Use mongo-orchestration configs from drivers-evergreen-tools

* Drop obsolete test scripts

This drops the legacy VM environment and remnants of the travis-ci config

* Remove obsolete server_id config

* Add note about MONGO_ORCHESTRATION_URI to contribution docs

* Restore previous XFAIL behaviour

This did not have the expected effect of preventing diff output for tests that expect failures, so it can be reverted.

* Make SSL certificate path configurable for tests

Since mongo-orchestration will always bring its own certificates, we need to set the correct SSL certificate directory for our tests. This is skipped on GitHub Actions as we don't test SSL builds there (yet). If SSL_DIR was not set, tests requiring SSL will be skipped.

* Fix code review nits
2021-02-23 14:49:54 +01:00
Andreas Braun
4df86904ea Remove assertions against NULL write concern error info 2020-03-02 12:50:14 +01:00
Jeremy Mikola
9a52fcdf91 PHPC-1412: Disable retryWrites for tests using local DB
Additionally, we can use the generated collection name instead of "example".
2019-07-23 09:38:17 -04:00
Derick Rethans
a11546ab3a PHPC-1235: Update tests due to changes in MongoDB 4.1 2019-02-14 15:35:30 -05:00
Derick Rethans
d27ef429a6 PHPC-1219: Relax requirement for replica set tagsets assertions 2018-09-04 16:54:44 +01:00
Derick Rethans
7d1ac7b523 PHPC-1220: Create skip function for insufficient replica set members 2018-08-10 11:26:42 +01:00
Derick Rethans
c80778a153 PHPC-1173: Reimplement replica set seedlist tests 2018-08-10 11:26:42 +01:00
Derick Rethans
e272bb5e47 PHPC-1249: Fix tests running against MongoDB 3.0 replicaset 2018-07-20 16:39:37 +01:00
Derick Rethans
3678fa5236 PHPC-1184: Add alternative topologies to Travis 2018-07-16 10:30:39 +01:00
Jeremy Mikola
8ca94d01e6 PHPC-1113: Use >=3.1 for version skips instead of >3.0.99 2018-05-03 11:37:04 -04:00
Jeremy Mikola
58fa85e85e PHPC-1113: Use common URI constant 2018-05-02 16:04:09 -04:00
Jeremy Mikola
9d4bc8da2c PHPC-1113: Replace NEEDS('REPLICASET_30') with skip functions 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
3a1362bb8d PHPC-1113: Replace NEEDS('REPLICASET') with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
042c56ba85 Do not re-execute BulkWrite in WriteResult::getServer() test
bulkwrite_error-002.phpt already covers this case.
2018-04-17 10:35:39 -04:00
Jeremy Mikola
94ee50e5ef PHPC-1004: Rename ObjectID to ObjectId 2017-08-30 10:12:22 -04:00
Jeremy Mikola
e6b8479506 Reorganize SKIPIF blocks in tests and add missing NEEDS() checks 2017-03-15 10:41:04 -04:00
Jeremy Mikola
0d0561a022 PHPC-898: Regression tests for readConcern option and getMore 2017-01-30 17:12:42 -05:00
Jeremy Mikola
2599607b47 PHPC-635: WriteResult debug handler should return objects 2016-12-19 09:40:29 -05:00
Jeremy Mikola
6dc41c409f PHPC-676: Do not allow BulkWrite objects to be executed multiple times 2016-11-22 11:10:02 -05:00
Jeremy Mikola
11d823f8cd PHPC-498: Fix expected output for ReadPreference and WriteConcern
These test fixes were missed in mongodb/mongo-php-driver#413.
2016-09-19 16:52:38 -04:00
Jeremy Mikola
06d1c73fc9 Fix title for PHPC-155 regression test 2016-03-21 11:42:28 -04:00
Jeremy Mikola
12e6907e41 PHPC-448: Support readConcern option on Query 2015-12-11 15:22:55 -05:00
Jeremy Mikola
dee9ff9566 PHPC-450: Don't assert exact isMaster response when dumping Servers
Since isMaster's response varies by server version, we can omit it from expected Server dump output.
2015-12-10 12:16:36 -05:00
Jeremy Mikola
b5f5216cc3 Rename WriteConcernError tests 2015-10-21 19:32:42 -04:00
Jeremy Mikola
fe9fb63267 PHPC-465: Remove Manager's single write methods
Existing tests for single write methods were ported to executeBulkWrite() tests.
2015-10-21 19:32:42 -04:00
Jeremy Mikola
52dfd6b2d2 PHPC-444: Support options array in BulkWrite and executeInsert() 2015-10-15 15:44:17 -04:00
Jeremy Mikola
98887ff579 PHPC-438: Debug handler should display null for no WC error 2015-10-05 12:22:46 -04:00
Jeremy Mikola
dcbf5ae6ba PHPC-428: Remove support for WriteConcern fsync option 2015-09-23 11:47:53 -04:00
Jeremy Mikola
a6932d59e0 PHPC-423: WriteConcern should report default "w" option as null 2015-09-22 14:07:23 -04:00
Derick Rethans
4e8f56f590 Fixed getServers test to include milliseconds in UTCDate dumps 2015-09-02 18:06:35 +01:00
Jeremy Mikola
a2c88be3ff PHPC-361: Manager::getServers() should omit unknown servers 2015-09-01 13:36:28 -04:00
Jeremy Mikola
6eb0944565 PHPC-319: Convert top-level documents to stdClass by default
Update tests to expect stdClass for documents. Debug handlers and the Server getter methods will still decode documents as native arrays.
2015-07-11 00:38:05 -04:00
Jeremy Mikola
9448dd8562 Relax expected class instance in Manager: getServers() test 2015-07-10 23:55:53 -04:00
Hannes Magnusson
808ee36ca8 PHPC-321: UTCDatetime -> UTCDateTime 2015-06-30 10:30:27 -07:00
Hannes Magnusson
ed1cd1e30b PHPC-309: Bump tests 2015-06-30 10:04:36 -07:00
Hannes Magnusson
7d0c043215 Fix test -- this isn't a hardcoded ID 2015-05-22 11:50:33 -07:00
Hannes Magnusson
f6997c7e7a Improve code coverage for the WriteException 2015-05-13 21:33:43 -07:00
Hannes Magnusson
c09dc2ff4d PHPC-300: Add var_dump() debug info for Server 2015-05-13 18:38:03 -07:00
Jeremy Mikola
998c85bfba PHPC-179: Show unset journal/fsync as null in WriteConcern debug handler 2015-05-04 14:24:37 -04:00
Hannes Magnusson
68eba44df5 PHPC-272: Move exceptions into MongoDB\Driver\Exception namespace 2015-04-24 15:40:28 -07:00
Hannes Magnusson
536ec40a9e PHPC-268: Update tests to declare which environments they need 2015-04-23 19:56:37 -07:00
Jeremy Mikola
66193e83bc PHPC-224: Consolidate Result and Cursor classes into one
This class is now simply Traversable (no longer IteratorAggregate) and adds isDead() and getId() methods from the original Cursor class.
2015-04-06 15:45:19 -04:00
Hannes Magnusson
848acb01ba PHPC-194: Implement Manager::selectServer() method to wrap SDAM server selection 2015-04-03 14:29:05 -07:00