Skip to content

Commit 602b9e3

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

File tree

8 files changed

+658
-27
lines changed

8 files changed

+658
-27
lines changed

.github/workflows/sanitizers.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828
with:
2929
submodules: recursive
3030
- name: Initialize couchbase
31+
env:
32+
CB_BEER_SAMPLE: true
3133
run: ./bin/init-cluster
3234
- name: Build tests
3335
env:
@@ -67,6 +69,8 @@ jobs:
6769
with:
6870
submodules: recursive
6971
- name: Initialize couchbase
72+
env:
73+
CB_BEER_SAMPLE: true
7074
run: ./bin/init-cluster
7175
- name: Build tests
7276
env:
@@ -106,6 +110,8 @@ jobs:
106110
with:
107111
submodules: recursive
108112
- name: Initialize couchbase
113+
env:
114+
CB_BEER_SAMPLE: true
109115
run: ./bin/init-cluster
110116
- name: Build tests
111117
env:
@@ -145,6 +151,8 @@ jobs:
145151
with:
146152
submodules: recursive
147153
- name: Initialize couchbase
154+
env:
155+
CB_BEER_SAMPLE: true
148156
run: ./bin/init-cluster
149157
- name: Build tests
150158
env:

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ jobs:
2424
with:
2525
submodules: recursive
2626
- name: Initialize couchbase
27+
env:
28+
CB_BEER_SAMPLE: true
2729
run: ./bin/init-cluster
2830
- name: Build tests
2931
run: ./bin/build-tests
@@ -54,6 +56,8 @@ jobs:
5456
with:
5557
submodules: recursive
5658
- name: Initialize couchbase
59+
env:
60+
CB_BEER_SAMPLE: true
5761
run: ./bin/init-cluster
5862
- name: Build tests
5963
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)