Skip to content

Commit

Permalink
Revert "Remove memray test; I never use it"
Browse files Browse the repository at this point in the history
This reverts commit be634be.
  • Loading branch information
juliannguyen4 committed Sep 4, 2024
1 parent be634be commit 320d06a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,49 @@ 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
2 changes: 2 additions & 0 deletions test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pytest==7.4.0
# To generate coverage reports in the Github Actions pipeline
pytest-cov==4.1.0
# Memory profiling
pytest-memray==1.5.0

0 comments on commit 320d06a

Please sign in to comment.