Repository: ClearcodeHQ/pytest-elasticsearch (language: python)

Issue:
Support for elasticsearch > 8.3 ?
I would like to use pytest-elasticsearch to test code for elasticsearch 8.3 and I see that there's a MR open for it but the pipelines are failing.

Any idea when this will work?

If nobody is actively maintaining it anymore, could you give some pointers on how to fix it? 


Discussion / hints:
@joao-mil I do maintain it, kind of. The code in PR  #384 works/worked at the time when being run on local machine. However I wasn't able to run it on github-actions. Elasticsearch 8 and above requires an increased amount of RAM to run, and somehow I wasn't able to properly limit it's RAM usage and run on github-actions, at least I think that's the root cause.

If you'd be able to look at this PR, and if you have time to tinker and fix whatever is wrong with CI, I'd gladly accept your help.
Thanks a lot! I will try to take a look at it in the coming weeks.

Fix patch:
diff --git a/Pipfile b/Pipfile
index 7fc4569b..0890d547 100644
--- a/Pipfile
+++ b/Pipfile
@@ -7,7 +7,7 @@ name = "pypi"
 pytest = "==7.3.2"
 port-for = "==0.7.0"
 mirakuru = "==2.5.1"
-elasticsearch = "==8.6"
+elasticsearch = "==8.9"
 
 [dev-packages]
 towncrier = "==23.6.0"
diff --git a/Pipfile.lock b/Pipfile.lock
index 0f0d3103..3d154620 100644
--- a/Pipfile.lock
+++ b/Pipfile.lock
@@ -1,7 +1,7 @@
 {
     "_meta": {
         "hash": {
-            "sha256": "c7b2c19017aee3ebe5aa0f84bb9a9dbfa5af8497469a1ae9a8633d0a1a88d4f8"
+            "sha256": "0f8f050791574c8d09cd68c395845e9c9eefe3336527719cf7ccf8f122f99e19"
         },
         "pipfile-spec": 6,
         "requires": {},
@@ -32,11 +32,11 @@
         },
         "elasticsearch": {
             "hashes": [
-                "sha256:70f6da78878c5df28cd4a4b902a57192a86b0306e69bc08177a14dac9759db59",
-                "sha256:9d2c1010bda4699c202be82cb960aee3fb9359ca98bb83dfa7db06679212e9a7"
+                "sha256:0795cbf0f61482070741c09ba02ac8fdf18f5984912fbd08b248fadd8a8c9952",
+                "sha256:d3367fc013e04fc7aad349a6de9fad1ee04fb6d627b0e7896aa505c12fde5e04"
             ],
             "index": "pypi",
-            "version": "==8.6"
+            "version": "==8.9"
         },
         "iniconfig": {
             "hashes": [
diff --git a/newsfragments/384.feature.rst b/newsfragments/384.feature.rst
index 11f058b2..572e675b 100644
--- a/newsfragments/384.feature.rst
+++ b/newsfragments/384.feature.rst
@@ -1,1 +1,1 @@
-Support elasticsearch up to 8.6
\ No newline at end of file
+Support elasticsearch up to 8.9
\ No newline at end of file
diff --git a/newsfragments/384.misc.rst b/newsfragments/384.misc.rst
new file mode 100644
index 00000000..f018ace5
--- /dev/null
+++ b/newsfragments/384.misc.rst
@@ -0,0 +1,1 @@
+Dropped Elasticsearch older than 7.17 from CI.
\ No newline at end of file


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index cdd79779..e8ae22ab 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -7,7 +7,7 @@ on:
     branches: [ main ]
 
 jobs:
-  tests_8_6:
+  tests_8_9:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -22,9 +22,9 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.6"
-  tests_8_5:
-    needs: [tests_8_6]
+          elasticsearch: "8.9"
+  tests_8_8:
+    needs: [tests_8_9]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -39,9 +39,9 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.5"
-  tests_8_4:
-    needs: [tests_8_5]
+          elasticsearch: "8.8"
+  tests_8_7:
+    needs: [tests_8_8]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -56,9 +56,9 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.4"
-  tests_8_3:
-    needs: [tests_8_4]
+          elasticsearch: "8.6"
+  tests_8_6:
+    needs: [tests_8_7]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -73,26 +73,9 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.3"
-  tests_8_2:
-    needs: [tests_8_4]
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: true
-      matrix:
-        python-version: ["3.11"]
-    env:
-      OS: ubuntu-latest
-      PYTHON: ${{ matrix.python-version }}
-      ES_JAVA_OPTS: "-Xms256m -Xmx512m"
-    steps:
-      - uses: actions/checkout@v3
-      - uses: ./.github/actions/pytest
-        with:
-          python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.2"
-  tests_8_1:
-    needs: [tests_8_4]
+          elasticsearch: "8.6"
+  tests_8_5:
+    needs: [tests_8_7]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -107,9 +90,9 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.1"
-  tests_8_0:
-    needs: [tests_8_4]
+          elasticsearch: "8.5"
+  tests_8_4:
+    needs: [tests_8_7]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
@@ -124,61 +107,47 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "8.0"
-  tests_7_17:
-    runs-on: ubuntu-latest
-    strategy:
-      fail-fast: true
-      matrix:
-        python-version: [3.7, 3.8, 3.9, "3.10", "3.11", pypy-3.8]
-    env:
-      OS: ubuntu-latest
-      PYTHON: ${{ matrix.python-version }}
-    steps:
-      - uses: actions/checkout@v3
-      - uses: ./.github/actions/pytest
-        with:
-          python-version: ${{ matrix.python-version }}
-          elasticsearch: "7.17"
-  tests_7_16:
-    needs: [tests_7_17]
+          elasticsearch: "8.4"
+  tests_8_3:
+    needs: [tests_8_7]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
       matrix:
-        python-version: ["3.11"]
+        python-version: ["3.10", "3.11"]
     env:
       OS: ubuntu-latest
       PYTHON: ${{ matrix.python-version }}
+      ES_JAVA_OPTS: "-Xms256m -Xmx512m"
     steps:
       - uses: actions/checkout@v3
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "7.16"
-  tests_7_15:
-    needs: [tests_7_17]
+          elasticsearch: "8.3"
+  tests_8_0:
+    needs: [tests_8_7]
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
       matrix:
-        python-version: ["3.11"]
+        python-version: ["3.10", "3.11"]
     env:
       OS: ubuntu-latest
       PYTHON: ${{ matrix.python-version }}
+      ES_JAVA_OPTS: "-Xms256m -Xmx512m"
     steps:
       - uses: actions/checkout@v3
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "7.15"
-  tests_7_14:
-    needs: [tests_7_17]
+          elasticsearch: "8.0"
+  tests_7_17:
     runs-on: ubuntu-latest
     strategy:
       fail-fast: true
       matrix:
-        python-version: ["3.11"]
+        python-version: [3.8, 3.9, "3.10", "3.11"]
     env:
       OS: ubuntu-latest
       PYTHON: ${{ matrix.python-version }}
@@ -187,4 +156,4 @@ jobs:
       - uses: ./.github/actions/pytest
         with:
           python-version: ${{ matrix.python-version }}
-          elasticsearch: "7.14"
+          elasticsearch: "7.17"