Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add Runner for Integration Tests for the SOM language #264

Add Runner for Integration Tests for the SOM language

Add Runner for Integration Tests for the SOM language #264

Workflow file for this run

name: Tests
on: [push, pull_request]
jobs:
python-style:
name: Python Checks
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install Black, PyLint and PyTest
run: |
python -m pip install --upgrade pip
pip install black pylint pytest
- name: Run Black Check
run: |
black ./IntegrationTests --check --diff
- name: Run PyLint
run: |
pylint ./IntegrationTests
- name: Run PyTest
run: |
pytest -m tester ./IntegrationTests
test_soms:
runs-on: ubuntu-24.04 # ubuntu-latest
continue-on-error: ${{ matrix.not-up-to-date }}
strategy:
fail-fast: false # we want all jobs to run, because they may fail independently
matrix:
include:
- name: SOM++
repo: SOMpp.git
apt: libcppunit-dev
build: "cmake . && make SOM++"
som: "./SOM++"
not-up-to-date: false
# - name: CSOM
# repo: CSOM.git
# build: |
# export COMPILER=gcc
# export ARCH=64bit
# make
# som: "./som.sh"
# not-up-to-date: true
- name: JsSOM
repo: JsSOM.git
build: ""
som: "./som.sh"
not-up-to-date: false
- name: PySOM
repo: PySOM.git
som: "PYTHON=python SOM_INTERP=BC ./som.sh"
not-up-to-date: false
- name: SOM (Java)
build: make
som: ./som.sh
repo: som-java.git
not-up-to-date: false
- name: TruffleSOM
repo: TruffleSOM.git
build: |
export JAVA_HOME=$JAVA_HOME_17_X64
./som --setup mx
export PATH=$PATH:`pwd`/../mx
./som --setup labsjdk
mx sforceimport
rm libs/jvmci || true
./som --setup labsjdk
mx build
som: "JAVA_HOME=$JAVA_HOME_17_X64 ./som -G"
not-up-to-date: false
- name: Specification Tests
som: spec
not-up-to-date: false
- name: SOM-RS
repo: som-rs.git
build: "cargo build --release -p som-interpreter-bc"
som: "./target/release/som-interpreter-bc"
som-tests: " -c ../Smalltalk ../TestSuite -- TestHarness"
not-up-to-date: false
# - name: ykSOM
# repo: yksom.git
# build: "cargo build"
# som: "cargo run -- "
# som-tests: "--cp ../Smalltalk ../TestSuite/TestHarness.som"
# not-up-to-date: true
name: ${{ matrix.name }}
steps:
- name: Checkout SOM Repository
uses: actions/checkout@v4
- name: Checkout SOM VM Repository
if: matrix.som != 'spec'
run: |
set +e # Disable early abort in Bash
export BRANCH_NAME=${GITHUB_REF##*/}
export GITHUB_USER=${{ github.actor }}
export PR_TARGET_USER=${{ github.repository_owner }}
export REPO=${{ matrix.repo }}
GIT_CMDS=(
"git clone --branch $BRANCH_NAME --depth 1 https://github.com/$GITHUB_USER/$REPO som-vm"
)
if [ ! -z "${{ github.head_ref }}" ]
then
GIT_CMDS+=(
"git clone --branch ${{ github.head_ref }} --depth 1 https://github.com/$GITHUB_USER/$REPO som-vm"
)
fi
GIT_CMDS+=(
"git clone --depth 1 https://github.com/$GITHUB_USER/$REPO som-vm"
"git clone --depth 1 https://github.com/$PR_TARGET_USER/$REPO som-vm"
)
for ((i = 0; i < ${#GIT_CMDS[@]}; i++))
do
echo ""
echo ""
echo "Attempting: ${GIT_CMDS[$i]}"
echo ""
eval "${GIT_CMDS[$i]}"
if [ $? -eq 0 ]
then
echo ""
echo "Clone succeeded"
break
fi
done
if [ ! -d som-vm ]; then
echo "All clone attempts failed, falling back to SOM-st"
git clone --depth 1 https://github.com/SOM-st/$REPO som-vm
fi
- name: Install Apt Packages
if: ${{ matrix.apt != '' }}
run: |
sudo apt-get install ${{ matrix.apt }}
- name: Test Specification
if: ${{ matrix.som == 'spec' }}
run: |
cd specification
make test
- name: Check Whether Basic Interpreter Tests are Up to Date
if: ${{ matrix.som == 'spec' }}
run: |
./TestSuite/BasicInterpreterTests/number-of-tests.sh
- name: Build SOM VM
if: ${{ matrix.som != 'spec' }}
run: |
export ST_DIR=`pwd`/Smalltalk
cd som-vm
git --no-pager log -n 1
echo Build ${{ matrix.repo }}
${{ matrix.build }}
- name: Run Tests on SOM VM
if: ${{ matrix.som != 'spec' }}
run: |
cd som-vm
if [ "${{ matrix.som-tests }}" == "" ]
then
# The default settings for running the test harness, supported by most SOM VMs
export SOM_TESTS="-cp ../Smalltalk ../TestSuite/TestHarness.som"
else
export SOM_TESTS="${{ matrix.som-tests }}"
fi
echo "${{ matrix.som }} $SOM_TESTS"
eval "${{ matrix.som }} $SOM_TESTS"
- name: Run Integration Tests
if: ${{ matrix.som != 'spec' }}
run: |
python -m pip install --upgrade pip
pip install pytest
export VM="som-vm/${{ matrix.som }}"
export CLASSPATH=Smalltalk
export TEST_EXPECTATIONS=som-vm/integration-tests.yml
export AWFY=Examples/AreWeFastYet/Core
pytest IntegrationTests
# We currently test SomSom only on TruffleSOM
- name: Test SomSom on TruffleSOM
if: ${{ matrix.repo == 'TruffleSOM.git' }}
run: |
cd som-vm
${{ matrix.som }} -cp ../Smalltalk:../TestSuite:../SomSom/src/compiler:../SomSom/src/interpreter:../SomSom/src/primitives:../SomSom/src/vm:../SomSom/src/vmobjects ../SomSom/tests/SomSomTests.som
- name: Test Unit Test Benchmark
if: ${{ matrix.repo == 'som-java.git' }}
run: |
cd Examples/Benchmarks/TestSuite
./duplicate-tests.sh
cd ../../../som-vm
${{ matrix.som }} -cp ../Smalltalk:../TestSuite ../Examples/Benchmarks/TestSuite/TestTestSuite.som
${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite ../Examples/Benchmarks/BenchmarkHarness.som --gc TestGC100 1 1
${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite ../Examples/Benchmarks/BenchmarkHarness.som Test100 1 1
- name: Test All Benchmark
if: ${{ matrix.som != 'spec' }}
run: |
cd som-vm
${{ matrix.som }} -cp ../Smalltalk:../Examples/Benchmarks/TestSuite:../Examples/Benchmarks/Richards:../Examples/Benchmarks/DeltaBlue:../Examples/Benchmarks/NBody:../Examples/Benchmarks/Json:../Examples/Benchmarks/GraphSearch:../Examples/Benchmarks/LanguageFeatures ../Examples/Benchmarks/BenchmarkHarness.som All 1 1