Skip to content

Commit 7415d34

Browse files
committed
Skip test on mongos (mongos returns indiviaul shards status)
1 parent 5f7fd40 commit 7415d34

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

tests/test-libmongoc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -875,6 +875,17 @@ test_framework_is_replset (void)
875875
return is_replset;
876876
}
877877

878+
int
879+
test_framework_skip_if_mongos (void)
880+
{
881+
return test_framework_is_mongos() ? 0 : 1;
882+
}
883+
884+
int
885+
test_framework_skip_if_replset (void)
886+
{
887+
return test_framework_is_replset() ? 0 : 1;
888+
}
878889

879890
bool
880891
test_framework_max_wire_version_at_least (int version)

tests/test-libmongoc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ mongoc_client_t *test_framework_client_new (void);
3838
mongoc_client_pool_t *test_framework_client_pool_new (void);
3939
bool test_framework_is_mongos (void);
4040
bool test_framework_is_replset (void);
41+
int test_framework_skip_if_mongos (void);
42+
int test_framework_skip_if_replset (void);
4143
bool test_framework_max_wire_version_at_least (int version);
4244

4345
typedef struct _debug_stream_stats_t {

tests/test-mongoc-collection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,7 @@ END_IGNORE_DEPRECATIONS;
18271827

18281828

18291829
static void
1830-
test_command_fq (void)
1830+
test_command_fq (void *context)
18311831
{
18321832
mongoc_client_t *client;
18331833
mongoc_cursor_t *cursor;
@@ -2083,6 +2083,6 @@ test_collection_install (TestSuite *suite)
20832083
TestSuite_Add (suite, "/Collection/find_and_modify", test_find_and_modify);
20842084
TestSuite_Add (suite, "/Collection/large_return", test_large_return);
20852085
TestSuite_Add (suite, "/Collection/many_return", test_many_return);
2086-
TestSuite_Add (suite, "/Collection/command_fully_qualified", test_command_fq);
2086+
TestSuite_AddFull (suite, "/Collection/command_fully_qualified", test_command_fq, NULL, NULL, test_framework_skip_if_mongos);
20872087
TestSuite_Add (suite, "/Collection/get_index_info", test_get_index_info);
20882088
}

0 commit comments

Comments
 (0)