Skip to content

CDRIVER-4333 unskip mongohouse tests #1518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .evergreen/etc/skip-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@
# /skip/entire/test # this will be output by the runner as the skip reason
# /skip/part/of/spec/test/"sub-test description" # this will also be output

/mongohouse/aggregate # CDRIVER-4333
/mongohouse/estimatedDocumentCount # CDRIVER-4333
/mongohouse/find # CDRIVER-4333
/mongohouse/getMore # CDRIVER-4333
/mongohouse/listCollections # CDRIVER-4333
/mongohouse/listDatabases # CDRIVER-4333
/mongohouse/runCommand # CDRIVER-4333

/change_stream/live/track_resume_token # (CDRIVER-4344) Condition 'bson_compare (resume_token, &doc2_rt) == 0' failed
/ClientPool/pop_timeout # (CDRIVER-4348) precondition failed: duration_usec / 1000 >= 1990

Expand Down
3 changes: 1 addition & 2 deletions .evergreen/generated_configs/legacy-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,8 @@ functions:
wait_for_mongohouse 27017 || exit
echo "Waiting for mongohouse to start... done."
pgrep -a "mongohouse"
export RUN_MONGOHOUSE_TESTS=true
export RUN_MONGOHOUSE_TESTS=ON
./src/libmongoc/test-libmongoc --no-fork -l /mongohouse/* -d --skip-tests .evergreen/etc/skip-tests.txt
unset RUN_MONGOHOUSE_TESTS
run aws tests:
- command: ec2.assume_role
params:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@
wait_for_mongohouse 27017 || exit
echo "Waiting for mongohouse to start... done."
pgrep -a "mongohouse"
export RUN_MONGOHOUSE_TESTS=true
export RUN_MONGOHOUSE_TESTS=ON
./src/libmongoc/test-libmongoc --no-fork -l /mongohouse/* -d --skip-tests .evergreen/etc/skip-tests.txt
unset RUN_MONGOHOUSE_TESTS
'''),
)),
('run aws tests', Function(
Expand Down
12 changes: 10 additions & 2 deletions src/libmongoc/tests/json-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,11 @@ deactivate_fail_points (mongoc_client_t *client, uint32_t server_id)

ASSERT (client);

if (test_framework_is_mongohouse ()) {
// mongohouse does not support failpoints.
return;
}

if (server_id) {
sd = mongoc_client_get_server_description (client, server_id);
BSON_ASSERT (sd);
Expand Down Expand Up @@ -1922,8 +1927,11 @@ run_json_general_test (const json_test_config_t *config)

set_auto_encryption_opts (client, &test);
/* Drop and recreate test database/collection if necessary. */
_recreate (db_name, collection_name, scenario);
_recreate (db2_name, collection2_name, scenario);
if (!test_framework_is_mongohouse ()) {
// mongohouse test user is not authorized to run `drop`.
_recreate (db_name, collection_name, scenario);
_recreate (db2_name, collection2_name, scenario);
}
insert_data (db_name, collection_name, scenario);

db = mongoc_client_get_database (client, db_name);
Expand Down
8 changes: 7 additions & 1 deletion src/libmongoc/tests/test-libmongoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2240,10 +2240,16 @@ test_framework_skip_if_single (void)
return (test_framework_is_mongos () || test_framework_is_replset ());
}

bool
test_framework_is_mongohouse (void)
{
return test_framework_getenv_bool ("RUN_MONGOHOUSE_TESTS");
}

int
test_framework_skip_if_no_mongohouse (void)
{
if (!getenv ("RUN_MONGOHOUSE_TESTS")) {
if (!test_framework_is_mongohouse ()) {
return 0;
}
return 1;
Expand Down
5 changes: 5 additions & 0 deletions src/libmongoc/tests/test-libmongoc.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,11 @@ bool
test_framework_is_mongos (void);
bool
test_framework_is_replset (void);
// `test_framework_is_mongohouse` returns true if configured to test
// mongohoused (used for Atlas Data Lake).
// See: "Atlas Data Lake Tests" in the MongoDB Specifications.
bool
test_framework_is_mongohouse (void);
bool
test_framework_server_is_secondary (mongoc_client_t *client,
uint32_t server_id);
Expand Down
1 change: 1 addition & 0 deletions src/libmongoc/tests/test-mongoc-mongohouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ test_mongohouse_kill_cursors (void *ctx_unused)
mongoc_apm_set_command_started_cb (callbacks, cmd_started_cb);
mongoc_apm_set_command_succeeded_cb (callbacks, cmd_succeeded_cb);
mongoc_client_set_apm_callbacks (client, callbacks, (void *) &test);
mongoc_apm_callbacks_destroy (callbacks);

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

Expand Down