Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test CI #19

Merged
merged 5 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/test-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test CI

on:
# Triggers the workflow on push and pull request events but only for pull_requests on the main branch
push:
branches:
- main

pull_request:
branches:
- main

# Allows you to run this workflow manually
workflow_dispatch:

env:
PYTHON_VERSION: "3.11"

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Install dependencies using pip
run: pip install -e ".[dev]"

- name: Checking static types using mypy
run: mypy --strict ocrdbrowser ocrdmonitor


pytest:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'

- name: Install dependencies using pip
run: pip install -e ".[dev]"

- name: Testing using pytest
run: |
pip install pytest-clarity # coloured diff output
pytest tests -m "not integration"
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ nox = [
[tool.mypy]
plugins = ["pydantic.mypy"]

[tool.pytest.ini_options]
markers = [
"integration: mark test as integration test",
]

[build-system]
requires = ["pdm-pep517>=1.0.0"]
build-backend = "pdm.pep517.api"
3 changes: 2 additions & 1 deletion tests/ocrdmonitor/test_sshps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pathlib import Path

import pytest
from testcontainers.general import DockerContainer

from ocrdmonitor.processstatus import ProcessState
Expand All @@ -13,7 +14,7 @@
openssh_server,
)


@pytest.mark.integration
def test_ps_over_ssh__returns_list_of_process_status(
openssh_server: DockerContainer,
) -> None:
Expand Down