Skip to content

Commit

Permalink
Add pyproject.toml and test config
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Sharples committed Sep 17, 2024
1 parent a464e1a commit 76e1072
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 8 deletions.
2 changes: 0 additions & 2 deletions .coveragerc

This file was deleted.

14 changes: 11 additions & 3 deletions .github/workflows/sonarqube.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ jobs:
sonarqube:
name: SonarQube Scan
runs-on: ubuntu-latest


services:
mariadb:
image: mariadb:latest
env:
MARIADB_ROOT_PASSWORD: root_password
ports:
- 3306:3306
options: --health-cmd="healthcheck.sh --connect --innodb_initialized" --health-interval=10s --health-timeout=5s --health-retries=3

steps:

- name: Check if PR is from a fork
Expand Down Expand Up @@ -75,8 +84,7 @@ jobs:
- name: Run Pytests
run: |
coverage run --append -m pytest METreformat
coverage run --append -m pytest METreadnc
coverage run --append -m pytest
- name: Output coverage report
run: coverage report -m
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/unit_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ jobs:

- name: Test with pytest
run: |
coverage run --append -m pytest METdbLoad/test
coverage run --append -m pytest METreformat
coverage run --append -m pytest METreadnc
coverage run --append -m pytest
coverage report -m
echo "Finished unit tests and coverage"
20 changes: 20 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

[tool.pytest.ini_options]
addopts = "-q"
testpaths = [
"METdbLoad/test",
"METreadnc/test",
"METreformat/test",
]

[tool.coverage.run]
relative_files = true
source = [
"METdbLoad/ush",
"METreadnc/util",
"METreformat/",
]
omit = [
"*__init__.py",
"METreformat/test/*"
]

0 comments on commit 76e1072

Please sign in to comment.