Skip to content

Commit

Permalink
Merge pull request hpyproject#256 from steve-s/ss/add-github-actions-…
Browse files Browse the repository at this point in the history
…cpython-debug-build-job

CI job that runs main tests on CPython debug build
  • Loading branch information
steve-s authored Nov 4, 2021
2 parents 4ea9c99 + 531dc16 commit a9cf3ad
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 1 deletion.
31 changes: 31 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,37 @@ jobs:
python -m pip install pytest pytest-xdist
python -m pytest -n auto test/
main_tests_debug:
name: Main tests on CPython debug builds
runs-on: ${{ matrix.os }}
continue-on-error: true
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.9', '3.8', '3.7']

steps:
- uses: actions/checkout@v2

- name: Set up Python from deadsnakes
uses: deadsnakes/[email protected]
with:
python-version: ${{ matrix.python-version }}
debug: true

- name: Check Python debug build
run: python -c "import sys; print(hasattr(sys, 'gettotalrefcount'))"

- name: Install/Upgrade Python dependencies
run: python -m pip install --upgrade pip wheel

- name: Build
run: python -m pip install .

- name: Run tests
run: |
python -m pip install pytest pytest-xdist
python -m pytest -n auto test/
poc_tests:
name: Proof of concept tests
Expand Down
17 changes: 16 additions & 1 deletion test/test_hpyfield.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ def test_gc_track(self):
if not self.supports_refcounts():
import pytest
pytest.skip("CPython only")
import sys
if hasattr(sys, 'gettotalrefcount'):
import pytest
pytest.skip("Test fails on debug build: https://github.com/hpyproject/hpy/issues/255")
# Test that we correctly call PyObject_GC_Track on CPython. The
# easiest way is to check whether the object is in
# gc.get_objects().
Expand Down Expand Up @@ -132,6 +136,10 @@ def test_gc_track_no_gc_flag(self):
assert not gc.is_tracked(p)

def test_tp_traverse(self):
import sys
if hasattr(sys, 'gettotalrefcount'):
import pytest
pytest.skip("Test fails on debug build: https://github.com/hpyproject/hpy/issues/255")
import gc
mod = self.make_module("""
@DEFINE_PairObject
Expand Down Expand Up @@ -239,6 +247,10 @@ def test_store_overwrite(self):
assert sys.getrefcount(a) == a_refcnt

def test_automatic_tp_dealloc(self):
import sys
if hasattr(sys, 'gettotalrefcount'):
import pytest
pytest.skip("Test fails on debug build: https://github.com/hpyproject/hpy/issues/255")
if not self.supports_refcounts():
import pytest
pytest.skip("CPython only")
Expand All @@ -265,8 +277,11 @@ def test_automatic_tp_clear(self):
if not self.supports_refcounts():
import pytest
pytest.skip("CPython only")

import sys
if hasattr(sys, 'gettotalrefcount'):
import pytest
pytest.skip("Test fails on debug build: https://github.com/hpyproject/hpy/issues/255")

import gc
mod = self.make_module("""
@DEFINE_PairObject
Expand Down

0 comments on commit a9cf3ad

Please sign in to comment.