Commit Graph

30 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
6db48b821f PHPC-2064: Use register_shutdown_function to disable caching of skipif results (#1366) 2022-09-16 08:49:55 +02:00
Jeremy Mikola
03fcb6b9ef PHPC-2099: crypt_shared testing (#1333)
* 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.
2022-06-22 13:37:56 -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
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
ce6b11d475 PHPC-1975: Disable SKIPIF caching for skip_if_not_clean on PHP 8.1 (#1261) 2021-09-24 14:05:16 -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
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
Jeremy Mikola
9ae06e236e Skip known/expected test failures in AppVeyor 2020-05-11 17:43:08 -04:00
Andreas Braun
123f9b0b88 PHPC-1498: Read auto encryption options from driverOptions 2020-01-16 09:23:12 +01:00
Andreas Braun
b0414d55c6 PHPC-1290: Improve checks for transaction support 2019-09-02 16:19:33 +02:00
Andreas Braun
d5e077928d PHPC-1435: Fix test checking invalid argument values 2019-08-29 10:44:57 -04:00
Andreas Braun
d750c7013c PHPC-1290: Run relevant tests on sharded clusters 2019-08-29 07:26:43 +02:00
Andreas Braun
5ad804ac21 PHPC-1290: Add tests for server selection in sharded transactions 2019-08-28 20:10:47 +02:00
Jeremy Mikola
5f235387d9 PHPC-1414: Skip tests when mongo orchestration is not available 2019-07-22 11:56:14 -04:00
Jeremy Mikola
cad8292e35 PHPC-1373: Accessible WriteResult for executeBulkWrite socket error
executeBulkWrite() will now throw a BulkWriteException on top of any previous exception to ensure that a WriteResult can be attached. InvalidArgumentException is excluded, since that is only thrown before mongoc_bulk_operation_execute does IO (e.g. batch is empty).
2019-05-15 14:27:16 -04:00
Derick Rethans
da45c7404b Merge branch 'v1.5' 2018-09-05 18:37:07 +01:00
Derick Rethans
b45a519c43 Added getMore failpoint skip_if 2018-09-05 18:36:44 +01:00
Derick Rethans
897c3f5b4b Merge branch 'v1.5' 2018-08-30 11:45:37 +01:00
Derick Rethans
8a28fcb6a5 PHPC-1177: Add skip clauses to tests that must run with simple auth 2018-08-30 11:44:07 +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
3678fa5236 PHPC-1184: Add alternative topologies to Travis 2018-07-16 10:30:39 +01:00
Jeremy Mikola
2cbe426034 Test for PHPC-1045 should require that the URI has no username 2018-05-02 16:04:09 -04:00
Jeremy Mikola
b4062f880c PHPC-1113: Replace CLEANUP() with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
55e3341493 PHPC-1113: Replace NEEDS('STANDALONE_X509') with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
8768f548b4 PHPC-1113: Replace NEEDS('STANDALONE_AUTH') with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
38405a7f19 PHPC-1113: Replace TESTCOMMANDS() with skip function 2018-05-02 16:04:08 -04:00
Jeremy Mikola
f4cf0fe3a0 PHPC-1113: Use common URI env var in basic/skipif includes 2018-05-02 16:04:07 -04:00