Skip to content

Commit b73afcd

Browse files
committed
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.
1 parent 163d910 commit b73afcd

9 files changed

+2
-95
lines changed

.evergreen/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ functions:
388388
working_dir: "src"
389389
script: |
390390
${PREPARE_SHELL}
391-
MOCK_SERVICE_ID=${MOCK_SERVICE_ID} API_VERSION=${API_VERSION} TESTS=${TESTS} SSL=${SSL} MONGODB_URI="${MONGODB_URI}${APPEND_URI}" sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
391+
API_VERSION=${API_VERSION} TESTS=${TESTS} SSL=${SSL} MONGODB_URI="${MONGODB_URI}${APPEND_URI}" sh ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
392392
393393
"cleanup":
394394
- command: shell.exec

.evergreen/run-tests.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,11 @@ set -o errexit # Exit the script with error if any of the commands fail
66
# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
77
# TESTS Optional TESTS environment variable for run-tests.php
88
# API_VERSION Optional API_VERSION environment variable for run-tests.php
9-
# MOCK_SERVICE_ID Set to "1" to enable service ID mocking for load balancers. Defaults to empty string.
109

1110
SSL=${SSL:-nossl}
1211
MONGODB_URI=${MONGODB_URI:-}
1312
TESTS=${TESTS:-}
1413
API_VERSION=${API_VERSION:-}
15-
MOCK_SERVICE_ID=${MOCK_SERVICE_ID:-}
1614

1715
OS=$(uname -s | tr '[:upper:]' '[:lower:]')
1816
[ -z "$MARCH" ] && MARCH=$(uname -m | tr '[:upper:]' '[:lower:]')
@@ -35,7 +33,7 @@ echo "Running tests with URI: $MONGODB_URI"
3533
# Run the tests, and store the results in a junit result file
3634
case "$OS" in
3735
*)
38-
MOCK_SERVICE_ID="${MOCK_SERVICE_ID}" API_VERSION="${API_VERSION}" TEST_PHP_JUNIT="${PROJECT_DIRECTORY}/test-results.xml" TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test TESTS=$TESTS
36+
API_VERSION="${API_VERSION}" TEST_PHP_JUNIT="${PROJECT_DIRECTORY}/test-results.xml" TEST_PHP_ARGS="-q -x --show-diff -g FAIL,XFAIL,BORK,WARN,LEAK,SKIP" make test TESTS=$TESTS
3937
;;
4038
esac
4139

php_phongo.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ extern zend_module_entry mongodb_module_entry;
4646
ZEND_BEGIN_MODULE_GLOBALS(mongodb)
4747
char* debug;
4848
FILE* debug_fd;
49-
bool mock_service_id;
5049
HashTable persistent_clients;
5150
HashTable* request_clients;
5251
HashTable* subscribers;

src/phongo_ini.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
#include "php_phongo.h"
2525
#include "phongo_ini.h"
2626

27-
extern bool mongoc_global_mock_service_id;
28-
2927
ZEND_EXTERN_MODULE_GLOBALS(mongodb)
3028

3129
static void phongo_log(mongoc_log_level_t log_level, const char* log_domain, const char* message, void* user_data)
@@ -109,22 +107,6 @@ static PHP_INI_MH(OnUpdateDebug)
109107
return OnUpdateString(entry, new_value, mh_arg1, mh_arg2, mh_arg3, stage);
110108
}
111109

112-
static PHP_INI_MH(OnUpdateMockServiceId)
113-
{
114-
mongoc_global_mock_service_id = zend_ini_parse_bool(new_value);
115-
116-
return SUCCESS;
117-
}
118-
119-
static PHP_INI_DISP(DisplayMockServiceId)
120-
{
121-
if (mongoc_global_mock_service_id) {
122-
ZEND_PUTS("On");
123-
} else {
124-
ZEND_PUTS("Off");
125-
}
126-
}
127-
128110
void phongo_display_ini_entries(ZEND_MODULE_INFO_FUNC_ARGS)
129111
{
130112
DISPLAY_INI_ENTRIES();
@@ -134,7 +116,6 @@ void phongo_register_ini_entries(INIT_FUNC_ARGS)
134116
{
135117
PHP_INI_BEGIN()
136118
STD_PHP_INI_ENTRY("mongodb.debug", "", PHP_INI_ALL, OnUpdateDebug, debug, zend_mongodb_globals, mongodb_globals)
137-
PHP_INI_ENTRY_EX("mongodb.mock_service_id", "0", PHP_INI_ALL, OnUpdateMockServiceId, DisplayMockServiceId)
138119
PHP_INI_END()
139120

140121
REGISTER_INI_ENTRIES();

tests/ini/ini-mock_service_id-ini_get-001.phpt

Lines changed: 0 additions & 13 deletions
This file was deleted.

tests/ini/ini-mock_service_id-ini_get-002.phpt

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/ini/ini-mock_service_id-phpinfo-001.phpt

Lines changed: 0 additions & 15 deletions
This file was deleted.

tests/ini/ini-mock_service_id-phpinfo-002.phpt

Lines changed: 0 additions & 21 deletions
This file was deleted.

tests/utils/basic.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ define('DATABASE_NAME', getenv('MONGODB_DATABASE') ?: 'phongo');
88
define('COLLECTION_NAME', makeCollectionNameFromFilename($_SERVER['SCRIPT_FILENAME']));
99
define('NS', DATABASE_NAME . '.' . COLLECTION_NAME);
1010
define('SSL_DIR', realpath(getenv('SSL_DIR')));
11-
12-
if (getenv('MOCK_SERVICE_ID')) {
13-
ini_set('mongodb.mock_service_id', '1');
14-
}

0 commit comments

Comments
 (0)