Skip to content

Commit 04cfe72

Browse files
committed
Use 'PYTHON_NODE_CLASS' for node type
1 parent cd408e2 commit 04cfe72

File tree

5 files changed

+10
-14
lines changed

5 files changed

+10
-14
lines changed

.ci/run-repository.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ echo -e "\033[34;1mINFO:\033[0m VERSION ${ELASTICSEARCH_VERSION}\033[0m"
1919
echo -e "\033[34;1mINFO:\033[0m CONTAINER ${ELASTICSEARCH_CONTAINER}\033[0m"
2020
echo -e "\033[34;1mINFO:\033[0m TEST_SUITE ${TEST_SUITE}\033[0m"
2121
echo -e "\033[34;1mINFO:\033[0m PYTHON_VERSION ${PYTHON_VERSION}\033[0m"
22-
echo -e "\033[34;1mINFO:\033[0m PYTHON_CONNECTION_CLASS ${PYTHON_CONNECTION_CLASS}\033[0m"
22+
echo -e "\033[34;1mINFO:\033[0m PYTHON_NODE_CLASS ${PYTHON_NODE_CLASS}\033[0m"
2323

2424
echo -e "\033[1m>>>>> Build [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m"
2525

@@ -37,7 +37,7 @@ docker run \
3737
--env "STACK_VERSION=${STACK_VERSION}" \
3838
--env "ELASTICSEARCH_URL=${elasticsearch_url}" \
3939
--env "TEST_SUITE=${TEST_SUITE}" \
40-
--env "PYTHON_CONNECTION_CLASS=${PYTHON_CONNECTION_CLASS}" \
40+
--env "PYTHON_NODE_CLASS=${PYTHON_NODE_CLASS}" \
4141
--env "TEST_TYPE=server" \
4242
--name elasticsearch-py \
4343
--rm \

.ci/run-tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
export STACK_VERSION="${STACK_VERSION:=8.0.0-SNAPSHOT}"
99
export TEST_SUITE="${TEST_SUITE:=platinum}"
1010
export PYTHON_VERSION="${PYTHON_VERSION:=3.9}"
11-
export PYTHON_CONNECTION_CLASS="${PYTHON_CONNECTION_CLASS:=Urllib3HttpConnection}"
11+
export PYTHON_NODE_CLASS="${PYTHON_NODE_CLASS:=urllib3}"
1212

1313
script_path=$(dirname $(realpath -s $0))
1414
source $script_path/functions/imports.sh

.ci/test-matrix.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ PYTHON_VERSION:
99
- "3.7"
1010
- "3.8"
1111
- "3.9"
12+
- "3.10"
1213

13-
PYTHON_CONNECTION_CLASS:
14-
- Urllib3HttpConnection
15-
- RequestsHttpConnection
14+
PYTHON_NODE_CLASS:
15+
- urllib3
16+
- requests
1617

1718
exclude: ~

test_elasticsearch/test_server/conftest.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ def sync_client_factory(elasticsearch_url):
4040
"ca_certs": CA_CERTS,
4141
"headers": {"Authorization": "Basic ZWxhc3RpYzpjaGFuZ2VtZQ=="},
4242
}
43-
if "PYTHON_CONNECTION_CLASS" in os.environ:
44-
from elasticsearch import connection
45-
46-
kw["connection_class"] = getattr(
47-
connection, os.environ["PYTHON_CONNECTION_CLASS"]
48-
)
43+
if "PYTHON_NODE_CLASS" in os.environ:
44+
kw["node_class"] = os.environ["PYTHON_NODE_CLASS"]
4945

5046
# We do this little dance with the URL to force
5147
# Requests to respect 'headers: None' within rest API spec tests.

test_elasticsearch/test_server/test_rest_api_spec.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@
121121
XPACK_FEATURES = None
122122
ES_VERSION = None
123123
RUN_ASYNC_REST_API_TESTS = (
124-
sys.version_info >= (3, 6)
125-
and os.environ.get("PYTHON_CONNECTION_CLASS") == "RequestsHttpConnection"
124+
sys.version_info >= (3, 8) and os.environ.get("PYTHON_NODE_CLASS") == "requests"
126125
)
127126

128127
FALSEY_VALUES = ("", None, False, 0, 0.0)

0 commit comments

Comments
 (0)