refactor: propogate index and record fixtures through async tests #390
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Run Unit Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
push: | |
branches: | |
- main | |
jobs: | |
test-normal: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.9", "3.10", "3.11", "3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: create config | |
run: | | |
assets/call_gen.sh | |
cat aerospike-vector-search.yml | |
cat aerospike.conf | |
working-directory: tests | |
- name: Run unit tests | |
run: | | |
docker run -d --network=host -p 5000:5000 --name aerospike-vector-search -v ./aerospike-vector-search.yml:/etc/aerospike-vector-search/aerospike-vector-search.yml -v ./features.conf:/etc/aerospike-vector-search/features.conf aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
docker ps | |
python -m pytest standard -s --host 0.0.0.0 --port 5000 --cov=aerospike_vector_search | |
mv .coverage coverage_data | |
working-directory: tests | |
- name: Upload test coverage | |
if: ${{ matrix.python-version == '3.12' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_normal | |
path: tests/coverage_data | |
test-tls: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_tls.sh | |
cat aerospike-vector-search.yml | |
cat aerospike.conf | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 child" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
docker ps | |
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 | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_tls | |
path: tests/coverage_data | |
test-tls-auth: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_tls_auth.sh | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 child" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
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 | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_tls_auth | |
path: tests/coverage_data | |
test-tls-auth-rbac: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_tls_auth.sh | |
cat aerospike-vector-search.yml | |
cat aerospike.conf | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 child" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
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 | |
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_data | |
test-mtls: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_mtls.sh | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 brawn" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
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 | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_mtls | |
path: tests/coverage_data | |
test-mtls-auth: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_mtls_auth.sh | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 brawn" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
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 | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_mtls_auth | |
path: tests/coverage_data | |
test-mtls-auth-rbac: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen_mtls_auth.sh | |
cat /etc/hosts | |
working-directory: tests | |
- name: Add hosts to /etc/hosts | |
run: | | |
sudo echo "0.0.0.0 brawn" | sudo tee -a /etc/hosts | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
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 | |
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_data | |
test-is-loadbalancer: | |
runs-on: ubuntu-24.04 | |
continue-on-error: true | |
strategy: | |
matrix: | |
python-version: ["3.12"] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python setup.py | |
pip install -r requirements.txt | |
working-directory: tests | |
- name: Retrieve the secret and decode it to a file | |
env: | |
FEATURE_FILE: ${{ secrets.FEATURE_FILE }} | |
run: | | |
echo $FEATURE_FILE | base64 --decode > features.conf | |
working-directory: tests | |
- name: Docker Login | |
uses: docker/login-action@v2 | |
with: | |
registry: aerospike.jfrog.io | |
username: ${{ secrets.JFROG_USERNAME }} | |
password: ${{ secrets.JFROG_PASSWORD }} | |
- name: Set up RANDFILE environment variable | |
run: echo "RANDFILE=$HOME/.rnd" >> $GITHUB_ENV | |
- name: Create .rnd file if it doesn't exist | |
run: touch $HOME/.rnd | |
- name: create config | |
run: | | |
assets/call_gen.sh | |
cat /etc/hosts | |
working-directory: tests | |
- name: Run unit tests | |
run: | | |
docker run -d --name aerospike-vector-search --network=host -p 5000:5000 -v $(pwd):/etc/aerospike-vector-search aerospike/aerospike-vector-search:1.0.0 | |
docker run -d --name aerospike -p 3000:3000 -v .:/etc/aerospike aerospike/aerospike-server-enterprise:latest | |
sleep 5 | |
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 | |
- name: Upload test coverage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage_is_load_balancer | |
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] | |
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 dependencies | |
run: pip install coverage build | |
- name: Download coverage reports | |
uses: actions/download-artifact@v4 | |
with: | |
path: coverage_files | |
- name: List files | |
run: ls -R coverage_files | |
- name: Combine coverage reports | |
run: | | |
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 | |
# 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-3.1.0-py3-none-any.whl | |
- 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 | |
# continue-on-error: true | |
# | |
# | |
# strategy: | |
# matrix: | |
# python-version: ["3.12"] | |
# | |
# | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v3 | |
# | |
# - name: Set up Python | |
# uses: actions/setup-python@v2 | |
# with: | |
# python-version: ${{ matrix.python-version }} | |
# | |
# | |
# - name: Install dependencies | |
# run: | | |
# python -m pip install --upgrade pip | |
# python setup.py | |
# pip install -r requirements.txt | |
# | |
# working-directory: tests | |
# | |
# | |
# | |
# - name: Run unit tests | |
# run: | | |
# | |
# python -m pytest standard -s --host 34.42.225.207 --port 5000 --with_latency | |
# working-directory: tests |