Skip to content

Commit 283cdc2

Browse files
authored
CDRIVER-4333 unskip mongohouse tests (#1518)
* remove `mongohouse` tests from skip * do not run `drop` in mongohouse tests * do not run `configureFailPoint` in mongohouse tests * fix leak * pass `ON` for `RUN_MONGOHOUSE_TESTS` To enable using `test_framework_getenv_bool`. "true" is not a supported value. * add helper `test_framework_is_mongohouse` To reduce hard coding of the string "RUN_MONGOHOUSE_TESTS"
1 parent 1eacb5d commit 283cdc2

File tree

7 files changed

+25
-15
lines changed

7 files changed

+25
-15
lines changed

.evergreen/etc/skip-tests.txt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,6 @@
1717
# /skip/entire/test # this will be output by the runner as the skip reason
1818
# /skip/part/of/spec/test/"sub-test description" # this will also be output
1919

20-
/mongohouse/aggregate # CDRIVER-4333
21-
/mongohouse/estimatedDocumentCount # CDRIVER-4333
22-
/mongohouse/find # CDRIVER-4333
23-
/mongohouse/getMore # CDRIVER-4333
24-
/mongohouse/listCollections # CDRIVER-4333
25-
/mongohouse/listDatabases # CDRIVER-4333
26-
/mongohouse/runCommand # CDRIVER-4333
27-
2820
/change_stream/live/track_resume_token # (CDRIVER-4344) Condition 'bson_compare (resume_token, &doc2_rt) == 0' failed
2921
/ClientPool/pop_timeout # (CDRIVER-4348) precondition failed: duration_usec / 1000 >= 1990
3022

.evergreen/generated_configs/legacy-config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,9 +258,8 @@ functions:
258258
wait_for_mongohouse 27017 || exit
259259
echo "Waiting for mongohouse to start... done."
260260
pgrep -a "mongohouse"
261-
export RUN_MONGOHOUSE_TESTS=true
261+
export RUN_MONGOHOUSE_TESTS=ON
262262
./src/libmongoc/test-libmongoc --no-fork -l /mongohouse/* -d --skip-tests .evergreen/etc/skip-tests.txt
263-
unset RUN_MONGOHOUSE_TESTS
264263
run aws tests:
265264
- command: ec2.assume_role
266265
params:

.evergreen/legacy_config_generator/evergreen_config_lib/functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,8 @@
190190
wait_for_mongohouse 27017 || exit
191191
echo "Waiting for mongohouse to start... done."
192192
pgrep -a "mongohouse"
193-
export RUN_MONGOHOUSE_TESTS=true
193+
export RUN_MONGOHOUSE_TESTS=ON
194194
./src/libmongoc/test-libmongoc --no-fork -l /mongohouse/* -d --skip-tests .evergreen/etc/skip-tests.txt
195-
unset RUN_MONGOHOUSE_TESTS
196195
'''),
197196
)),
198197
('run aws tests', Function(

src/libmongoc/tests/json-test.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,11 @@ deactivate_fail_points (mongoc_client_t *client, uint32_t server_id)
13381338

13391339
ASSERT (client);
13401340

1341+
if (test_framework_is_mongohouse ()) {
1342+
// mongohouse does not support failpoints.
1343+
return;
1344+
}
1345+
13411346
if (server_id) {
13421347
sd = mongoc_client_get_server_description (client, server_id);
13431348
BSON_ASSERT (sd);
@@ -1922,8 +1927,11 @@ run_json_general_test (const json_test_config_t *config)
19221927

19231928
set_auto_encryption_opts (client, &test);
19241929
/* Drop and recreate test database/collection if necessary. */
1925-
_recreate (db_name, collection_name, scenario);
1926-
_recreate (db2_name, collection2_name, scenario);
1930+
if (!test_framework_is_mongohouse ()) {
1931+
// mongohouse test user is not authorized to run `drop`.
1932+
_recreate (db_name, collection_name, scenario);
1933+
_recreate (db2_name, collection2_name, scenario);
1934+
}
19271935
insert_data (db_name, collection_name, scenario);
19281936

19291937
db = mongoc_client_get_database (client, db_name);

src/libmongoc/tests/test-libmongoc.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2240,10 +2240,16 @@ test_framework_skip_if_single (void)
22402240
return (test_framework_is_mongos () || test_framework_is_replset ());
22412241
}
22422242

2243+
bool
2244+
test_framework_is_mongohouse (void)
2245+
{
2246+
return test_framework_getenv_bool ("RUN_MONGOHOUSE_TESTS");
2247+
}
2248+
22432249
int
22442250
test_framework_skip_if_no_mongohouse (void)
22452251
{
2246-
if (!getenv ("RUN_MONGOHOUSE_TESTS")) {
2252+
if (!test_framework_is_mongohouse ()) {
22472253
return 0;
22482254
}
22492255
return 1;

src/libmongoc/tests/test-libmongoc.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ bool
138138
test_framework_is_mongos (void);
139139
bool
140140
test_framework_is_replset (void);
141+
// `test_framework_is_mongohouse` returns true if configured to test
142+
// mongohoused (used for Atlas Data Lake).
143+
// See: "Atlas Data Lake Tests" in the MongoDB Specifications.
144+
bool
145+
test_framework_is_mongohouse (void);
141146
bool
142147
test_framework_server_is_secondary (mongoc_client_t *client,
143148
uint32_t server_id);

src/libmongoc/tests/test-mongoc-mongohouse.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ test_mongohouse_kill_cursors (void *ctx_unused)
221221
mongoc_apm_set_command_started_cb (callbacks, cmd_started_cb);
222222
mongoc_apm_set_command_succeeded_cb (callbacks, cmd_succeeded_cb);
223223
mongoc_client_set_apm_callbacks (client, callbacks, (void *) &test);
224+
mongoc_apm_callbacks_destroy (callbacks);
224225

225226
coll = mongoc_client_get_collection (client, "test", "driverdata");
226227

0 commit comments

Comments
 (0)