From 476aeb5d5bbd8a720f5211615ac0be74661b9dc7 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 14:48:35 -0700 Subject: [PATCH 01/16] ci: upload ci test coverage to codecov --- .github/workflows/integration_test.yml | 105 ++++++++++++++++++++++--- src/aerospike_vector_search/client.py | 2 +- tests/requirements.txt | 2 + 3 files changed, 99 insertions(+), 10 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 76d9928f..cb0a8256 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -67,9 +67,15 @@ jobs: sleep 5 docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_normal + path: tests/coverage.xml + test-tls: runs-on: ubuntu-24.04 continue-on-error: true @@ -142,10 +148,17 @@ jobs: docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_tls + path: tests/coverage.xml + + test-tls-auth: runs-on: ubuntu-24.04 continue-on-error: true @@ -213,10 +226,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child + python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_tls_auth + path: tests/coverage.xml + test-tls-auth-rbac: runs-on: ubuntu-24.04 @@ -290,12 +309,18 @@ jobs: docker ps - python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child + python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=coverage.xml docker logs aerospike-vector-search docker logs aerospike working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_tls_auth_rbac + path: tests/coverage.xml + test-mtls: runs-on: ubuntu-24.04 @@ -363,12 +388,18 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_mtls + path: tests/coverage.xml + test-mtls-auth: runs-on: ubuntu-24.04 @@ -436,12 +467,18 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_mtls_auth_rbac + path: tests/coverage.xml + test-mtls-auth-rbac: runs-on: ubuntu-24.04 @@ -510,9 +547,15 @@ jobs: sleep 5 - python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs + python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_mtls_auth_rbac + path: tests/coverage.xml + test-is-loadbalancer: runs-on: ubuntu-24.04 continue-on-error: true @@ -576,9 +619,15 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_is_load_balancer + path: tests/coverage.xml + test-exhaustive-vector-search: runs-on: ubuntu-24.04 continue-on-error: true @@ -642,9 +691,47 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search -vs + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search -vs --cov=aerospike_vector_search --cov-report=coverage.xml working-directory: tests + - name: Upload test coverage + uses: actions/upload-artifact@v4 + with: + name: coverage_exhaustive_vector_search + path: tests/coverage.xml + + upload-to-codecov: + needs: [test-normal, test-tls, test-tls-auth, test-tls-auth-rbac, test-mtls, test-mtls-auth, test-mtls-auth-rbac, test-is-loadbalancer, test-exhaustive-vector-search] + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + + - name: Install coverage + run: pip install coverage + + - name: Download coverage reports + uses: actions/download-artifact@v4 + with: + pattern: coverage_* + + - name: Combine coverage reports + run: | + coverage combine coverage_* + coverage xml + + - name: Upload to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + files: ./coverage.xml + token: ${{ secrets.CODECOV_TOKEN }} + # # test-timeout-on-sandbox: # runs-on: ubuntu-24.04 diff --git a/src/aerospike_vector_search/client.py b/src/aerospike_vector_search/client.py index e1726ecc..a62a3d1d 100644 --- a/src/aerospike_vector_search/client.py +++ b/src/aerospike_vector_search/client.py @@ -14,7 +14,7 @@ class Client(BaseClient): """ - Aerospike Vector Search Vector Client + Aerospike Vector Search Client This client specializes in performing database operations with vector data. Moreover, the client supports Hierarchical Navigable Small World (HNSW) vector searches, diff --git a/tests/requirements.txt b/tests/requirements.txt index c8defcde..b1395a71 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -3,4 +3,6 @@ pytest==7.4.0 pytest-aio==1.5.0 pyjwt hypothesis +coverage +pytest-cov .. \ No newline at end of file From 97de214d5e7c1c13190e831c4147e0565adbf032 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 14:53:29 -0700 Subject: [PATCH 02/16] correctly specify xml format for pytest coverage file --- .github/workflows/integration_test.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index cb0a8256..3da474ee 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -67,7 +67,7 @@ jobs: sleep 5 docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search --cov-report=xml working-directory: tests - name: Upload test coverage @@ -148,7 +148,7 @@ jobs: docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search --cov-report=xml working-directory: tests @@ -226,7 +226,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=xml working-directory: tests @@ -309,7 +309,7 @@ jobs: docker ps - python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=xml docker logs aerospike-vector-search docker logs aerospike @@ -388,7 +388,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml @@ -467,7 +467,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml @@ -547,7 +547,7 @@ jobs: sleep 5 - python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml working-directory: tests - name: Upload test coverage @@ -619,7 +619,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search --cov-report=xml working-directory: tests - name: Upload test coverage @@ -691,7 +691,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search -vs --cov=aerospike_vector_search --cov-report=coverage.xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search -vs --cov=aerospike_vector_search --cov-report=xml working-directory: tests - name: Upload test coverage From bc3ee1ad51486456c5484391e6151536e097afc7 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 14:58:57 -0700 Subject: [PATCH 03/16] remove duplicate coverage file name --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 3da474ee..26dfed6a 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -476,7 +476,7 @@ jobs: - name: Upload test coverage uses: actions/upload-artifact@v4 with: - name: coverage_mtls_auth_rbac + name: coverage_mtls_auth path: tests/coverage.xml From 51e15e1a7069c77ea3fd7fb8caf22856f34e8902 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 15:25:28 -0700 Subject: [PATCH 04/16] only run coverage upload steps once --- .github/workflows/integration_test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 26dfed6a..22beb82a 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -71,6 +71,7 @@ jobs: working-directory: tests - name: Upload test coverage + if: ${{ matrix.python-version == '3.12' }} uses: actions/upload-artifact@v4 with: name: coverage_normal @@ -408,7 +409,7 @@ jobs: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.12"] steps: @@ -487,7 +488,7 @@ jobs: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.12"] steps: From f0c13d77e32eaeac816ed51a90e3097b09072f26 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 16:43:10 -0700 Subject: [PATCH 05/16] change downloaded coverage files dir --- .github/workflows/integration_test.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 22beb82a..26711a5d 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -720,17 +720,22 @@ jobs: uses: actions/download-artifact@v4 with: pattern: coverage_* + path: coverage_files + + - name: List files + run: ls -R coverage_files - name: Combine coverage reports run: | - coverage combine coverage_* + coverage combine coverage* coverage xml + working-directory: coverage_files - name: Upload to Codecov uses: codecov/codecov-action@v4 with: fail_ci_if_error: true - files: ./coverage.xml + files: ./coverage_files/coverage.xml token: ${{ secrets.CODECOV_TOKEN }} # From 05401c67c82c83b7d709afefd8e5d2800bcbba27 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 17:22:01 -0700 Subject: [PATCH 06/16] adjust coverage file glob pattern --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 26711a5d..cd8c203c 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -727,7 +727,7 @@ jobs: - name: Combine coverage reports run: | - coverage combine coverage* + coverage combine **coverage.xml coverage xml working-directory: coverage_files From d289dc506f30b8fecda3f23de396463a27c017f2 Mon Sep 17 00:00:00 2001 From: dylan Date: Wed, 18 Sep 2024 19:00:15 -0700 Subject: [PATCH 07/16] use find instead of globs to get coverage files --- .github/workflows/integration_test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index cd8c203c..cfaff5bd 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -719,7 +719,6 @@ jobs: - name: Download coverage reports uses: actions/download-artifact@v4 with: - pattern: coverage_* path: coverage_files - name: List files @@ -727,7 +726,7 @@ jobs: - name: Combine coverage reports run: | - coverage combine **coverage.xml + coverage combine $(find . -name "coverage.xml") coverage xml working-directory: coverage_files From e9ce9d76a10dab14f4d8f3523f920fdb77a3664b Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 19 Sep 2024 09:44:21 -0700 Subject: [PATCH 08/16] debug with tmate --- .github/workflows/integration_test.yml | 64 ++++++++++++++++---------- 1 file changed, 39 insertions(+), 25 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index cfaff5bd..6e4c972e 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -67,7 +67,9 @@ jobs: sleep 5 docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search --cov-report=xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search + + mv .coverage coverage_data working-directory: tests - name: Upload test coverage @@ -75,7 +77,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: coverage_normal - path: tests/coverage.xml + path: tests/coverage_data test-tls: runs-on: ubuntu-24.04 @@ -149,15 +151,16 @@ jobs: docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search --cov-report=xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_tls - path: tests/coverage.xml + path: tests/coverage_data test-tls-auth: @@ -227,15 +230,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=xml + python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_tls_auth - path: tests/coverage.xml + path: tests/coverage_data test-tls-auth-rbac: @@ -310,17 +314,19 @@ jobs: docker ps - python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child --cov=aerospike_vector_search --cov-report=xml + python -m pytest rbac -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child --cov=aerospike_vector_search docker logs aerospike-vector-search docker logs aerospike + + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_tls_auth_rbac - path: tests/coverage.xml + path: tests/coverage_data test-mtls: @@ -389,17 +395,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml - - + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_mtls - path: tests/coverage.xml + path: tests/coverage_data test-mtls-auth: @@ -468,17 +473,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml - - + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_mtls_auth - path: tests/coverage.xml + path: tests/coverage_data test-mtls-auth-rbac: @@ -548,14 +552,16 @@ jobs: sleep 5 - python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search --cov-report=xml + python -m pytest rbac -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search + + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_mtls_auth_rbac - path: tests/coverage.xml + path: tests/coverage_data test-is-loadbalancer: runs-on: ubuntu-24.04 @@ -620,14 +626,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search --cov-report=xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search + + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_is_load_balancer - path: tests/coverage.xml + path: tests/coverage_data test-exhaustive-vector-search: runs-on: ubuntu-24.04 @@ -692,14 +700,16 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search -vs --cov=aerospike_vector_search --cov-report=xml + python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search --cov=aerospike_vector_search -vs + + mv .coverage coverage_data working-directory: tests - name: Upload test coverage uses: actions/upload-artifact@v4 with: name: coverage_exhaustive_vector_search - path: tests/coverage.xml + path: tests/coverage_data upload-to-codecov: needs: [test-normal, test-tls, test-tls-auth, test-tls-auth-rbac, test-mtls, test-mtls-auth, test-mtls-auth-rbac, test-is-loadbalancer, test-exhaustive-vector-search] @@ -726,17 +736,21 @@ jobs: - name: Combine coverage reports run: | - coverage combine $(find . -name "coverage.xml") + coverage combine ./coverage_files/* coverage xml - working-directory: coverage_files - name: Upload to Codecov uses: codecov/codecov-action@v4 with: fail_ci_if_error: true - files: ./coverage_files/coverage.xml + files: ./coverage.xml token: ${{ secrets.CODECOV_TOKEN }} + - uses: actions/checkout@v4 + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 + # # test-timeout-on-sandbox: # runs-on: ubuntu-24.04 From 01eedf3debab0108b5b1a380811501ef022d1a6b Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 19 Sep 2024 10:54:07 -0700 Subject: [PATCH 09/16] build and install client on coverage merge job --- .github/workflows/integration_test.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 6e4c972e..674c42f6 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -723,8 +723,8 @@ jobs: with: python-version: '3.x' - - name: Install coverage - run: pip install coverage + - name: Install dependencies + run: pip install coverage build - name: Download coverage reports uses: actions/download-artifact@v4 @@ -737,7 +737,14 @@ jobs: - name: Combine coverage reports run: | coverage combine ./coverage_files/* - coverage xml + + # this is needed because the coverage files expect the source code + # to be installed in a certain location. TODO use relative files and source instead + # https://coverage.readthedocs.io/en/latest/config.html#config-run-relative-files + - name: Build and install aerospike-vector-search + run: | + python -m build + pip install dist/aerospike_vector_search-2.0.0-py3-none-any.whl - name: Upload to Codecov uses: codecov/codecov-action@v4 @@ -746,11 +753,6 @@ jobs: files: ./coverage.xml token: ${{ secrets.CODECOV_TOKEN }} - - uses: actions/checkout@v4 - - name: Setup tmate session - if: ${{ failure() }} - uses: mxschmitt/action-tmate@v3 - # # test-timeout-on-sandbox: # runs-on: ubuntu-24.04 From 4c9cfba96df641e93a85c72b3cad373dc05157c1 Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 19 Sep 2024 12:48:53 -0700 Subject: [PATCH 10/16] use find to get coverage files to merge --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 674c42f6..35255444 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -736,7 +736,7 @@ jobs: - name: Combine coverage reports run: | - coverage combine ./coverage_files/* + coverage combine $(find coverage-reports -name "coverage_data") # this is needed because the coverage files expect the source code # to be installed in a certain location. TODO use relative files and source instead From d191bb10b587132bf579406c0ebabba60945cbd8 Mon Sep 17 00:00:00 2001 From: dylan Date: Thu, 19 Sep 2024 13:53:29 -0700 Subject: [PATCH 11/16] change coverage directory --- .github/workflows/integration_test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 35255444..4c212504 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -736,7 +736,7 @@ jobs: - name: Combine coverage reports run: | - coverage combine $(find coverage-reports -name "coverage_data") + coverage combine $(find coverage_files -name "coverage_data") # this is needed because the coverage files expect the source code # to be installed in a certain location. TODO use relative files and source instead From 881045f6f661ab2c4cc36c36944d4cf4053fc002 Mon Sep 17 00:00:00 2001 From: Dominic Pelini Date: Tue, 24 Sep 2024 09:53:27 -0600 Subject: [PATCH 12/16] Changed "Vector Client" string to simply "Client" --- src/aerospike_vector_search/aio/client.py | 8 ++++---- src/aerospike_vector_search/client.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/aerospike_vector_search/aio/client.py b/src/aerospike_vector_search/aio/client.py index b8771dc2..9f4e77ab 100644 --- a/src/aerospike_vector_search/aio/client.py +++ b/src/aerospike_vector_search/aio/client.py @@ -604,7 +604,7 @@ async def wait_for_index_completion( async def close(self): """ - Close the Aerospike Vector Search Vector Client. + Close the Aerospike Vector Search Client. This method closes gRPC channels connected to Aerospike Vector Search. @@ -615,15 +615,15 @@ async def close(self): async def __aenter__(self): """ - Enter an asynchronous context manager for the vector client. + Enter an asynchronous context manager for the client. Returns: - VectorDbClient: Aerospike Vector Search Vector Client instance. + VectorDbClient: Aerospike Vector Search Client instance. """ return self async def __aexit__(self, exc_type, exc_val, exc_tb): """ - Exit an asynchronous context manager for the vector client. + Exit an asynchronous context manager for the client. """ await self.close() diff --git a/src/aerospike_vector_search/client.py b/src/aerospike_vector_search/client.py index a62a3d1d..f13e98a9 100644 --- a/src/aerospike_vector_search/client.py +++ b/src/aerospike_vector_search/client.py @@ -579,7 +579,7 @@ def wait_for_index_completion( def close(self): """ - Close the Aerospike Vector Search Vector Client. + Close the Aerospike Vector Search Client. This method closes gRPC channels connected to Aerospike Vector Search. @@ -590,15 +590,15 @@ def close(self): def __enter__(self): """ - Enter a context manager for the vector client. + Enter a context manager for the client. Returns: - VectorDbClient: Aerospike Vector Search Vector Client instance. + VectorDbClient: Aerospike Vector Search Client instance. """ return self def __exit__(self, exc_type, exc_val, exc_tb): """ - Exit a context manager for the vector client. + Exit a context manager for the client. """ self.close() From 634a3a0e98d9fbebb35e14350fbeac71246020a9 Mon Sep 17 00:00:00 2001 From: Dominic Pelini Date: Tue, 24 Sep 2024 11:38:25 -0600 Subject: [PATCH 13/16] Added sync testing to code coverage --- .github/workflows/integration_test.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/integration_test.yml b/.github/workflows/integration_test.yml index 4c212504..b11c0b6b 100644 --- a/.github/workflows/integration_test.yml +++ b/.github/workflows/integration_test.yml @@ -67,7 +67,7 @@ jobs: sleep 5 docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search + python -m pytest standard -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -151,7 +151,7 @@ jobs: docker ps - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search + python -m pytest standard -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --ssl_target_name_override child -vs --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -230,7 +230,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search + python -m pytest standard -s -vv --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --username admin --password admin --ssl_target_name_override child --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -395,7 +395,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search + python -m pytest standard -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --ssl_target_name_override brawn -vs --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -473,7 +473,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search + python -m pytest standard -s --host 0.0.0.0 --port 5000 --root_certificate tls/root.crt --private_key tls/brawn.key.pem --certificate_chain tls/brawn.crt --username admin --password admin --ssl_target_name_override brawn -vs --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -626,7 +626,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search + python -m pytest standard -s --host 0.0.0.0 --port 5000 --is_loadbalancer -vs --cov=aerospike_vector_search mv .coverage coverage_data working-directory: tests @@ -700,7 +700,7 @@ jobs: sleep 5 - python -m pytest standard/aio -s --host 0.0.0.0 --port 5000 --extensive_vector_search --cov=aerospike_vector_search -vs + python -m pytest standard -s --host 0.0.0.0 --port 5000 --extensive_vector_search --cov=aerospike_vector_search -vs mv .coverage coverage_data working-directory: tests @@ -787,5 +787,5 @@ jobs: # - name: Run unit tests # run: | # -# python -m pytest standard/aio -s --host 34.42.225.207 --port 5000 --with_latency +# python -m pytest standard -s --host 34.42.225.207 --port 5000 --with_latency # working-directory: tests \ No newline at end of file From 62b83b9c519fd6dd3b67b8527f762f7e8ddda8e3 Mon Sep 17 00:00:00 2001 From: Dominic Pelini Date: Tue, 24 Sep 2024 12:28:05 -0600 Subject: [PATCH 14/16] Removed await from async tests --- tests/standard/sync/test_admin_client_index_get.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/standard/sync/test_admin_client_index_get.py b/tests/standard/sync/test_admin_client_index_get.py index 9ee8c73e..da89bcab 100644 --- a/tests/standard/sync/test_admin_client_index_get.py +++ b/tests/standard/sync/test_admin_client_index_get.py @@ -63,14 +63,14 @@ def test_index_get(session_admin_client, empty_test_case, random_name): #@given(random_name=index_strategy()) #@settings(max_examples=1, deadline=1000) async def test_index_get_no_defaults(session_admin_client, empty_test_case, random_name): - await session_admin_client.index_create( + session_admin_client.index_create( namespace="test", name=random_name, vector_field="science", dimensions=1024, ) - result = await session_admin_client.index_get(namespace="test", name=random_name, apply_defaults=False) + result = session_admin_client.index_get(namespace="test", name=random_name, apply_defaults=False) # AVS server still returns values for these fields even if apply_defaults is False # this might change in the future if it is fixed in the server @@ -104,7 +104,7 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["hnsw_params"]["merge_params"]["index_parallelism"] == 0 assert result["hnsw_params"]["merge_params"]["reindex_parallelism"] == 0 - await drop_specified_index(session_admin_client, "test", random_name) + drop_specified_index(session_admin_client, "test", random_name) @pytest.mark.parametrize("empty_test_case", [None]) From f27c7f956da7f6c98faa1994c6dd91078f5b59fa Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 24 Sep 2024 11:50:31 -0700 Subject: [PATCH 15/16] update index_get_no_defaults with expected AVS 0.10.0 default response --- .../aio/test_admin_client_index_get.py | 19 ++++++++----------- .../sync/test_admin_client_index_get.py | 2 -- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/tests/standard/aio/test_admin_client_index_get.py b/tests/standard/aio/test_admin_client_index_get.py index 3f7b3e5e..97839582 100644 --- a/tests/standard/aio/test_admin_client_index_get.py +++ b/tests/standard/aio/test_admin_client_index_get.py @@ -67,22 +67,23 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand result = await session_admin_client.index_get(namespace="test", name=random_name, apply_defaults=False) - # AVS server still returns values for these fields even if apply_defaults is False - # this might change in the future if it is fixed in the server assert result["id"]["name"] == random_name assert result["id"]["namespace"] == "test" assert result["dimensions"] == 1024 assert result["field"] == "science" + assert result["hnsw_params"]["m"] == 16 + assert result["hnsw_params"]["ef_construction"] == 100 + assert result["hnsw_params"]["ef"] == 100 + assert result["hnsw_params"]["batching_params"]["max_records"] == 100000 + assert result["hnsw_params"]["batching_params"]["interval"] == 30000 + assert result["storage"]["namespace"] == "test" + assert result["storage"].set_name == random_name + assert result["storage"]["set_name"] == random_name # Defaults assert result["sets"] == "" assert result["vector_distance_metric"] == 0 - assert result["hnsw_params"]["m"] == 0 - assert result["hnsw_params"]["ef"] == 0 - assert result["hnsw_params"]["ef_construction"] == 0 - assert result["hnsw_params"]["batching_params"]["max_records"] == 0 - assert result["hnsw_params"]["batching_params"]["interval"] == 0 assert result["hnsw_params"]["max_mem_queue_size"] == 0 assert result["hnsw_params"]["caching_params"]["max_entries"] == 0 assert result["hnsw_params"]["caching_params"]["expiry"] == 0 @@ -96,10 +97,6 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["hnsw_params"]["merge_params"]["index_parallelism"] == 0 assert result["hnsw_params"]["merge_params"]["reindex_parallelism"] == 0 - assert result["storage"]["namespace"] == "" - assert result["storage"].set_name == "" - assert result["storage"]["set_name"] == "" - await drop_specified_index(session_admin_client, "test", random_name) diff --git a/tests/standard/sync/test_admin_client_index_get.py b/tests/standard/sync/test_admin_client_index_get.py index da89bcab..53e12916 100644 --- a/tests/standard/sync/test_admin_client_index_get.py +++ b/tests/standard/sync/test_admin_client_index_get.py @@ -72,8 +72,6 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand result = session_admin_client.index_get(namespace="test", name=random_name, apply_defaults=False) - # AVS server still returns values for these fields even if apply_defaults is False - # this might change in the future if it is fixed in the server assert result["id"]["name"] == random_name assert result["id"]["namespace"] == "test" assert result["dimensions"] == 1024 From 648c47e56d4622ce1c73a404166b121620a152b2 Mon Sep 17 00:00:00 2001 From: dylan Date: Tue, 24 Sep 2024 13:33:05 -0700 Subject: [PATCH 16/16] use fet_index_no_defaults from master --- .../standard/aio/test_admin_client_index_get.py | 17 +++++++++-------- .../sync/test_admin_client_index_get.py | 17 +++++++++-------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/tests/standard/aio/test_admin_client_index_get.py b/tests/standard/aio/test_admin_client_index_get.py index 97839582..c49e17e5 100644 --- a/tests/standard/aio/test_admin_client_index_get.py +++ b/tests/standard/aio/test_admin_client_index_get.py @@ -71,19 +71,16 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["id"]["namespace"] == "test" assert result["dimensions"] == 1024 assert result["field"] == "science" - assert result["hnsw_params"]["m"] == 16 - assert result["hnsw_params"]["ef_construction"] == 100 - assert result["hnsw_params"]["ef"] == 100 - assert result["hnsw_params"]["batching_params"]["max_records"] == 100000 - assert result["hnsw_params"]["batching_params"]["interval"] == 30000 - assert result["storage"]["namespace"] == "test" - assert result["storage"].set_name == random_name - assert result["storage"]["set_name"] == random_name # Defaults assert result["sets"] == "" assert result["vector_distance_metric"] == 0 + assert result["hnsw_params"]["m"] == 0 + assert result["hnsw_params"]["ef"] == 0 + assert result["hnsw_params"]["ef_construction"] == 0 + assert result["hnsw_params"]["batching_params"]["max_records"] == 0 + assert result["hnsw_params"]["batching_params"]["interval"] == 0 assert result["hnsw_params"]["max_mem_queue_size"] == 0 assert result["hnsw_params"]["caching_params"]["max_entries"] == 0 assert result["hnsw_params"]["caching_params"]["expiry"] == 0 @@ -97,6 +94,10 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["hnsw_params"]["merge_params"]["index_parallelism"] == 0 assert result["hnsw_params"]["merge_params"]["reindex_parallelism"] == 0 + assert result["storage"]["namespace"] == "" + assert result["storage"].set_name == "" + assert result["storage"]["set_name"] == "" + await drop_specified_index(session_admin_client, "test", random_name) diff --git a/tests/standard/sync/test_admin_client_index_get.py b/tests/standard/sync/test_admin_client_index_get.py index 53e12916..830b08fd 100644 --- a/tests/standard/sync/test_admin_client_index_get.py +++ b/tests/standard/sync/test_admin_client_index_get.py @@ -76,19 +76,16 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["id"]["namespace"] == "test" assert result["dimensions"] == 1024 assert result["field"] == "science" - assert result["hnsw_params"]["m"] == 16 - assert result["hnsw_params"]["ef_construction"] == 100 - assert result["hnsw_params"]["ef"] == 100 - assert result["hnsw_params"]["batching_params"]["max_records"] == 100000 - assert result["hnsw_params"]["batching_params"]["interval"] == 30000 - assert result["storage"]["namespace"] == "test" - assert result["storage"].set_name == random_name - assert result["storage"]["set_name"] == random_name # Defaults assert result["sets"] == "" assert result["vector_distance_metric"] == 0 + assert result["hnsw_params"]["m"] == 0 + assert result["hnsw_params"]["ef"] == 0 + assert result["hnsw_params"]["ef_construction"] == 0 + assert result["hnsw_params"]["batching_params"]["max_records"] == 0 + assert result["hnsw_params"]["batching_params"]["interval"] == 0 assert result["hnsw_params"]["max_mem_queue_size"] == 0 assert result["hnsw_params"]["caching_params"]["max_entries"] == 0 assert result["hnsw_params"]["caching_params"]["expiry"] == 0 @@ -102,6 +99,10 @@ async def test_index_get_no_defaults(session_admin_client, empty_test_case, rand assert result["hnsw_params"]["merge_params"]["index_parallelism"] == 0 assert result["hnsw_params"]["merge_params"]["reindex_parallelism"] == 0 + assert result["storage"]["namespace"] == "" + assert result["storage"].set_name == "" + assert result["storage"]["set_name"] == "" + drop_specified_index(session_admin_client, "test", random_name)