diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 4edd7b1a..00000000 --- a/.coveragerc +++ /dev/null @@ -1,2 +0,0 @@ -[run] -relative_files = True diff --git a/.github/workflows/sonarqube.yaml b/.github/workflows/sonarqube.yaml index 759cce97..96cbae48 100644 --- a/.github/workflows/sonarqube.yaml +++ b/.github/workflows/sonarqube.yaml @@ -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 @@ -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 diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index b651b3fb..94a560d2 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -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" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..d5521a62 --- /dev/null +++ b/pyproject.toml @@ -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/*" +] \ No newline at end of file