Commit Graph

49 Commits

Author SHA1 Message Date
Jeremy Mikola
c99a8563bf PHPC-2093: Key Management API (#1339)
* PHPC-2120: Bump libmongoc 1.22.1 and libmongocrypt 1.5.2

* Clean keyvault collection before CSFLE tests

* Test invalid keyMaterial option for ClientEncryption::createDataKey()

* ClientEncryption::createDataKey() "keyMaterial" option

* ClientEncryption key management methods

Use ClientEncryption::getKey in createDataKey tests

* Require server 4.2+ for CSFLE integration tests

* Accommodate PHP 7.2 error message in createDataKey error test
2022-08-18 12:15:54 -04: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
b73afcd482 PHPC-2053: Remove mongodb.mock_service_id INI option
Note: this was only used for internal testing and should not be considered a BC break.
2022-05-23 13:55:40 -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
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
Derick Rethans
8ece2a3a35 PHPC-1179: Reimplement tests that start servers with Mongo Orchestration 2018-09-05 18:36:44 +01:00
Jeremy Mikola
f4cf0fe3a0 PHPC-1113: Use common URI env var in basic/skipif includes 2018-05-02 16:04:07 -04:00
Jeremy Mikola
f21ef4d963 Add REPLICASET_DNS to basic.inc servers array 2018-01-08 10:28:56 -05:00
Jeremy Mikola
6ca8c7fbc1 Remove redundant REPLICASET_36 mo environment 2018-01-08 10:28:56 -05:00
Jeremy Mikola
9812d6713e Upgrade VM to trusty64 and revise mo installation
This also removes unused server versions.
2018-01-08 10:28:56 -05:00
Jeremy Mikola
ecaeb2c1a2 Replace tabs with spaces in test files 2017-12-12 08:17:59 -05:00
Derick Rethans
aa1eb0b8cd PHPC-1047: Add MongoDB 3.6 to test framework 2017-11-23 12:44:22 +00:00
Derick Rethans
14de1e3a35 PHPC-995: Drop support for MongoDB 2.4 2017-11-21 17:19:29 +00:00
Jeremy Mikola
3736c23bbb Add missing REPLICASET_30 environment in basic.inc 2017-03-15 10:38:06 -04:00
Jeremy Mikola
a6e7202498 PHPC-761: Remove BSON_NAMESPACE constant 2016-08-05 14:06:58 -04:00
Jeremy Mikola
8c83588ac5 Register STANDALONE-3.0 with the test suite 2015-12-08 14:50:08 -05:00
Derick Rethans
1b2f920d3d Do this with an env var instead 2015-08-20 11:10:36 +01:00
Derick Rethans
ae0cfeae20 Allow for PHONGO-SERVERS.json in ~ (and fix a test case name) 2015-08-19 16:56:19 +01:00
Hannes Magnusson
ed1cd1e30b PHPC-309: Bump tests 2015-06-30 10:04:36 -07:00
Hannes Magnusson
fd6dab94fc PHPC-279: Add 2.4 (and 2.6) to build matrix and ensure test suite compatibility
Added "STANDALONE_24" and "STANDALONE_26" URI constants
2015-05-12 15:37:06 -07:00
Hannes Magnusson
60fdf52e1d PHPC-241: mongodb.debug improvements 2015-04-24 11:51:09 -07:00
Hannes Magnusson
499bae18b4 PHPC-268: Add NEEDS() function to check if that environment is available 2015-04-23 19:22:14 -07:00
Hannes Magnusson
4f693030b9 PHPC-180: Replace this Orchestration wrapper with significantly simpler code
We no create a /tmp/PHONGO-SERVERS.json file upon launching the servers
which stores the server IDs and connection string (including auth).
This makes it much faster to look up the available servers
2015-03-16 20:28:39 -07:00
Hannes Magnusson
4ddcd0ad6a Simplify debug logging logic when running tests standalone 2015-03-03 10:24:03 -08:00
Hannes Magnusson
ea23e5d3fe PHPC-128: MO presets directory needs to be configurable
various other travis fixes, skipping etc
2015-01-06 21:56:43 -08:00
Hannes Magnusson
d6ceb3be0c PHPC-128: Fix running tests on travis
We no longer require Mongo Orchestration now.
You can export MONGODB_STANDALONE_URI environment variable with dsn to connect to.
2015-01-05 20:48:36 -08:00
Hannes Magnusson
cdb39858b0 Simplify cli debugging 2014-12-23 11:01:32 -08:00
Hannes Magnusson
84f786bf47 PHPC-112: Sping up ReplicaSet 2014-12-22 16:03:55 -08:00
Hannes Magnusson
72ad6a8a44 PHPC-33: Add tests for X509
This test does not currently work due to bug in Mongo Orchestration:
https://github.com/10gen/mongo-orchestration/issues/159
2014-12-19 13:14:49 -08:00
Hannes Magnusson
e2b0f5cfe9 PHPC-45: Orchestrate LDAP/PLAIN servers 2014-12-18 18:04:00 -08:00
Hannes Magnusson
abaed98f61 PHON-6: Split normal SSL and X509 servers 2014-12-16 16:37:32 -08:00
Hannes Magnusson
d0079711d0 PHON-7: Trivial Monog Orchestration abstraction
->start("preset.json") # See scripts/presets/
->getURI("preset.json") # Get the MONGODB_URI
->stopAll() # Stops all running mongods
->stopId("SERVER-ID") # The 'id' key in preset.json
2014-12-16 15:42:22 -08:00
Hannes Magnusson
da8cb0bd3a PHON-91: Use the vm by default, allow it to be overridden by the environment variable 2014-12-16 13:12:31 -08:00
Hannes Magnusson
2d88ca250f PHON-5: Use Mongo Orchestration to manage MongoDB servers 2014-12-16 12:09:28 -08:00
Hannes Magnusson
bbbda03d10 Seperate code from functions 2014-12-16 12:09:28 -08:00
Hannes Magnusson
db4ceec1b6 Improve exception testing 2014-12-12 15:51:55 -08:00
Hannes Magnusson
54a2e194ce PHP-1322: More renaming 2014-12-08 14:43:09 -08:00
Hannes Magnusson
b5c3810070 PHP-1322 Rename count methods in WriteResults 2014-12-08 14:34:35 -08:00
Hannes Magnusson
6efcec44ba Remove unused command 2014-12-03 14:26:54 -08:00
Jeremy Mikola
426976c62a Use "phongo_test" as default test database 2014-10-16 16:02:26 -04:00
Jeremy Mikola
35067cf017 Use preg_replace() for generating collection name from test file
This builds on what already existed in the current driver and adds the ".skip" removal. It also replaces hyphens with underscores to ensure that the collection is easy to access from the shell.
2014-10-16 16:02:26 -04:00
Jeremy Mikola
7f1e190c95 Clean up hex_dump() source and add citation 2014-10-16 16:02:26 -04:00
Jeremy Mikola
5d6052e884 PHP-1142: Dump WriteResult object in write tests 2014-09-29 11:37:47 -04:00
Hannes Magnusson
173310ee7a api changes 2014-07-16 17:59:24 +00:00
Hannes Magnusson
4590a66c59 Touch up WriteResult as return value 2014-07-11 07:31:22 +00:00
Hannes Magnusson
c4ebabeb17 Fix calling continue in global scope 2014-07-08 01:05:18 +00:00
Hannes Magnusson
ca8a7009d0 Batch test and fix skipping test during cleanup phase 2014-07-03 20:26:59 +00:00
Hannes Magnusson
a7effd93a0 Simplify testing 2014-07-02 20:48:59 +00:00
Hannes Magnusson
08f7aef8b5 Add BSON tests 2014-06-20 14:55:03 -07:00