Skip to content

[tests] added tests for socket connections #407

[tests] added tests for socket connections

[tests] added tests for socket connections #407

Workflow file for this run

name: Automated testing
on: push
env:
FORCE_COLOR: 1
MYPY_FORCE_COLOR: 1
GEOCOMPY_TEST_PORT_CLIENT: /tmp/geocompy_pty_client
GEOCOMPY_TEST_PORT_SERVER: /tmp/geocompy_pty_server
GEOCOMPY_TEST_PORT_FAULTY: /tmp/geocompy_pty_faulty
GEOCOMPY_TEST_TCPPORT_SERVER: 12345
jobs:
testing:
name: Running tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["python311", "python312", "python313"]
container: mrclock8163/geocompy:tests-${{matrix.python-version}}
steps:
- uses: actions/checkout@v4
- name: Build and install package
run: python -m pip install . --root-user-action=ignore
- name: Setup virtual serial port
run: |
socat pty,raw,echo=0,link=$GEOCOMPY_TEST_PORT_CLIENT pty,raw,echo=0,link=$GEOCOMPY_TEST_PORT_SERVER &
python tests/com_echo_server.py &
python tests/tcp_echo_server.py &
- name: Test with pytest
run: |
python -m pip install --group testing --root-user-action=ignore
python -m pytest
linting:
name: Linting
runs-on: ubuntu-latest
container: mrclock8163/geocompy:tests-python313
strategy:
fail-fast: false
matrix:
tool: ["flake8", "mypy"]
steps:
- uses: actions/checkout@v4
- name: Build and install package
run: python -m pip install . --root-user-action=ignore
- name: Running ${{ matrix.tool }}
run: |
python -m pip install --group linting --root-user-action=ignore
python -c "print('=========== ${{ matrix.tool }} ===========')"
python -m ${{ matrix.tool }} src/ tests/