Skip to content

Commit 285e6a4

Browse files
committed
SDKQE-2596: Search query testing for CB++
1 parent acdbc4b commit 285e6a4

File tree

7 files changed

+649
-27
lines changed

7 files changed

+649
-27
lines changed

.github/workflows/sanitizers.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
with:
2929
submodules: recursive
3030
- name: Initialize couchbase
31+
env: CB_BEER_SAMPLE=true
3132
run: ./bin/init-cluster
3233
- name: Build tests
3334
env:
@@ -67,6 +68,7 @@ jobs:
6768
with:
6869
submodules: recursive
6970
- name: Initialize couchbase
71+
env: CB_BEER_SAMPLE=true
7072
run: ./bin/init-cluster
7173
- name: Build tests
7274
env:
@@ -106,6 +108,7 @@ jobs:
106108
with:
107109
submodules: recursive
108110
- name: Initialize couchbase
111+
env: CB_BEER_SAMPLE=true
109112
run: ./bin/init-cluster
110113
- name: Build tests
111114
env:
@@ -145,6 +148,7 @@ jobs:
145148
with:
146149
submodules: recursive
147150
- name: Initialize couchbase
151+
env: CB_BEER_SAMPLE=true
148152
run: ./bin/init-cluster
149153
- name: Build tests
150154
env:

.github/workflows/tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
with:
2525
submodules: recursive
2626
- name: Initialize couchbase
27+
env: CB_BEER_SAMPLE=true
2728
run: ./bin/init-cluster
2829
- name: Build tests
2930
run: ./bin/build-tests
@@ -54,6 +55,7 @@ jobs:
5455
with:
5556
submodules: recursive
5657
- name: Initialize couchbase
58+
env: CB_BEER_SAMPLE=true
5759
run: ./bin/init-cluster
5860
- name: Build tests
5961
run: ./bin/build-tests

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ integration_test(durability)
1010
integration_test(arithmetic)
1111
integration_test(collections)
1212
integration_test(subdoc)
13+
integration_test(search)
1314

1415
unit_test(connection_string)
1516
unit_test(utils)

test/test_integration_management.cxx

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,30 +1970,6 @@ TEST_CASE("integration: search index management", "[integration]")
19701970
}
19711971
}
19721972

1973-
bool
1974-
wait_for_search_pindexes_ready(test::utils::integration_test_guard& integration, const std::string& index_name)
1975-
{
1976-
return test::utils::wait_until(
1977-
[&integration, &index_name]() {
1978-
couchbase::operations::management::search_index_stats_request req{};
1979-
auto resp = test::utils::execute(integration.cluster, req);
1980-
if (resp.ctx.ec || resp.stats.empty()) {
1981-
return false;
1982-
}
1983-
auto stats = couchbase::utils::json::parse(resp.stats);
1984-
const auto* num_pindexes_actual = stats.find(fmt::format("{}:{}:num_pindexes_actual", integration.ctx.bucket, index_name));
1985-
if (num_pindexes_actual == nullptr || !num_pindexes_actual->is_number()) {
1986-
return false;
1987-
}
1988-
const auto* num_pindexes_target = stats.find(fmt::format("{}:{}:num_pindexes_target", integration.ctx.bucket, index_name));
1989-
if (num_pindexes_target == nullptr || !num_pindexes_target->is_number()) {
1990-
return false;
1991-
}
1992-
return num_pindexes_actual->get_unsigned() == num_pindexes_target->get_unsigned();
1993-
},
1994-
std::chrono::minutes(3));
1995-
}
1996-
19971973
TEST_CASE("integration: search index management analyze document", "[integration]")
19981974
{
19991975
test::utils::integration_test_guard integration;
@@ -2016,7 +1992,7 @@ TEST_CASE("integration: search index management analyze document", "[integration
20161992
REQUIRE_FALSE(resp.ctx.ec);
20171993
}
20181994

2019-
REQUIRE(wait_for_search_pindexes_ready(integration, index_name));
1995+
REQUIRE(test::utils::wait_for_search_pindexes_ready(integration.cluster, integration.ctx.bucket, index_name));
20201996

20211997
couchbase::operations::management::search_index_analyze_document_response resp;
20221998
bool operation_completed = test::utils::wait_until([&integration, &index_name, &resp]() {

0 commit comments

Comments
 (0)