Skip to content

Commit

Permalink
Update pygeppetto tests and add github action testing it
Browse files Browse the repository at this point in the history
  • Loading branch information
aranega committed Nov 29, 2024
1 parent 12e850a commit e731948
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 8 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pygeppetto-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Python package

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.8", "pypy-3.9", "pypy-3.10", "graalpy-24.0"]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
14 changes: 6 additions & 8 deletions pygeppetto/tests/test_xmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,18 @@ def filepath(filename):
return os.path.join(HERE, 'xmi-data', filename)




def test_read_mediumXMI(rset):
resource = rset.get_resource(URI(filepath('MediumNet.net.nml.xmi')))
root = resource.contents[0]
assert root # The root exists

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_read_BigXMI(rset):
resource = rset.get_resource(URI(filepath('BigCA1.net.nml.xmi')))
root = resource.contents[0]
assert root # The root exists

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_read_LargeXMI(rset):
resource = rset.get_resource(URI(filepath('LargeConns.net.nml.xmi')))
root = resource.contents[0]
Expand All @@ -41,14 +39,14 @@ def test_readwrite_mediumXMI(tmpdir, rset):
f = tmpdir.mkdir('pyecore-tmp').join('medium.xmi')
resource.save(output=URI(str(f)))

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_readwrite_BigXMI(tmpdir, rset):
resource = rset.get_resource(URI(filepath('BigCA1.net.nml.xmi')))
root = resource.contents[0]
f = tmpdir.mkdir('pyecore-tmp').join('big.xmi')
resource.save(output=URI(str(f)))

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_readwrite_LargeXMI(tmpdir, rset):
resource = rset.get_resource(URI(filepath('LargeConns.net.nml.xmi')))
root = resource.contents[0]
Expand All @@ -73,7 +71,7 @@ def test_roundtrip_mediumXMI(tmpdir, rset):
assert root
assert root.name == 'mediumTestModel'

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_roundtrip_BigXMI(tmpdir, rset):
resource = rset.get_resource(URI(filepath('BigCA1.net.nml.xmi')))
root = resource.contents[0]
Expand All @@ -91,7 +89,7 @@ def test_roundtrip_BigXMI(tmpdir, rset):
assert root
assert root.name == 'bigTestModel'

@pytest.mark.skip('Too slow')
# @pytest.mark.skip('Too slow')
def test_roundtrip_LargeXMI(tmpdir, rset):
resource = rset.get_resource(URI(filepath('LargeConns.net.nml.xmi')))
root = resource.contents[0]
Expand Down

0 comments on commit e731948

Please sign in to comment.