Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ jobs:
working-directory: test/standalone

# This is an e2e test to check that the user agent was sent correctly to the server
test-user-agent:
test-standalone:
needs: [
build,
get-env-vars
Expand All @@ -395,9 +395,10 @@ jobs:
fail-fast: false
matrix:
test-script-args:
- "false"
- "true"
- "true my_app_id"
- "./test-user-agent-e2e.bash false"
- "./test-user-agent-e2e.bash true"
- "./test-user-agent-e2e.bash true my_app_id"
- "python3 ./test_deserialize_as_bytes_python.py"
runs-on: ${{ needs.build.outputs.runner-os-used-for-build }}
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -413,22 +414,30 @@ jobs:
- uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
pattern: ${{ vars.GH_ARTIFACT_NAME_PREFIX_FOR_BUILDS }}-${{ env.LOWEST_SUPPORTED_PY_VERSION }}-${{ env.PLATFORM_TAG }}
- run: python3 -m pip install ./*.whl

- id: setup-aerospike-server
uses: aerospike/shared-workflows/.github/actions/setup-aerospike-server@bd168dedaa4fc0b17a560541779d815540eded2d # v3.7.0
with:
enable-security: ${{ startsWith(matrix.test-script-args, 'true') }}
enable-security: ${{ startsWith(matrix.test-script-args, './test-user-agent-e2e.bash true') }}
num-nodes: 1
oidc-provider: ${{ vars.OIDC_PROVIDER_NAME }}
oidc-audience: ${{ vars.OIDC_AUDIENCE }}
features-content: ${{ secrets.FEATURES_CONTENT }}
server-tag: ${{ needs.get-env-vars.outputs.server-tag }}
server-container-repo: database-docker-virtual/aerospike-server${{ startsWith(matrix.test-script-args, 'true') && '-enterprise' || '' }}
server-container-repo: database-docker-virtual/aerospike-server${{ startsWith(matrix.test-script-args, './test-user-agent-e2e.bash true') && '-enterprise' || '' }}

- if: ${{ contains(matrix.test-script-args, 'deserialize_as_bytes_python') }}
name: Install Python client that supports inserting AS_BYTES_PYTHON
run: |
python3 -m pip install aerospike==12.*
python3 ./insert_as_bytes_python.py
working-directory: test/standalone

- run: python3 -m pip install ./*.whl

# Even for server versions < 8.1 that don't support user agent, this client version should still work on older servers
- name: Run client in background
run: ./test-user-agent-e2e.bash ${{ matrix.test-script-args }}
run: ${{ matrix.test-script-args }}
working-directory: test/standalone

- if: ${{ !cancelled() }}
Expand Down
1 change: 1 addition & 0 deletions src/main/serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ extern as_status deserialize_based_on_as_bytes_type(AerospikeClient *self,
}
*retval = py_val;
as_error_update(error_p, AEROSPIKE_OK, NULL);
break;
case AS_BYTES_BLOB: {
if (self->user_deserializer_call_info.callback) {
execute_user_callback(&self->user_deserializer_call_info, &bytes,
Expand Down
15 changes: 15 additions & 0 deletions test/standalone/insert_as_bytes_python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import aerospike

config = {
"hosts": [
("127.0.0.1", 3000)
],
"send_bool_as": aerospike.PY_BYTES
}
client = aerospike.client(config)

bins = {"a": True}
key = ("test", "demo", 1)
client.put(key, bins=bins)

client.close()
15 changes: 15 additions & 0 deletions test/standalone/test_deserialize_as_bytes_python.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import aerospike

config = {
"hosts": [
("127.0.0.1", 3000)
],
}
client = aerospike.client(config)

key = ("test", "demo", 1)
_, _, bins = client.get(key)
print(bins["a"])
assert isinstance(bins["a"], bytearray)

client.close()
Loading