Skip to content

[CLIENT-2221] Skip MemorySize() test due to QE tests #1 and #2 failing #1499

[CLIENT-2221] Skip MemorySize() test due to QE tests #1 and #2 failing

[CLIENT-2221] Skip MemorySize() test due to QE tests #1 and #2 failing #1499

Workflow file for this run

name: PR pre-merge tests
# Trigger test workflow whenever:
# 1. A pull request is updated (e.g with new commits)
# 2. Commits are pushed directly to the stage or master branch
on:
push:
branches: ["stage", "master"]
pull_request:
branches: ["stage"]
types: [
# Default triggers
opened,
synchronize,
reopened,
# Additional triggers
labeled,
unlabeled
]
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- uses: pre-commit/[email protected]
build:
runs-on: ubuntu-latest
strategy:
matrix:
py-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
architecture: 'x64'
- run: sudo apt update
- name: Install build dependencies (apt packages)
run: sudo apt install python3-dev libssl-dev -y
- name: Install build dependencies (pip packages)
run: python3 -m pip install build
- name: Build client
run: python3 -m build
- name: Send wheel to test jobs
uses: actions/upload-artifact@v3
with:
name: wheel-${{ matrix.py-version }}
path: ./dist/*.whl
test-coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: "3.9"
architecture: 'x64'
- name: Build client
# Use old build command to generate object .o files in build/temp*/src/main directory
# They will also contain .gcno files there
# and .gcda files will be generated there after running the tests
# The build frontend doesn't generate these .o files (may be wrong?)
run: COVERAGE=1 python3 setup.py build
- name: Install client
# Install in user directory to prevent permission errors
run: python3 setup.py install --user
- run: pip install -r requirements.txt
working-directory: test
- name: Run Aerospike server
uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
- run: sleep 5
- run: python3 -m pytest --cov=aerospike_helpers --cov-report xml:coverage.xml ./new_tests
working-directory: test
- name: Copy over source files to build dir
if: ${{ always() }}
# The build/temp*/src/main directory will contain a hierarchy of object .o files
# But the source files must be stored in the same folder hierarchy at build/temp*/src/main/src/main
run: |
cd build/temp*/src/main
mkdir -p src/main/
mkdir -p cdt_types/src/main/cdt_types
mkdir -p client/src/main/client
mkdir -p geospatial/src/main/geospatial
mkdir -p global_hosts/src/main/global_hosts
mkdir -p key_ordered_dict/src/main/key_ordered_dict
mkdir -p nullobject/src/main/nullobject
mkdir -p query/src/main/query
mkdir -p scan/src/main/scan
cd ../../../../
cp src/main/*.c build/temp*/src/main/src/main
cp src/main/cdt_types/*.c build/temp*/src/main/cdt_types/src/main/cdt_types/
cp src/main/client/*.c build/temp*/src/main/client/src/main/client/
cp src/main/geospatial/*.c build/temp*/src/main/geospatial/src/main/geospatial/
cp src/main/global_hosts/*.c build/temp*/src/main/global_hosts/src/main/global_hosts/
cp src/main/key_ordered_dict/*.c build/temp*/src/main/key_ordered_dict/src/main/key_ordered_dict/
cp src/main/nullobject/*.c build/temp*/src/main/nullobject/src/main/nullobject/
cp src/main/query/*.c build/temp*/src/main/query/src/main/query/
cp src/main/scan/*.c build/temp*/src/main/scan/src/main/scan/
- name: Generate coverage report for all object files
if: ${{ always() }}
run: |
cd build/temp*/src/main
find . -type f -name "*.o" -execdir gcov {} \;
- name: Move aerospike_helpers coverage report to this directory
run: mv test/coverage.xml build/temp*/src/main
- name: Get exact folder to find coverage reports
if: ${{ always() }}
# Can't pass in glob pattern to codecov action (I think?)
run: |
obj_dir=$(ls -d build/temp*/src/main/)
echo "OBJ_DIR=$obj_dir" >> $GITHUB_ENV
- uses: codecov/codecov-action@v3
if: ${{ always() }}
with:
directory: ${{ env.OBJ_DIR }}
verbose: true # optional (default = false)
fail_ci_if_error: true
stubtest:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: wheel-3.7
- name: Install client
run: pip install *.whl
- run: pip install mypy
- run: stubtest aerospike --allowlist stubtest-allowlist
# Run this when testing new server features on server release candidate
# to make sure the tests don't regress on the last server release.
test-ce-latest-release:
runs-on: ubuntu-latest
if: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: '3.7'
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: wheel-3.7
- 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: Wait for database to be ready
# Should be ready after 3 seconds
run: sleep 3
- name: Run tests
run: python -m pytest ./new_tests
working-directory: test
test-ce:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
py-version: [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11"
]
fail-fast: false
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: ${{ matrix.py-version }}
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: wheel-${{ matrix.py-version }}
- name: Install client
run: pip install *.whl
- name: Install test dependencies
run: pip install -r test/requirements.txt
- name: Run Aerospike server release candidate with latest tag
if: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike.jfrog.io/docker/aerospike/aerospike-server-rc:latest
- name: Run Aerospike server
if: ${{ !contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
run: docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server
- name: Wait for database to be ready
# Should be ready after 3 seconds
run: sleep 3
- name: Run tests
run: python -m pytest ./new_tests -vv
working-directory: test
test-lowest-supported-server:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: "3.7"
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: wheel-3.7
- name: Install client
run: pip install *.whl
- name: Install test dependencies
run: pip install -r test/requirements.txt
- name: Run lowest supported server
run: |
SERVER_VERSION=$(curl -s "https://registry.hub.docker.com/v2/repositories/aerospike/aerospike-server/tags?page_size=100" | jq '.results[] | select(.name | startswith("6.0")).name' -r | head -n 1)
docker run -d --name aerospike -p 3000-3002:3000-3002 aerospike/aerospike-server:$SERVER_VERSION
- name: Wait for database to be ready
# Should be ready after 3 seconds
run: sleep 3
- name: Run tests
run: python -m pytest ./new_tests
working-directory: test
test-ee:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: 3.7
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: wheel-3.7
- name: Install client
run: pip install *.whl
- name: Install test dependencies
run: pip install -r test/requirements.txt
- uses: ./.github/actions/run-ee-server
with:
use-server-rc: ${{ contains(github.event.pull_request.labels.*.name, 'new-server-features') }}
- name: Wait for server to start
run: sleep 5
- name: Run tests
run: python -m pytest ./new_tests/test_admin_*.py
working-directory: test
- name: Show logs if failed
if: ${{ failure() }}
run: |
docker container logs aerospike
cat ./configs/aerospike.conf
spellcheck-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install dependencies for checking spelling in docs
# TODO: find way to split up dependencies
run: python -m pip install -r doc/requirements.txt
- name: Check spelling
run: sphinx-build -b spelling . spelling -W --keep-going
working-directory: doc
check-links-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Install documentation dependencies
run: python -m pip install -r doc/requirements.txt
- name: Check spelling
run: sphinx-build -b linkcheck . links
working-directory: doc