Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ jobs:
echo "runner_os=${hashmap[$PLATFORM_TAG]}" >> "$GITHUB_OUTPUT"

declare -A manylinux_digest
manylinux_digest[manylinux_x86_64]="6d32fb959e76ed2b2117b28d141b3a92aed81805fe23e357a9b247ea30b88ae5"
manylinux_digest[manylinux_aarch64]="3e814781f3025a4659eefdc2aa1dca593eb1d9e0d6c6e1d1f543d17429eb5bdb"
manylinux_digest[manylinux_x86_64]="ee086a7e0d988b829bebe6404125c682190ea336ab3aad17f0c90623b28e2708"
manylinux_digest[manylinux_aarch64]="183ccef2e4047f722b179d69dde14b99e05b7234724bf00aa31657ae695743f5"
# This will not fail if map key is not found. Assuming only a blank string will be returned
echo "manylinux_image_digest=${manylinux_digest[$PLATFORM_TAG]}" >> "$GITHUB_OUTPUT"
# Bash >= 4 supports hashmaps
Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
use-sanitizer-wheel: ${{ contains(inputs.env-vars-for-building, 'SANITIZER') }}
run-tests-in-container: ${{ contains(inputs.platform-tag, 'manylinux') }}
# Only used if running tests in container
container-image-name: ${{ vars.JF_EXTERNAL_URL }}/${{ vars.JFROG_PROJECT_FOR_CLIENT_TEAM }}-docker-dev-local/manylinux_2_28_${{ endsWith(inputs.platform-tag, 'x86_64') && 'x86_64' || 'aarch64' }}@sha256:${{ needs.get-build-runner-os.outputs.manylinux-image-digest }}
container-image-name: ${{ vars.JF_EXTERNAL_URL }}/${{ vars.JFROG_REPO_FOR_CUSTOM_MANYLINUX_IMAGES }}/manylinux_2_28_${{ endsWith(inputs.platform-tag, 'x86_64') && 'x86_64' || 'aarch64' }}@sha256:${{ needs.get-build-runner-os.outputs.manylinux-image-digest }}
server-tag: ${{ inputs.server-tag }}
run-integration-tests: ${{ inputs.platform-tag != 'macosx_x86_64' || inputs.run-integration-tests-on-macos-x86 }}
test-file: ${{ inputs.test-file }}
Expand Down
10 changes: 7 additions & 3 deletions .github/workflows/test-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
- if: ${{ !inputs.run-tests-in-container }}
name: 'Bare metal: install wheel and perform extra test setup steps'
run: |
pip install "./$ARTIFACT_FILE_NAME"
python3 -m pip install "./$ARTIFACT_FILE_NAME"

if [[ ${{ inputs.run-integration-tests }} == false ]]; then
exit 0
Expand Down Expand Up @@ -226,7 +226,7 @@ jobs:
if [[ ${{ inputs.validate-keys }} == false ]]; then
crudini --existing=param --set config.conf input-validation validate_keys false
fi
pip install -r requirements.txt
python3 -m pip install -r requirements.txt

VALGRIND_ARGS=()
if [[ ${{ inputs.run-with-valgrind }} == true ]]; then
Expand Down Expand Up @@ -356,7 +356,11 @@ jobs:
docker exec --workdir "/$REPO_DIR_NAME" "$LINUX_DISTRO_CONTAINER_NAME" "python${PYTHON_VERSION}" -m $PIP_INSTALL_COMMAND "./$ARTIFACT_FILE_NAME"
# shellcheck disable=SC2086
docker exec --workdir "/$REPO_DIR_NAME/test" "$LINUX_DISTRO_CONTAINER_NAME" "python${PYTHON_VERSION}" -m $PIP_INSTALL_COMMAND -r requirements.txt
docker exec --workdir "/$REPO_DIR_NAME/test" "$LINUX_DISTRO_CONTAINER_NAME" "python${PYTHON_VERSION}" -m pytest "new_tests/$TEST_FILE"

# eval: perform variable expansion before brace expansion
read -ra test_files < <(eval echo "new_tests/$TEST_FILE")

docker exec --workdir "/$REPO_DIR_NAME/test" "$LINUX_DISTRO_CONTAINER_NAME" "python${PYTHON_VERSION}" -m pytest "${test_files[@]}"
shell: bash -ex {0}
env:
IS_DISTRO_CONTAINER_DNF_BASED: ${{ inputs.container-image-name == 'amazonlinux:2023' || contains(inputs.container-image-name, 'ubi') }}
Expand Down
9 changes: 5 additions & 4 deletions test/new_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ def wait_for_job_completion(as_connection, job_id, job_module: int = aerospike.J
while time.time() - start < time_limit_secs:
response = as_connection.job_info(job_id, job_module)
if response["status"] != aerospike.JOB_STATUS_INPROGRESS:
break
return
time.sleep(0.1)
print("time_limit_secs was hit.")

# Shared between bin projection and execute background tests

Expand Down Expand Up @@ -292,6 +293,9 @@ def insert_records(request, as_connection):
keys = [(TEST_NS, set_name, i) for i in range(num_keys)]
request.cls.keys = keys

if make_set_unique is False:
as_connection.batch_remove(keys)

batch_records = []
brs = BatchRecords(batch_records=batch_records)

Expand All @@ -308,9 +312,6 @@ def insert_records(request, as_connection):

yield

if make_set_unique is False:
as_connection.batch_remove(keys)

def expect_records_to_have_user_key_stored(client: aerospike.Client, set_name: str):
query = client.query(TEST_NS, set_name)
recs = query.results()
Expand Down
14 changes: 11 additions & 3 deletions test/new_tests/test_query_execute_background.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ def test_background_execute_return_val(self, insert_records):
res = query.execute_background()
assert isinstance(res, (int, long))

@pytest.mark.xfail(reason="This started failing when adding support for bin projection due to query.ttl not being applied")
# This makes sure that the execute background query doesn't interfere with any following tests
wait_for_job_completion(self.as_connection, res, time_limit_secs=5)

def test_background_with_ttl(self, insert_records):
"""
Ensure that ttl is set for the record found with background query
Expand Down Expand Up @@ -252,8 +254,10 @@ def test_background_execute_with_ops_and_preds(self, insert_records):

query = self.as_connection.query(TEST_NS, TEST_SET)
query.add_ops(ops)
query.execute_background()
time.sleep(3)
job_id = query.execute_background()

# This makes sure that the execute background query doesn't interfere with any following tests
wait_for_job_completion(self.as_connection, job_id, time_limit_secs=5)

validate_records(self.as_connection, keys, lambda rec: rec[test_bin] == "aerospike")

Expand Down Expand Up @@ -316,6 +320,8 @@ def test_background_execute_with_policy(self, insert_records):
res = query.execute_background({"socket_timeout": 180000})
assert isinstance(res, (int, long))

wait_for_job_completion(self.as_connection, res, time_limit_secs=5)

def test_background_execute_with_policy_kwarg(self, insert_records):
"""
Ensure that Query.execute_background() returns an int like object
Expand All @@ -326,6 +332,8 @@ def test_background_execute_with_policy_kwarg(self, insert_records):
res = query.execute_background(policy={})
assert isinstance(res, (int, long))

wait_for_job_completion(self.as_connection, res, time_limit_secs=5)

def test_background_execute_with_invalid_policy_type(self, insert_records):
"""
Ensure that Query.execute_background() returns an int like object
Expand Down
2 changes: 2 additions & 0 deletions test/new_tests/test_query_expressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def assert_each_record_bins(records, check_func):

@pytest.fixture(scope="class")
def clean_test_demo_namespace(as_connection):
as_connection.truncate("test", None, 0)

names = ["Alice", "Bob", "John", "Jane"]
for i in range(100):
key = "test", "demo", i
Expand Down
Loading