diff --git a/.ci/Dockerfile b/.buildkite/Dockerfile similarity index 76% rename from .ci/Dockerfile rename to .buildkite/Dockerfile index 569de2e05..3c429a37b 100644 --- a/.ci/Dockerfile +++ b/.buildkite/Dockerfile @@ -14,13 +14,7 @@ RUN groupadd --system -g ${BUILDER_GID} ${BUILDER_GROUP} \ && useradd --system --shell /bin/bash -u ${BUILDER_UID} -g ${BUILDER_GROUP} -d /var/lib/elastic -m elastic 1>/dev/null 2>/dev/null \ && mkdir -p /code/elasticsearch-py && mkdir /code/elasticsearch-py/build \ && chown -R ${BUILDER_USER}:${BUILDER_GROUP} /code/ -COPY --chown=$BUILDER_USER:$BUILDER_GROUP . . WORKDIR /code/elasticsearch-py USER ${BUILDER_USER}:${BUILDER_GROUP} -COPY dev-requirements.txt . -RUN python -m pip install \ - -U --no-cache-dir \ - --disable-pip-version-check \ - nox -rdev-requirements.txt +RUN python -m pip install --disable-pip-version-check nox COPY --chown=$BUILDER_USER:$BUILDER_GROUP . . -RUN python -m pip install -U -e . diff --git a/.buildkite/certs/ca.crt b/.buildkite/certs/ca.crt new file mode 100755 index 000000000..5ed1c9853 --- /dev/null +++ b/.buildkite/certs/ca.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSTCCAjGgAwIBAgIUHTeTPPuZIX3wdyudMsllXa9yZ1kwDQYJKoZIhvcNAQEL +BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l +cmF0ZWQgQ0EwHhcNMjMwODIxMTcyNTMyWhcNMjYwODIwMTcyNTMyWjA0MTIwMAYD +VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMZs7DXbV7ovFvQ/CiqvHHZ/ +40rLyAcBQMhVBke2VVCQk3hIOPpHYt3xZgb61Oyrf14lFxny483beXaUqGThZ67Y +RsxzSOS8NUi21OLZ3xaE+p+Yx9Xe6lTMQJM4RpD/A5V35uikji1K4+F0ooJghELq +Fndmark/7SQFh6Bg8/aaf6Hpyar3WOWdQjHXgszNAv1Ez7+pPlfnCS8XNjYB5Y2n +gAayb1krMRW/3E6hRVZAig3I2H8mezL5tF8iS5aJW1WLpw4oYnbH0DdS+gpCK1lT +8GZd8Dk0QbNGpXNTu67BravVhgEoprBVMz6G1C4MiuVcBy7gA671/f46S4Tgb10C +AwEAAaNTMFEwHQYDVR0OBBYEFHVhRrHXbd5QFEgk3RFn4Y4LYo9PMB8GA1UdIwQY +MBaAFHVhRrHXbd5QFEgk3RFn4Y4LYo9PMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggEBACoGVPqeYE3IPRdSAtihIq071BfGA8vgfJWv0qiI0T+gYetX +dnebmQc5EccdEIrxD0bLKPgzd5c3ILwQy5+uo03ua7PrplwPVdeNXnU1LodAQ0Zb +GmTixXqgj8AMcvRsA7qARjXvf6w3Yyb7GO3FXRIGtqk12Vb1qnJg894CSIWrHiw0 +hRO5b7eJyrOy2s6QA6FucM/scM1Z/8D9tHfgwmrKM875VGerJORwfHCaCvF1YvBj +cIpYNnw2vFzDvRevh63sSQbZ9q3nbtD27AZSN9LKEbipSEOoBZMKG2zgDTT/Olzx +EQJ2t+Z487UuFX6+WaLZMteL2F4eh9OFWIYM3EI= +-----END CERTIFICATE----- diff --git a/.buildkite/certs/ca.pem b/.buildkite/certs/ca.pem new file mode 100644 index 000000000..5ed1c9853 --- /dev/null +++ b/.buildkite/certs/ca.pem @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDSTCCAjGgAwIBAgIUHTeTPPuZIX3wdyudMsllXa9yZ1kwDQYJKoZIhvcNAQEL +BQAwNDEyMDAGA1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5l +cmF0ZWQgQ0EwHhcNMjMwODIxMTcyNTMyWhcNMjYwODIwMTcyNTMyWjA0MTIwMAYD +VQQDEylFbGFzdGljIENlcnRpZmljYXRlIFRvb2wgQXV0b2dlbmVyYXRlZCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMZs7DXbV7ovFvQ/CiqvHHZ/ +40rLyAcBQMhVBke2VVCQk3hIOPpHYt3xZgb61Oyrf14lFxny483beXaUqGThZ67Y +RsxzSOS8NUi21OLZ3xaE+p+Yx9Xe6lTMQJM4RpD/A5V35uikji1K4+F0ooJghELq +Fndmark/7SQFh6Bg8/aaf6Hpyar3WOWdQjHXgszNAv1Ez7+pPlfnCS8XNjYB5Y2n +gAayb1krMRW/3E6hRVZAig3I2H8mezL5tF8iS5aJW1WLpw4oYnbH0DdS+gpCK1lT +8GZd8Dk0QbNGpXNTu67BravVhgEoprBVMz6G1C4MiuVcBy7gA671/f46S4Tgb10C +AwEAAaNTMFEwHQYDVR0OBBYEFHVhRrHXbd5QFEgk3RFn4Y4LYo9PMB8GA1UdIwQY +MBaAFHVhRrHXbd5QFEgk3RFn4Y4LYo9PMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggEBACoGVPqeYE3IPRdSAtihIq071BfGA8vgfJWv0qiI0T+gYetX +dnebmQc5EccdEIrxD0bLKPgzd5c3ILwQy5+uo03ua7PrplwPVdeNXnU1LodAQ0Zb +GmTixXqgj8AMcvRsA7qARjXvf6w3Yyb7GO3FXRIGtqk12Vb1qnJg894CSIWrHiw0 +hRO5b7eJyrOy2s6QA6FucM/scM1Z/8D9tHfgwmrKM875VGerJORwfHCaCvF1YvBj +cIpYNnw2vFzDvRevh63sSQbZ9q3nbtD27AZSN9LKEbipSEOoBZMKG2zgDTT/Olzx +EQJ2t+Z487UuFX6+WaLZMteL2F4eh9OFWIYM3EI= +-----END CERTIFICATE----- diff --git a/.buildkite/certs/testnode.crt b/.buildkite/certs/testnode.crt new file mode 100755 index 000000000..39eb092fa --- /dev/null +++ b/.buildkite/certs/testnode.crt @@ -0,0 +1,20 @@ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIVAKLWEcNzTd4B0NqnrJL0xAKaS8DWMA0GCSqGSIb3DQEB +CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu +ZXJhdGVkIENBMB4XDTIzMDgyMTE3MjcwMloXDTI2MDgyMDE3MjcwMlowEzERMA8G +A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC8 +eLXL3ZX5v8JlHcfg+96Bpq24EeiqV+7RPPKbcH80ODjkETqYUpam+TcOl2gt23p/ +rpiPSSpOX8pFdmY78wTmxo2GCQZ/db2h0gZOOYpb8HQku+hJ4bAmtzizrqWW76Wz +csen3DSUkT0bKkJTjUMmwVhRaMpfv8EIcUbrHAwc3VCj7grnFL0kdAuQa6iyBH4I +lTUYOIOVyEJ8zZ7R4BJO3QU+TRuJ5+w/QiZMeDqxtrdDL37vYQHPW7L/XISCCOMp +sA3avzFphoQXBQ8mjdB8Txkd4sH7mJTqnRp5ILhRzVpcPPgQYFeIB567B+kFeSau +aJJmc0EVgOcK5aSMtOH3AgMBAAGjYjBgMB0GA1UdDgQWBBQsZbZDudZ63h52FlU5 +N2g3pznkETAfBgNVHSMEGDAWgBR1YUax123eUBRIJN0RZ+GOC2KPTzATBgNVHREE +DDAKgghpbnN0YW5jZTAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAyv0Cw +OrvZn7FHHS8TJI5vTi1F43R/eSNMNL/+q/nK93KaxWJH1T4zrJhrJ9KpzkFcalXP +bu02oTh28b3o3QpS2wdwMv/Q3NLoMBEmQlG2UrELFvV43nS8LCiwCX3o11L1HZP3 +1Z/rclwxbA4OQ/ZkPcol++TDZQTM/8WkIdZmTL4UDb/ppDjX24nTOitkMRZlYAOY +mid9GGExhKrUJ0I9/A3w1hWRA1Hwc+1TFDcPphl2x2uQ9HJFBueAvuFXmIjDki1x +qrvnFZ+mneI9kR4m82MX900WF15KS35GzmMui0tsf0wbfy3Jh+WnpMlIIa2OQXw7 +prbkg9tScQSsvhC8 +-----END CERTIFICATE----- diff --git a/.buildkite/certs/testnode.key b/.buildkite/certs/testnode.key new file mode 100755 index 000000000..b7458996a --- /dev/null +++ b/.buildkite/certs/testnode.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAvHi1y92V+b/CZR3H4PvegaatuBHoqlfu0Tzym3B/NDg45BE6 +mFKWpvk3DpdoLdt6f66Yj0kqTl/KRXZmO/ME5saNhgkGf3W9odIGTjmKW/B0JLvo +SeGwJrc4s66llu+ls3LHp9w0lJE9GypCU41DJsFYUWjKX7/BCHFG6xwMHN1Qo+4K +5xS9JHQLkGuosgR+CJU1GDiDlchCfM2e0eASTt0FPk0biefsP0ImTHg6sba3Qy9+ +72EBz1uy/1yEggjjKbAN2r8xaYaEFwUPJo3QfE8ZHeLB+5iU6p0aeSC4Uc1aXDz4 +EGBXiAeeuwfpBXkmrmiSZnNBFYDnCuWkjLTh9wIDAQABAoIBAAU0iEDTI9s78pB8 +XBLYofKOuemFhRl/SDc7KbAlUT4N93RFDYs7bLG73Eto3xW1JBL2rXv3l1WGy71T +YctyEMaW4T28bhODGvOnK0lpyWp0n6CMGARCWW0YTlaYEjay866bEuyN5l3cDQX9 +Csvn8NzXJitJa51tXFVxW3YO1j7Nyc/M59oyBZ1ARYYmQqFYLEu6lvJOW0cKDFkZ +AcMVlOIxZQL/Mf+RO72aQGVuYNjqxlLIXLuE9zFR2gDFM2+l3FMUWDGHGBDFyjKU +iMk4+sSlOTFXqO9VQzua6FLFMsQT6m5PFD4uPY92KR6CPfH/NrWqwqr+jpjaU+gs +3U9GN+ECgYEA58qX7tKPk7CWdk3kyk5NsNcs/qib+heXWEubfhoU8LmSnbBQhOAz +wi//r/xm0OHGj84y66+G3T347iudrLjhr07oGM1QfjYT3kb90efLjwAfCECtyVYL +EQrWO5UeoTnmrhlB1mGL3sWaVAsVqNLz8i2H5c7sj0hxHsvM62159r8CgYEA0Cff +opJqmUpMpHm3sgjMWctylVrHBuQe5cl5Ad80pbd6mvtt4TvGXbUGNdzURfyve9DS +x1CVlj4Sz8VuelFQgYL+7/qUqZoms1aSgJpxWv8ou+wUHmlF3kVO8VKt3BNHV+8J +euSB6NG91BGguBoHgnOoVcjbDGdhJGRTojCNWskCgYEA1jE3nwDCnrbTA3XNk0ky +r9TXhmgm4r+EIpqTkL7nVOAXZVJ1xaQtECgsveKe3C2WwHLKSVMFbFMFQonZha+/ +FbHz9l9cH5U3XPL7QEpTp8xz4LtsHJ4/UbtS5vJQwKnxyjYaydGQYAb4KuunUz/F +H6kFaM6DeZB2v/+SWIfs6Z8CgYARUdAEyeP+vzTjVpFXSe4e5pOxI619wEtl2T6t +TjImO78C2DrLS9r0fxR2NNqgvCapybVQCj94EdAk44uOt+dX71thAluORRpFP8XO +14rpBGQSRtFhumaq2N95quR2dFAyW9xREmRQx+rgk1rpFplbXF48TQsU3CE0Evj2 +fM22KQKBgDhob7M9sWvXecxoyy3J17jUTcFqmqKcqGnx3ZJ7Q9CgAfjYqNNQws27 +wTuaJB0PEuCOu4t+lUHEBMIjGkBfo1bHd4EZaW04Xgbfn2j8MK2e+9GlRtedxxFg +c1JdRb5+eTgPwLcDsmMWIW357PDW7RDEI07G1ZB4SqxGTKkU7JOW +-----END RSA PRIVATE KEY----- diff --git a/.ci/functions/cleanup.sh b/.buildkite/functions/cleanup.sh similarity index 96% rename from .ci/functions/cleanup.sh rename to .buildkite/functions/cleanup.sh index 4c25166fb..98dfe4e14 100755 --- a/.ci/functions/cleanup.sh +++ b/.buildkite/functions/cleanup.sh @@ -2,7 +2,7 @@ # # Shared cleanup routines between different steps # -# Please source .ci/functions/imports.sh as a whole not just this file +# Please source .buildkite/functions/imports.sh as a whole not just this file # # Version 1.0.0 # - Initial version after refactor diff --git a/.ci/functions/imports.sh b/.buildkite/functions/imports.sh similarity index 100% rename from .ci/functions/imports.sh rename to .buildkite/functions/imports.sh diff --git a/.ci/functions/wait-for-container.sh b/.buildkite/functions/wait-for-container.sh similarity index 94% rename from .ci/functions/wait-for-container.sh rename to .buildkite/functions/wait-for-container.sh index 1a721b588..bbbf4ea63 100755 --- a/.ci/functions/wait-for-container.sh +++ b/.buildkite/functions/wait-for-container.sh @@ -2,7 +2,7 @@ # # Exposes a routine scripts can call to wait for a container if that container set up a health command # -# Please source .ci/functions/imports.sh as a whole not just this file +# Please source .buildkite/functions/imports.sh as a whole not just this file # # Version 1.0.1 # - Initial version after refactor diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index ffb9ebab5..816e91ea8 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -1,3 +1,21 @@ steps: - - label: ":python: Greetings" - command: "echo 'Hello, world!'" + - label: ":elasticsearch: :python: ES Python ({{ matrix.python }})" + agents: + provider: "gcp" + env: + PYTHON_VERSION: "{{ matrix.python }}" + TEST_SUITE: "platinum" + STACK_VERSION: "8.11.0-SNAPSHOT" + PYTHON_CONNECTION_CLASS: "{{ matrix.connection }}" + matrix: + setup: + python: + - "3.7" + - "3.8" + - "3.9" + - "3.10" + - "3.11" + connection: + - "urllib3" + - "requests" + command: ./.buildkite/run-tests diff --git a/.ci/run-elasticsearch.sh b/.buildkite/run-elasticsearch.sh similarity index 96% rename from .ci/run-elasticsearch.sh rename to .buildkite/run-elasticsearch.sh index 05046db9c..2f73ea8d1 100755 --- a/.ci/run-elasticsearch.sh +++ b/.buildkite/run-elasticsearch.sh @@ -31,6 +31,12 @@ cleanup_node $es_node_name master_node_name=${es_node_name} cluster_name=${moniker}${suffix} +BUILDKITE=${BUILDKITE-false} +# Set vm.max_map_count kernel setting to 262144 if we're in CI +if [[ "$BUILDKITE" == "true" ]]; then + sudo sysctl -w vm.max_map_count=262144 +fi + declare -a volumes environment=($(cat <<-END --env ELASTIC_PASSWORD=$elastic_password diff --git a/.ci/run-nox.sh b/.buildkite/run-nox.sh similarity index 100% rename from .ci/run-nox.sh rename to .buildkite/run-nox.sh diff --git a/.ci/run-repository.sh b/.buildkite/run-repository.sh similarity index 98% rename from .ci/run-repository.sh rename to .buildkite/run-repository.sh index 7a5b5b9e1..466b906cc 100755 --- a/.ci/run-repository.sh +++ b/.buildkite/run-repository.sh @@ -24,7 +24,7 @@ echo -e "\033[34;1mINFO:\033[0m PYTHON_CONNECTION_CLASS ${PYTHON_CONNECTION_CLAS echo -e "\033[1m>>>>> Build [elastic/elasticsearch-py container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" docker build \ - --file .ci/Dockerfile \ + --file .buildkite/Dockerfile \ --tag elastic/elasticsearch-py \ --build-arg "PYTHON_VERSION=${PYTHON_VERSION}" \ --build-arg "BUILDER_UID=$(id -u)" \ diff --git a/.ci/run-tests b/.buildkite/run-tests similarity index 72% rename from .ci/run-tests rename to .buildkite/run-tests index b72b112b3..7e7339fb6 100755 --- a/.ci/run-tests +++ b/.buildkite/run-tests @@ -14,17 +14,17 @@ script_path=$(dirname $(realpath -s $0)) source $script_path/functions/imports.sh set -euo pipefail -echo -e "\033[1m>>>>> Start [$STACK_VERSION container] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -DETACH=true bash .ci/run-elasticsearch.sh +echo "--- :elasticsearch: Starting Elasticsearch" +DETACH=true bash $script_path/run-elasticsearch.sh if [[ -n "$RUNSCRIPTS" ]]; then for RUNSCRIPT in ${RUNSCRIPTS//,/ } ; do echo -e "\033[1m>>>>> Running run-$RUNSCRIPT.sh >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" CONTAINER_NAME=${RUNSCRIPT} \ DETACH=true \ - bash .ci/run-${RUNSCRIPT}.sh + bash $script_path/run-${RUNSCRIPT}.sh done fi -echo -e "\033[1m>>>>> Repository specific tests >>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[0m" -bash .ci/run-repository.sh +echo "+++ :python: Client tests" +bash $script_path/run-repository.sh diff --git a/.ci/certs/ca.crt b/.ci/certs/ca.crt deleted file mode 100755 index 71f9bfc81..000000000 --- a/.ci/certs/ca.crt +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIVAJQLm8V2LcaCTHUcoIfO+KL63nG3MA0GCSqGSIb3DQEB -CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu -ZXJhdGVkIENBMB4XDTIwMDIyNjA1NTA1N1oXDTIzMDIyNTA1NTA1N1owNDEyMDAG -A1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5lcmF0ZWQgQ0Ew -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDYyajkPvGtUOE5M1OowQfB -kWVrWjo1+LIxzgCeRHp0YztLtdVJ0sk2xoSrt2uZpxcPepdyOseLTjFJex1D2yCR -AEniIqcFif4G72nDih2LlbhpUe/+/MTryj8ZTkFTzI+eMmbQi5FFMaH+kwufmdt/ -5/w8YazO18SxxJUlzMqzfNUrhM8vvvVdxgboU7PWhk28wZHCMHQovomHmzclhRpF -N0FMktA98vHHeRjH19P7rNhifSd7hZzoH3H148HVAKoPgqnZ6vW2O2YfAWOP6ulq -cyszr57p8fS9B2wSdlWW7nVHU1JuKcYD67CxbBS23BeGFgCj4tiNrmxO8S5Yf85v -AgMBAAGjUzBRMB0GA1UdDgQWBBSWAlip9eoPmnG4p4OFZeOUBlAbNDAfBgNVHSME -GDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBCwUAA4IBAQA19qqrMTWl7YyId+LR/QIHDrP4jfxmrEELrAL58q5Epc1k -XxZLzOBSXoBfBrPdv+3XklWqXrZjKWfdkux0Xmjnl4qul+srrZDLJVZG3I7IrITh -AmQUmL9MuPiMnAcxoGZp1xpijtW8Qmd2qnambbljWfkuVaa4hcVRfrAX6TciIQ21 -bS5aeLGrPqR14h30YzDp0RMmTujEa1o6ExN0+RSTkE9m89Q6WdM69az8JW7YkWqm -I+UCG3TcLd3TXmN1zNQkq4y2ObDK4Sxy/2p6yFPI1Fds5w/zLfBOvvPQY61vEqs8 -SCCcQIe7f6NDpIRIBlty1C9IaEHj7edyHjF6rtYb ------END CERTIFICATE----- diff --git a/.ci/certs/ca.pem b/.ci/certs/ca.pem deleted file mode 100644 index 71f9bfc81..000000000 --- a/.ci/certs/ca.pem +++ /dev/null @@ -1,20 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDSjCCAjKgAwIBAgIVAJQLm8V2LcaCTHUcoIfO+KL63nG3MA0GCSqGSIb3DQEB -CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu -ZXJhdGVkIENBMB4XDTIwMDIyNjA1NTA1N1oXDTIzMDIyNTA1NTA1N1owNDEyMDAG -A1UEAxMpRWxhc3RpYyBDZXJ0aWZpY2F0ZSBUb29sIEF1dG9nZW5lcmF0ZWQgQ0Ew -ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDYyajkPvGtUOE5M1OowQfB -kWVrWjo1+LIxzgCeRHp0YztLtdVJ0sk2xoSrt2uZpxcPepdyOseLTjFJex1D2yCR -AEniIqcFif4G72nDih2LlbhpUe/+/MTryj8ZTkFTzI+eMmbQi5FFMaH+kwufmdt/ -5/w8YazO18SxxJUlzMqzfNUrhM8vvvVdxgboU7PWhk28wZHCMHQovomHmzclhRpF -N0FMktA98vHHeRjH19P7rNhifSd7hZzoH3H148HVAKoPgqnZ6vW2O2YfAWOP6ulq -cyszr57p8fS9B2wSdlWW7nVHU1JuKcYD67CxbBS23BeGFgCj4tiNrmxO8S5Yf85v -AgMBAAGjUzBRMB0GA1UdDgQWBBSWAlip9eoPmnG4p4OFZeOUBlAbNDAfBgNVHSME -GDAWgBSWAlip9eoPmnG4p4OFZeOUBlAbNDAPBgNVHRMBAf8EBTADAQH/MA0GCSqG -SIb3DQEBCwUAA4IBAQA19qqrMTWl7YyId+LR/QIHDrP4jfxmrEELrAL58q5Epc1k -XxZLzOBSXoBfBrPdv+3XklWqXrZjKWfdkux0Xmjnl4qul+srrZDLJVZG3I7IrITh -AmQUmL9MuPiMnAcxoGZp1xpijtW8Qmd2qnambbljWfkuVaa4hcVRfrAX6TciIQ21 -bS5aeLGrPqR14h30YzDp0RMmTujEa1o6ExN0+RSTkE9m89Q6WdM69az8JW7YkWqm -I+UCG3TcLd3TXmN1zNQkq4y2ObDK4Sxy/2p6yFPI1Fds5w/zLfBOvvPQY61vEqs8 -SCCcQIe7f6NDpIRIBlty1C9IaEHj7edyHjF6rtYb ------END CERTIFICATE----- diff --git a/.ci/certs/testnode.crt b/.ci/certs/testnode.crt deleted file mode 100755 index 41e608fd5..000000000 --- a/.ci/certs/testnode.crt +++ /dev/null @@ -1,21 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIDYjCCAkqgAwIBAgIVAIZQH0fe5U+bGQ6m1JUBO/AQkQ/9MA0GCSqGSIb3DQEB -CwUAMDQxMjAwBgNVBAMTKUVsYXN0aWMgQ2VydGlmaWNhdGUgVG9vbCBBdXRvZ2Vu -ZXJhdGVkIENBMB4XDTIwMDMyNzE5MTcxMVoXDTIzMDMyNzE5MTcxMVowEzERMA8G -A1UEAxMIaW5zdGFuY2UwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDB -fco1t1+sE1gTwTVGcXKZqJTP2GjMHM0cfJE5KKfwC5B+pHADRT6FZxvepgKjEBDt -CK+2Rmotyeb15XXMSKguNhyT+2PuKvT5r05L7P91XRYXrwxG2swJPtct7A87xdFa -Ek+YRpqGGmTaux2jOELMiAmqEzoj6w/xFq+LF4SolTW4wOL2eLFkEFHBX2oCwU5T -Q+B+7E9zL45nFWlkeRGJ+ZQTnRNZ/1r4N9A9Gtj4x/H1/y4inWndikdxAb5QiEYJ -T+vbQWzHYWjz13ttHJsz+6T8rvA1jK+buHgVh4K8lV13X9k54soBqHB8va7/KIJP -g8gvd6vusEI7Bmfl1as7AgMBAAGjgYswgYgwHQYDVR0OBBYEFKnnpvuVYwtFSUis -WwN9OHLyExzJMB8GA1UdIwQYMBaAFJYCWKn16g+acbing4Vl45QGUBs0MDsGA1Ud -EQQ0MDKCCWxvY2FsaG9zdIIIaW5zdGFuY2WHBH8AAAGHEAAAAAAAAAAAAAAAAAAA -AAGCA2VzMTAJBgNVHRMEAjAAMA0GCSqGSIb3DQEBCwUAA4IBAQAPNsIoD4GBrTgR -jfvBuHS6eU16P95m16O8Mdpr4SMQgWLQUhs8aoVgfwpg2TkbCWxOe6khJOyNm7bf -fW4aFQ/OHcQV4Czz3c7eOHTWSyMlCOv+nRXd4giJZ5TOHw1zKGmKXOIvhvE6RfdF -uBBfrusk164H4iykm0Bbr/wo4d6wuebp3ZYLPw5zV0D08rsaR+3VJ9VxWuFpdm/r -2onYOohyuX9DRjAczasC+CRRQN4eHJlRfSQB8WfTKw3EloRJJDAg6SJyGiAJ++BF -hnqfNcEyKes2AWagFF9aTbEJMrzMhH+YB5F+S/PWvMUlFzcoocVKqc4pIrjKUNWO -6nbTxeAB ------END CERTIFICATE----- diff --git a/.ci/certs/testnode.key b/.ci/certs/testnode.key deleted file mode 100755 index 58227517f..000000000 --- a/.ci/certs/testnode.key +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAwX3KNbdfrBNYE8E1RnFymaiUz9hozBzNHHyROSin8AuQfqRw -A0U+hWcb3qYCoxAQ7QivtkZqLcnm9eV1zEioLjYck/tj7ir0+a9OS+z/dV0WF68M -RtrMCT7XLewPO8XRWhJPmEaahhpk2rsdozhCzIgJqhM6I+sP8RavixeEqJU1uMDi -9nixZBBRwV9qAsFOU0PgfuxPcy+OZxVpZHkRifmUE50TWf9a+DfQPRrY+Mfx9f8u -Ip1p3YpHcQG+UIhGCU/r20Fsx2Fo89d7bRybM/uk/K7wNYyvm7h4FYeCvJVdd1/Z -OeLKAahwfL2u/yiCT4PIL3er7rBCOwZn5dWrOwIDAQABAoIBAFcm4ICnculf4Sks -umFbUiISA81GjZV6V4zAMu1K+bGuk8vnJyjh9JJD6hK0NbXa07TgV7zDJKoxKd2S -GCgGhfIin2asMcuh/6vDIYIjYsErR3stdlsnzAVSD7v4ergSlwR6AO32xz0mAE1h -QK029yeHEstPU72/7/NIo5MD6dXAbut1MzgijZD8RQo1z21D6qmLcPTVTfkn7a3W -MY3y7XUIkA1TOyIRsH3k6F6NBWkvtXbwOUeLCJ14EvS8T9BqhIhPDZv8mQTRLDOD -tQRyC4Cnw+UhYmnMFJhj6N2jpTBv/AdoKcRC56uBJyPW+dxj6i4e7n3pQuxqRvpI -LLJJsskCgYEA4QQxzuJizLKV75rE+Qxg0Ej0Gid1aj3H5eeTZOUhm9KC8KDfPdpk -msKaNzJq/VDcqHPluGS1jYZVgZlal1nk5xKBcbQ4n297VPVd+sLtlf0bj4atlDUO -+iOVo0H7k5yWvj+TzVRlc5zjDLcnQh8i+22o3+65hIrb2zpzg/cCZJ8CgYEA3CJX -bjmWPQ0uZVIa8Wz8cJFtKT9uVl7Z3/f6HjN9I0b/9MmVlNxQVAilVwhDkzR/UawG -QeRFBJ6XWRwX0aoMq+O9VSNu/R2rtEMpIYt3LwbI3yw6GRoCdB5qeL820O+KX5Fl -/z+ZNgrHgA1yKPVf+8ke2ZtLEqPHMN+BMuq8t+UCgYEAy0MfvzQPbbuw55WWcyb0 -WZJdNzcHwKX4ajzrj4vP9VOPRtD7eINMt+QsrMnVjei6u0yeahhHTIXZvc2K4Qeq -V/YGinDzaUqqTU+synXFauUOPXO6XxQi6GC2rphPKsOcBFWoLSYc0vgYvgbA5uD7 -l8Yyc77RROKuwfWmHcJHHh8CgYBurGFSjGdJWHgr/oSHPqkIG0VLiJV7nQJjBPRd -/Lr8YnTK6BJpHf7Q0Ov3frMirjEYqakXtaExel5TMbmT8q+eN8h3pnHlleY+oclr -EQghv4J8GWs4NYhoQuZ6wH/ZuaTS+XHTS3FG51J3wcrUZtET8ICvHNE4lNjPbH8z -TysENQKBgHER1RtDFdz+O7mlWibrHk8JDgcVdZV/pBF+9cb7r/orkH9RLAHDlsAO -tuSVaQmm5eqgaAxMamBXSyw1lir07byemyuEDg0mJ1rNUGsAY8P+LWr579gvKMme -5gvrJr99JkBTV3z+TiL7dZa52eW00Ijqg2qcbHGpq3kXWWkbd8Tn ------END RSA PRIVATE KEY----- diff --git a/.ci/jobs/defaults.yml b/.ci/jobs/defaults.yml deleted file mode 100644 index 6c8292672..000000000 --- a/.ci/jobs/defaults.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- - -##### GLOBAL METADATA - -- meta: - cluster: clients-ci - -##### JOB DEFAULTS - -- job: - project-type: matrix - logrotate: - daysToKeep: 30 - numToKeep: 100 - properties: - - github: - url: https://github.com/elastic/elasticsearch-py/ - - inject: - properties-content: HOME=$JENKINS_HOME - concurrent: true - node: flyweight - scm: - - git: - name: origin - credentials-id: f6c7695a-671e-4f4f-a331-acdce44ff9ba - reference-repo: /var/lib/jenkins/.git-references/elasticsearch-py.git - branches: - - ${branch_specifier} - url: git@github.com:elastic/elasticsearch-py.git - wipe-workspace: 'True' - triggers: - - github - - timed: 'H */12 * * *' - axes: - - axis: - type: slave - name: label - values: - - linux - - axis: - type: yaml - filename: .ci/test-matrix.yml - name: STACK_VERSION - - axis: - type: yaml - filename: .ci/test-matrix.yml - name: PYTHON_VERSION - - axis: - type: yaml - filename: .ci/test-matrix.yml - name: PYTHON_CONNECTION_CLASS - - axis: - type: yaml - filename: .ci/test-matrix.yml - name: TEST_SUITE - yaml-strategy: - exclude-key: exclude - filename: .ci/test-matrix.yml - wrappers: - - ansicolor - - timeout: - type: absolute - timeout: 120 - fail: true - - timestamps - - workspace-cleanup - builders: - - shell: |- - #!/usr/local/bin/runbld - .ci/run-tests - publishers: - - email: - recipients: build-lang-clients@elastic.co - - junit: - results: "junit/*-junit.xml" - allow-empty-results: true diff --git a/.ci/jobs/elastic+elasticsearch-py+7.17.yml b/.ci/jobs/elastic+elasticsearch-py+7.17.yml deleted file mode 100644 index 6424bdb25..000000000 --- a/.ci/jobs/elastic+elasticsearch-py+7.17.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- job: - name: elastic+elasticsearch-py+7.17 - display-name: 'elastic / elasticsearch-py # 7.17' - description: Testing the elasticsearch-py 7.17 branch. - junit_results: "*-junit.xml" - parameters: - - string: - name: branch_specifier - default: refs/heads/7.17 - description: the Git branch specifier to build (<branchName>, <tagName>, - <commitId>, etc.) diff --git a/.ci/jobs/elastic+elasticsearch-py+8.3.yml b/.ci/jobs/elastic+elasticsearch-py+8.3.yml deleted file mode 100644 index 44b1b20aa..000000000 --- a/.ci/jobs/elastic+elasticsearch-py+8.3.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- job: - name: elastic+elasticsearch-py+8.5 - display-name: 'elastic / elasticsearch-py # 8.5' - description: Testing the elasticsearch-py 8.5 branch. - junit_results: "*-junit.xml" - parameters: - - string: - name: branch_specifier - default: refs/heads/8.5 - description: the Git branch specifier to build (<branchName>, <tagName>, - <commitId>, etc.) diff --git a/.ci/jobs/elastic+elasticsearch-py+8.4.yml b/.ci/jobs/elastic+elasticsearch-py+8.4.yml deleted file mode 100644 index 4b71f8e54..000000000 --- a/.ci/jobs/elastic+elasticsearch-py+8.4.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- job: - name: elastic+elasticsearch-py+8.4 - display-name: 'elastic / elasticsearch-py # 8.4' - description: Testing the elasticsearch-py 8.4 branch. - junit_results: "*-junit.xml" - parameters: - - string: - name: branch_specifier - default: refs/heads/8.4 - description: the Git branch specifier to build (<branchName>, <tagName>, - <commitId>, etc.) diff --git a/.ci/jobs/elastic+elasticsearch-py+main.yml b/.ci/jobs/elastic+elasticsearch-py+main.yml deleted file mode 100644 index 00bf73337..000000000 --- a/.ci/jobs/elastic+elasticsearch-py+main.yml +++ /dev/null @@ -1,12 +0,0 @@ ---- -- job: - name: elastic+elasticsearch-py+main - display-name: 'elastic / elasticsearch-py # main' - description: Testing the elasticsearch-py main branch. - junit_results: "*-junit.xml" - parameters: - - string: - name: branch_specifier - default: refs/heads/main - description: the Git branch specifier to build (<branchName>, <tagName>, - <commitId>, etc.) diff --git a/.ci/jobs/elastic+elasticsearch-py+pull-request.yml b/.ci/jobs/elastic+elasticsearch-py+pull-request.yml deleted file mode 100644 index 813fff243..000000000 --- a/.ci/jobs/elastic+elasticsearch-py+pull-request.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -- job: - name: elastic+elasticsearch-py+pull-request - display-name: 'elastic / elasticsearch-py # pull-request' - description: Testing of elasticsearch-py pull requests. - junit_results: "*-junit.xml" - scm: - - git: - branches: - - ${ghprbActualCommit} - refspec: +refs/pull/*:refs/remotes/origin/pr/* - triggers: - - github-pull-request: - org-list: - - elastic - allow-whitelist-orgs-as-admins: true - github-hooks: true - status-context: clients-ci - cancel-builds-on-update: true diff --git a/.ci/make.sh b/.ci/make.sh deleted file mode 100755 index b628df473..000000000 --- a/.ci/make.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env bash - -# ------------------------------------------------------- # -# -# Skeleton for common build entry script for all elastic -# clients. Needs to be adapted to individual client usage. -# -# Must be called: ./.ci/make.sh -# -# Version: 1.1.0 -# -# Targets: -# --------------------------- -# assemble : build client artefacts with version -# bump : bump client internals to version -# codegen : generate endpoints -# docsgen : generate documentation -# examplegen : generate the doc examples -# clean : clean workspace -# -# ------------------------------------------------------- # - -# ------------------------------------------------------- # -# Bootstrap -# ------------------------------------------------------- # - -script_path=$(dirname "$(realpath -s "$0")") -repo=$(realpath "$script_path/../") - -# shellcheck disable=SC1090 -CMD=$1 -TASK=$1 -TASK_ARGS=() -VERSION=$2 -STACK_VERSION=$VERSION -set -euo pipefail - -product="elastic/elasticsearch-py" -output_folder=".ci/output" -codegen_folder=".ci/output" -OUTPUT_DIR="$repo/${output_folder}" -REPO_BINDING="${OUTPUT_DIR}:/sln/${output_folder}" -WORKFLOW="${WORKFLOW-staging}" -mkdir -p "$OUTPUT_DIR" - -echo -e "\033[34;1mINFO:\033[0m PRODUCT ${product}\033[0m" -echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m" -echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m" - -# ------------------------------------------------------- # -# Parse Command -# ------------------------------------------------------- # - -case $CMD in - clean) - echo -e "\033[36;1mTARGET: clean workspace $output_folder\033[0m" - rm -rf "$output_folder" - echo -e "\033[32;1mdone.\033[0m" - exit 0 - ;; - assemble) - if [ -v $VERSION ]; then - echo -e "\033[31;1mTARGET: assemble -> missing version parameter\033[0m" - exit 1 - fi - echo -e "\033[36;1mTARGET: assemble artefact $VERSION\033[0m" - TASK=release - TASK_ARGS=("$VERSION" "$output_folder") - ;; - codegen) - VERSION=$(git rev-parse --abbrev-ref HEAD) - echo -e "\033[36;1mTARGET: codegen API $VERSION\033[0m" - TASK=codegen - # VERSION is BRANCH here for now - TASK_ARGS=("$VERSION" "$codegen_folder") - ;; - docsgen) - if [ -v $VERSION ]; then - echo -e "\033[31;1mTARGET: docsgen -> missing version parameter\033[0m" - exit 1 - fi - echo -e "\033[36;1mTARGET: generate docs for $VERSION\033[0m" - TASK=codegen - # VERSION is BRANCH here for now - TASK_ARGS=("$VERSION" "$codegen_folder") - ;; - examplesgen) - echo -e "\033[36;1mTARGET: generate examples\033[0m" - TASK=codegen - # VERSION is BRANCH here for now - TASK_ARGS=("$VERSION" "$codegen_folder") - ;; - bump) - if [ -v $VERSION ]; then - echo -e "\033[31;1mTARGET: bump -> missing version parameter\033[0m" - exit 1 - fi - echo -e "\033[36;1mTARGET: bump to version $VERSION\033[0m" - TASK=bump - # VERSION is BRANCH here for now - TASK_ARGS=("$VERSION") - ;; - *) - echo -e "\nUsage:\n\t $CMD is not supported right now\n" - exit 1 -esac - - -# ------------------------------------------------------- # -# Build Container -# ------------------------------------------------------- # - -echo -e "\033[34;1mINFO: building $product container\033[0m" - -docker build \ - --build-arg BUILDER_UID="$(id -u)" \ - --file $repo/.ci/Dockerfile \ - --tag ${product} \ - . - -# ------------------------------------------------------- # -# Run the Container -# ------------------------------------------------------- # - -echo -e "\033[34;1mINFO: running $product container\033[0m" - -if [[ "$CMD" == "assemble" ]]; then - - # Build dists into .ci/output - docker run \ - -u "$(id -u)" \ - --rm -v $repo/.ci/output:/code/elasticsearch-py/dist \ - $product \ - /bin/bash -c "python /code/elasticsearch-py/utils/build-dists.py $VERSION" - - # Verify that there are dists in .ci/output - if compgen -G ".ci/output/*" > /dev/null; then - - # Tarball everything up in .ci/output - if [[ "$WORKFLOW" == 'snapshot' ]]; then - cd $repo/.ci/output && tar -czvf elasticsearch-py-$VERSION-SNAPSHOT.tar.gz * && cd - - else - cd $repo/.ci/output && tar -czvf elasticsearch-py-$VERSION.tar.gz * && cd - - fi - - echo -e "\033[32;1mTARGET: successfully assembled client v$VERSION\033[0m" - exit 0 - else - echo -e "\033[31;1mTARGET: assemble failed, empty workspace!\033[0m" - exit 1 - fi -fi - -if [[ "$CMD" == "bump" ]]; then - docker run \ - --rm -v $repo:/code/elasticsearch-py \ - $product \ - /bin/bash -c "python /code/elasticsearch-py/utils/bump-version.py $VERSION" - - exit 0 -fi - -if [[ "$CMD" == "codegen" ]]; then - docker run \ - --rm -v $repo:/code/elasticsearch-py \ - $product \ - /bin/bash -c "cd /code && python -m pip install nox && \ - git clone https://$CLIENTS_GITHUB_TOKEN@github.com/elastic/elastic-client-generator-python.git && \ - cd /code/elastic-client-generator-python && GIT_BRANCH=$VERSION python -m nox -s generate-es && \ - cd /code/elasticsearch-py && python -m nox -s format" - - exit 0 -fi - -if [[ "$CMD" == "docsgen" ]]; then - echo "TODO" -fi - -if [[ "$CMD" == "examplesgen" ]]; then - echo "TODO" -fi - -echo "Must be called with '.ci/make.sh [command]" -exit 1 diff --git a/.ci/test-matrix.yml b/.ci/test-matrix.yml deleted file mode 100644 index 29c587cb3..000000000 --- a/.ci/test-matrix.yml +++ /dev/null @@ -1,19 +0,0 @@ -STACK_VERSION: - - "8.10.0-SNAPSHOT" - -TEST_SUITE: - - platinum - -PYTHON_VERSION: - - "3.6" - - "3.7" - - "3.8" - - "3.9" - - "3.10" - - "3.11" - -PYTHON_CONNECTION_CLASS: - - urllib3 - - requests - -exclude: ~ diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bcdc103c..b0bfe0f01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,7 +67,7 @@ jobs: python -m pip install nox - name: Run Tests shell: bash - run: .ci/run-nox.sh + run: .buildkite/run-nox.sh env: PYTHON_VERSION: ${{ matrix.python-version }} NOX_SESSION: ${{ matrix.nox-session }} diff --git a/.github/workflows/unified-release.yml b/.github/workflows/unified-release.yml deleted file mode 100644 index 149918654..000000000 --- a/.github/workflows/unified-release.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Unified Release - -on: - pull_request: - paths-ignore: - - 'README.md' - push: - paths-ignore: - - 'README.md' - branches: - - main - - '[0-9]+.[0-9]+' - - '[0-9]+.x' - -jobs: - assemble: - name: Assemble - runs-on: ubuntu-latest - env: - STACK_VERSION: "8.10-SNAPSHOT" - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: "Assemble ${{ env.STACK_VERSION }}" - run: "./.ci/make.sh assemble ${{ env.STACK_VERSION }}" diff --git a/.gitignore b/.gitignore index 96d71f0b7..94b37a3ed 100644 --- a/.gitignore +++ b/.gitignore @@ -143,5 +143,5 @@ cython_debug/ # elasticsearch files test_elasticsearch/cover test_elasticsearch/local.py -.ci/output +.buildkite/output junit/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 50e89c62b..4d83ec97c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ before writing too much code. ## Running Elasticsearch locally We've provided a script to start an Elasticsearch cluster of a certain version -found at `.ci/run-elasticsearch.sh`. +found at `.buildkite/run-elasticsearch.sh`. There are several environment variables that control integration tests: diff --git a/test_elasticsearch/test_async/test_server/conftest.py b/test_elasticsearch/test_async/test_server/conftest.py index 21ef7a38d..b9ce04c60 100644 --- a/test_elasticsearch/test_async/test_server/conftest.py +++ b/test_elasticsearch/test_async/test_server/conftest.py @@ -16,6 +16,7 @@ # under the License. import pytest +import pytest_asyncio import elasticsearch @@ -24,7 +25,7 @@ pytestmark = pytest.mark.asyncio -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") @pytest.mark.usefixtures("sync_client") async def async_client(elasticsearch_url): # 'sync_client' fixture is used for the guaranteed wipe_cluster() call. diff --git a/test_elasticsearch/test_async/test_server/test_helpers.py b/test_elasticsearch/test_async/test_server/test_helpers.py index 60f789522..037ab7166 100644 --- a/test_elasticsearch/test_async/test_server/test_helpers.py +++ b/test_elasticsearch/test_async/test_server/test_helpers.py @@ -20,6 +20,7 @@ from unittest.mock import MagicMock, call, patch import pytest +import pytest_asyncio from elastic_transport import ApiResponseMeta, ObjectApiResponse from elasticsearch import helpers @@ -350,9 +351,11 @@ async def test_errors_are_reported_correctly(self, async_client): assert "42" == error["index"]["_id"] assert "i" == error["index"]["_index"] print(error["index"]["error"]) - assert "MapperParsingException" in repr( - error["index"]["error"] - ) or "mapper_parsing_exception" in repr(error["index"]["error"]) + assert error["index"]["error"]["type"] in [ + "mapper_parsing_exception", + # Elasticsearch 8.8+: https://github.com/elastic/elasticsearch/pull/92646 + "document_parsing_exception", + ] async def test_error_is_raised(self, async_client): await async_client.indices.create( @@ -456,7 +459,7 @@ def __await__(self): return self().__await__() -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") async def scan_teardown(async_client): yield await async_client.clear_scroll(scroll_id="_all") @@ -867,7 +870,7 @@ async def test_scan_from_keyword_is_aliased(async_client, scan_kwargs): assert "from" not in search_mock.call_args[1] -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") async def reindex_setup(async_client): bulk = [] for x in range(100): @@ -945,7 +948,7 @@ async def test_all_documents_get_moved(self, async_client, reindex_setup): )["_source"] -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") async def parent_reindex_setup(async_client): body = { "settings": {"number_of_shards": 1, "number_of_replicas": 0}, @@ -1006,7 +1009,7 @@ async def test_children_are_reindexed_correctly( } == q -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") async def reindex_data_stream_setup(async_client): dt = datetime.now(tz=timezone.utc) bulk = [] diff --git a/test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py b/test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py index 337d34614..820add65c 100644 --- a/test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py +++ b/test_elasticsearch/test_async/test_server/test_mapbox_vector_tile.py @@ -16,13 +16,14 @@ # under the License. import pytest +import pytest_asyncio from elasticsearch import AsyncElasticsearch, RequestError pytestmark = pytest.mark.asyncio -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") async def mvt_setup(async_client): await async_client.indices.create( index="museums", diff --git a/test_elasticsearch/test_async/test_server/test_rest_api_spec.py b/test_elasticsearch/test_async/test_server/test_rest_api_spec.py index 5b5b8116f..fd4fd04e3 100644 --- a/test_elasticsearch/test_async/test_server/test_rest_api_spec.py +++ b/test_elasticsearch/test_async/test_server/test_rest_api_spec.py @@ -25,6 +25,7 @@ import warnings import pytest +import pytest_asyncio from elasticsearch import ElasticsearchWarning, RequestError @@ -237,7 +238,7 @@ async def _feature_enabled(self, name): return name in XPACK_FEATURES -@pytest.fixture(scope="function") +@pytest_asyncio.fixture(scope="function") def async_runner(async_client): return AsyncYamlRunner(async_client) diff --git a/test_elasticsearch/test_server/test_helpers.py b/test_elasticsearch/test_server/test_helpers.py index 8f3dd4949..0763be03c 100644 --- a/test_elasticsearch/test_server/test_helpers.py +++ b/test_elasticsearch/test_server/test_helpers.py @@ -339,9 +339,11 @@ def test_errors_are_reported_correctly(sync_client): assert "42" == error["index"]["_id"] assert "i" == error["index"]["_index"] print(error["index"]["error"]) - assert "MapperParsingException" in repr( - error["index"]["error"] - ) or "mapper_parsing_exception" in repr(error["index"]["error"]) + assert error["index"]["error"]["type"] in [ + "mapper_parsing_exception", + # Elasticsearch 8.8+: https://github.com/elastic/elasticsearch/pull/92646 + "document_parsing_exception", + ] def test_error_is_raised(sync_client): diff --git a/test_elasticsearch/utils.py b/test_elasticsearch/utils.py index a2b44afe5..f4f8cc885 100644 --- a/test_elasticsearch/utils.py +++ b/test_elasticsearch/utils.py @@ -30,7 +30,7 @@ ) SOURCE_DIR = Path(__file__).absolute().parent.parent -CA_CERTS = str(SOURCE_DIR / ".ci/certs/ca.crt") +CA_CERTS = str(SOURCE_DIR / ".buildkite/certs/ca.crt") def es_url() -> str: diff --git a/utils/bump-version.py b/utils/bump-version.py index e91d3bdcb..44e580154 100644 --- a/utils/bump-version.py +++ b/utils/bump-version.py @@ -70,9 +70,9 @@ def main(): # These values should always be the 'major.minor-SNAPSHOT' major_minor_version = ".".join(python_version.split(".")[:2]) find_and_replace( - path=SOURCE_DIR / ".ci/test-matrix.yml", - pattern=r'STACK_VERSION:\s+\- "[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"', - replace=f'STACK_VERSION:\n - "{major_minor_version}.0-SNAPSHOT"', + path=SOURCE_DIR / ".buildkite/pipeline.yml", + pattern=r'STACK_VERSION:\s+"[0-9]+[0-9\.]*[0-9](?:\-SNAPSHOT)?"', + replace=f'STACK_VERSION: "{major_minor_version}.0-SNAPSHOT"', ) find_and_replace( path=SOURCE_DIR / ".github/workflows/unified-release.yml",