Add running of integration tests and fix some issues (#67) #374
This file contains hidden or 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: Tests | |
| on: [push, pull_request] | |
| jobs: | |
| test_som: | |
| runs-on: ubuntu-24.04 # ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: AST Interpreter PyPy2 | |
| id: ast | |
| interp: AST | |
| python-version: pypy2.7 | |
| - name: Bytecode Interpreter PyPy2 | |
| id: bc | |
| interp: BC | |
| python-version: pypy2.7 | |
| - name: Basics PyPy 2.7 | |
| python-version: pypy2.7 | |
| id: basic | |
| - name: Basics Python 3.13 | |
| python-version: 3.13 | |
| id: basic | |
| python-type: cpython | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up PyPy | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Download PyPy Sources | |
| if: matrix.id != 'basic' | |
| run: | | |
| export PYPYVER=v7.3.18 | |
| curl https://downloads.python.org/pypy/pypy2.7-${PYPYVER}-src.tar.bz2 -o pypy.tar.bz2 | |
| tar -xjf pypy.tar.bz2 | |
| mv pypy2.7-${PYPYVER}-src .pypy | |
| - name: Install PyTest | |
| run: | | |
| pip install pytest | |
| - name: Tests | |
| if: matrix.id == 'basic' | |
| run: | | |
| export PYTHON=python | |
| export PYTHONPATH=src | |
| SOM_INTERP=AST pytest tests | |
| SOM_INTERP=BC pytest tests | |
| SOM_INTERP=AST ./som.sh -cp Smalltalk TestSuite/TestHarness.som | |
| SOM_INTERP=BC ./som.sh -cp Smalltalk TestSuite/TestHarness.som | |
| echo "[system exit: 0] value" | SOM_INTERP=AST ./som.sh -cp Smalltalk | |
| echo "[system exit: 0] value" | SOM_INTERP=BC ./som.sh -cp Smalltalk | |
| - name: Full Tests | |
| if: matrix.id != 'basic' | |
| run: | | |
| export SOM_INTERP=${{ matrix.interp }} | |
| PYTHONPATH=$PYTHONPATH:.pypy:src pytest tests | |
| PYTHONPATH=$PYTHONPATH:.pypy ./som.sh -cp Smalltalk TestSuite/TestHarness.som | |
| PYTHONPATH=$PYTHONPATH:.pypy .pypy/rpython/bin/rpython --batch src/main_rpython.py | |
| ./som-${{ matrix.id }}-interp -cp Smalltalk TestSuite/TestHarness.som | |
| - name: Integration Tests | |
| if: matrix.python-type == 'cpython' | |
| run: | | |
| pip install pyyaml | |
| export VM=./som.sh | |
| export CLASSPATH=Smalltalk | |
| export TEST_EXPECTATIONS=./integration-tests.yml | |
| export AWFY=Examples/AreWeFastYet/Core | |
| export PYTHON=python | |
| SOM_INTERP=AST pytest core-lib/IntegrationTests | |
| SOM_INTERP=BC pytest core-lib/IntegrationTests | |
| - name: SomSom Tests | |
| if: matrix.id != 'basic' | |
| run: | | |
| ./som-${{ matrix.id }}-interp -cp core-lib/Smalltalk:core-lib/TestSuite:core-lib/SomSom/src/compiler:core-lib/SomSom/src/vm:core-lib/SomSom/src/vmobjects:core-lib/SomSom/src/interpreter:core-lib/SomSom/src/primitives \ | |
| core-lib/SomSom/tests/SomSomTests.som | |
| - name: Install and Run Black | |
| run: | | |
| pip install black | |
| black --check --diff src tests | |
| if: matrix.python-type == 'cpython' | |
| - name: Install and Run PyLint | |
| run: | | |
| pip install pylint | |
| pylint --init-hook="import sys; sys.setrecursionlimit(2000)" src tests | |
| if: matrix.python-type == 'cpython' | |
| concurrency: | |
| group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}" | |
| cancel-in-progress: ${{ github.event_name == 'pull_request' }} |