Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into DEVOPS-234-remote-build
Browse files Browse the repository at this point in the history
  • Loading branch information
juliannguyen4 committed Sep 16, 2024
2 parents 87a90a5 + bcd9f46 commit 0a0f0fa
Show file tree
Hide file tree
Showing 11 changed files with 527 additions and 618 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,49 +75,6 @@ jobs:
name: wheel-${{ matrix.py-version }}
path: ./dist/*.whl

test-memray:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/setup-python@v2
with:
python-version: "3.8"
architecture: 'x64'

- uses: actions/download-artifact@v3
with:
name: wheel-3.8

- name: Install client
run: pip install *.whl

- name: Install test dependencies
run: pip install -r test/requirements.txt

- name: Run Aerospike server
run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server

- name: Create config.conf
run: cp config.conf.template config.conf
working-directory: test

- uses: ./.github/actions/wait-for-as-server-to-start
with:
container-name: aerospike

- name: Get number of tests
run: echo "NUM_TESTS=$(python3 -m pytest new_tests/ --collect-only -q | tail -n 1 | awk '{print $1;}')" >> $GITHUB_ENV
working-directory: test

- name: Run tests
# Get number of tests since setting to 0 doesn't work properly
# pytest-memray currently throws a ZeroDivision error due to having a bug
# We ignore this for now
run: python -m pytest ./new_tests --memray --memray-bin-path=./ --most-allocations=${{ env.NUM_TESTS }} || true
working-directory: test

generate-coverage-report:
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 19 additions & 1 deletion .github/workflows/valgrind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ on:
description: 'Use server release candidate?'
required: true
default: false
massif:
type: boolean
description: 'Use massif for testing memory usage'
required: false
default: false

jobs:
build-manylinux-wheel:
Expand All @@ -23,6 +28,8 @@ jobs:
secrets: inherit

valgrind:
env:
MASSIF_REPORT_FILE_NAME: massif.out
needs: build-manylinux-wheel
runs-on: ubuntu-22.04
steps:
Expand Down Expand Up @@ -55,5 +62,16 @@ jobs:

- run: sudo apt update
- run: sudo apt install valgrind -y
- run: PYTHONMALLOC=malloc valgrind --leak-check=full --error-exitcode=1 python3 -m pytest -v new_tests/${{ github.event.inputs.test-file }}

- run: echo VALGRIND_ARGS="--tool=massif --massif-out-file=./${{ env.MASSIF_REPORT_FILE_NAME }}" >> $GITHUB_ENV
if: ${{ inputs.massif }}

- run: echo VALGRIND_ARGS="--leak-check=full" >> $GITHUB_ENV
if: ${{ !inputs.massif }}

- run: PYTHONMALLOC=malloc valgrind --error-exitcode=1 ${{ env.VALGRIND_ARGS }} python3 -m pytest -v new_tests/${{ github.event.inputs.test-file }}
working-directory: test

- run: ms_print ./${{ env.MASSIF_REPORT_FILE_NAME }}
if: ${{ !cancelled() && inputs.massif }}
working-directory: test
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
15.0.1rc5.dev1
15.0.1rc5.dev5
22 changes: 12 additions & 10 deletions doc/exception.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,14 @@ Server Errors

Subclass of :py:exc:`~aerospike.exception.ServerError`.

.. py:exception:: QueryAbortedError
Query was aborted.

Error code: ``210``

Subclass of :py:exc:`~aerospike.exception.ServerError`.

Record Errors
-------------

Expand Down Expand Up @@ -397,14 +405,6 @@ Record Errors

Subclass of :py:exc:`~aerospike.exception.RecordError`.

.. py:exception:: QueryAbortedError
Query was aborted.

Error code: ``210``

Subclass of :py:exc:`~aerospike.exception.ClientError`.

Index Errors
------------

Expand Down Expand Up @@ -487,7 +487,7 @@ Query Errors

Error code: ``213``

Subclass of :py:exc:`~aerospike.exception.AerospikeError`.
Subclass of :py:exc:`~aerospike.exception.ServerError`.

Cluster Errors
--------------
Expand All @@ -507,7 +507,7 @@ Cluster Errors

Error code: ``11``

Subclass of :py:exc:`~aerospike.exception.AerospikeError`.
Subclass of :py:exc:`~aerospike.exception.ServerError`.

Admin Errors
------------
Expand All @@ -516,6 +516,8 @@ Admin Errors
The parent class for exceptions of the security API.

Subclass of :py:exc:`~aerospike.exception.ServerError`.

.. py:exception:: SecurityNotSupported
Security functionality not supported by connected server.
Expand Down
4 changes: 4 additions & 0 deletions src/main/aerospike.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ PyMODINIT_FUNC PyInit_aerospike(void)
py_global_hosts = PyDict_New();

PyObject *exception = AerospikeException_New();
if (exception == NULL) {
return NULL;
}

Py_INCREF(exception);
int retval = PyModule_AddObject(aerospike, "exception", exception);
if (retval == -1) {
Expand Down
Loading

0 comments on commit 0a0f0fa

Please sign in to comment.