diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..4f0eb412 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,4 @@ +[run] +concurrency = multiprocessing, thread +parallel = true +sigterm = true diff --git a/.gitignore b/.gitignore index 96c529fd..02c38a88 100644 --- a/.gitignore +++ b/.gitignore @@ -48,6 +48,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +report.xml pytest_report.xml # Translations @@ -82,4 +83,4 @@ openflexure_microscope/cobertura.xml /openflexure_settings/ # web app build -/src/openflexure_microscope_server/static/ \ No newline at end of file +/src/openflexure_microscope_server/static/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d02cbd1d..7dab41ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -104,11 +104,8 @@ pytest: stage: testing extends: .python script: - - > - pytest --cov --cov-report term - --cov-report xml:coverage.xml - --junitxml=report.xml -# --gitlab-code-quality-report=pytest-warnings.json # can restore when it installs ok + - pytest +# --gitlab-code-quality-report=pytest-warnings.json # can restore when it installs ok coverage: '/(?i)total.*? (100(?:\.0+)?\%|[1-9]?\d(?:\.\d+)?\%)$/' artifacts: when: always diff --git a/pyproject.toml b/pyproject.toml index 0da3b957..747efe26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -73,8 +73,14 @@ target-version = "py311" [tool.pytest.ini_options] addopts = [ "--import-mode=importlib", + "--cov=openflexure_microscope_server", + "--cov-report=term", + "--cov-report=xml:coverage.xml", + "--junitxml=report.xml", ] +norecursedirs = [".git", "build", "node_modules"] + [tool.ruff.format] # Use native line endings for all files line-ending = "native" diff --git a/pytest.ini b/pytest.ini deleted file mode 100644 index 6a9f1be2..00000000 --- a/pytest.ini +++ /dev/null @@ -1,2 +0,0 @@ -[pytest] -norecursedirs = .git build node_modules \ No newline at end of file diff --git a/src/openflexure_microscope_server/things/__init__.py b/src/openflexure_microscope_server/things/__init__.py new file mode 100644 index 00000000..e69de29b