Skip to content

Commit eaf742c

Browse files
authored
Run API version compatibility tests on Jenkins
1 parent c0f1a3e commit eaf742c

File tree

3 files changed

+27
-4
lines changed

3 files changed

+27
-4
lines changed

.ci/run-repository.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ docker build \
3131

3232
echo -e "\033[1m>>>>> Run [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
3333

34+
if [[ "$STACK_VERSION" == "8.0.0-SNAPSHOT" ]]; then
35+
ELASTIC_CLIENT_APIVERSIONING="1"
36+
fi
37+
3438
mkdir -p junit
3539
docker run \
3640
--network=${network_name} \
@@ -39,6 +43,7 @@ docker run \
3943
--env "TEST_SUITE=${TEST_SUITE}" \
4044
--env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \
4145
--env "TEST_TYPE=server" \
46+
--env "ELASTIC_CLIENT_APIVERSIONING=${ELASTIC_CLIENT_APIVERSIONING:-false}" \
4247
--name elasticsearch-py \
4348
--rm \
4449
elastic/elasticsearch-py \

.ci/test-matrix.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
STACK_VERSION:
22
- 7.x-SNAPSHOT
3+
- 8.0.0-SNAPSHOT
34

45
TEST_SUITE:
56
- platinum
@@ -17,4 +18,15 @@ PYTHON_CONNECTION_CLASS:
1718
- Urllib3HttpConnection
1819
- RequestsHttpConnection
1920

20-
exclude: ~
21+
exclude:
22+
# TODO: Remove for 7.16 branch
23+
- STACK_VERSION: 8.0.0-SNAPSHOT
24+
PYTHON_VERSION: "3.4"
25+
- STACK_VERSION: 8.0.0-SNAPSHOT
26+
PYTHON_VERSION: "3.5"
27+
- STACK_VERSION: 8.0.0-SNAPSHOT
28+
PYTHON_VERSION: "3.6"
29+
- STACK_VERSION: 8.0.0-SNAPSHOT
30+
PYTHON_VERSION: "3.7"
31+
- STACK_VERSION: 8.0.0-SNAPSHOT
32+
PYTHON_VERSION: "3.8"

test_elasticsearch/utils.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,11 @@ def wipe_searchable_snapshot_indices(client):
143143

144144
def wipe_xpack_templates(client):
145145
templates = [
146-
x.strip() for x in client.cat.templates(h="name").split("\n") if x.strip()
146+
x.strip()
147+
for x in client.cat.templates(h="name", headers={"accept": "text/plain"}).split(
148+
"\n"
149+
)
150+
if x.strip()
147151
]
148152
for template in templates:
149153
if is_xpack_template(template):
@@ -221,8 +225,10 @@ def wipe_tasks(client):
221225
def wait_for_pending_tasks(client, filter, timeout=30):
222226
end_time = time.time() + timeout
223227
while time.time() < end_time:
224-
tasks = client.cat.tasks(detailed=True).split("\n")
225-
if not any(filter in task for task in tasks):
228+
tasks = client.cat.tasks(detailed=True, headers={"accept": "text/plain"}).split(
229+
"\n"
230+
)
231+
if not any(filter in str(task) for task in tasks):
226232
break
227233

228234

0 commit comments

Comments
 (0)