Skip to content

Commit 5685c7d

Browse files
authored
Merge pull request #41 from NASA-PDS/coverage
Add coverage testing and reporting to SonarQube Cloud
2 parents 74f7309 + d870644 commit 5685c7d

File tree

5 files changed

+53
-29
lines changed

5 files changed

+53
-29
lines changed

.github/workflows/unstable-cicd.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ jobs:
7676
pypi_username: ${{secrets.TEST_PYPI_USERNAME}}
7777
pypi_password: ${{secrets.TEST_PYPI_PASSWORD}}
7878
ADMIN_GITHUB_TOKEN: ${{secrets.ADMIN_GITHUB_TOKEN}}
79+
-
80+
name: 🛏️ Upload Coverage
81+
uses: SonarSource/sonarqube-scan-action@v5
82+
env:
83+
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
7984

8085
...
8186

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ pip-selfcheck.json
1313

1414
# Python testing artifacts
1515
.coverage
16+
coverage.xml
1617
htmlcov
1718
.tox/
1819

docs/requirements/v2.4.0-dev/REQUIREMENTS.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,47 @@ Requirements Summary
44

55
# default
66

7-
## As a manager, I want to know the current total volume of PDS holdings ([#2](https://github.com/NASA-PDS/registry-dashboards/issues/2))
7+
## As a manager, I want to know the current total volume of PDS holdings ([#2](https://github.com/NASA-PDS/registry-dashboards/issues/2))
88

99

1010
This requirement is not impacted by the current version
11-
## As a PDS Project Office, I want to know the historical total volume of PDS holdings over time ([#7](https://github.com/NASA-PDS/registry-dashboards/issues/7))
11+
## As a PDS Project Office, I want to know the historical total volume of PDS holdings over time ([#7](https://github.com/NASA-PDS/registry-dashboards/issues/7))
1212

1313

1414
This requirement is not impacted by the current version
15-
## As a Node Manager, I want to create archive storage profiles of data volumes ([#8](https://github.com/NASA-PDS/registry-dashboards/issues/8))
15+
## As a Node Manager, I want to create archive storage profiles of data volumes ([#8](https://github.com/NASA-PDS/registry-dashboards/issues/8))
1616

1717

1818
This requirement is not impacted by the current version
19-
## As a Node Manager, I want to have separate views of data holdings for PDS ([#9](https://github.com/NASA-PDS/registry-dashboards/issues/9))
19+
## As a Node Manager, I want to have separate views of data holdings for PDS ([#9](https://github.com/NASA-PDS/registry-dashboards/issues/9))
2020

2121

2222
This requirement is not impacted by the current version
23-
## As a Node Manager, I want to report on the number of artifacts within the archive ([#10](https://github.com/NASA-PDS/registry-dashboards/issues/10))
23+
## As a Node Manager, I want to report on the number of artifacts within the archive ([#10](https://github.com/NASA-PDS/registry-dashboards/issues/10))
2424

2525

2626
This requirement is not impacted by the current version
27-
## As a Node Manager, I want to report to missions that request volume information ([#11](https://github.com/NASA-PDS/registry-dashboards/issues/11))
27+
## As a Node Manager, I want to report to missions that request volume information ([#11](https://github.com/NASA-PDS/registry-dashboards/issues/11))
2828

2929

3030
This requirement is not impacted by the current version
31-
## As a Node Manager, I want to customize new reports on volume metrics ([#12](https://github.com/NASA-PDS/registry-dashboards/issues/12))
31+
## As a Node Manager, I want to customize new reports on volume metrics ([#12](https://github.com/NASA-PDS/registry-dashboards/issues/12))
3232

3333

3434
This requirement is not impacted by the current version
35-
## As a Node Manager, I want to know the projected total volume of Node holdings over time ([#13](https://github.com/NASA-PDS/registry-dashboards/issues/13))
35+
## As a Node Manager, I want to know the projected total volume of Node holdings over time ([#13](https://github.com/NASA-PDS/registry-dashboards/issues/13))
3636

3737

3838
This requirement is not impacted by the current version
39-
## As a DDWG Representative, I want to find the uses ([#15](https://github.com/NASA-PDS/registry-dashboards/issues/15))
39+
## As a DDWG Representative, I want to find the uses ([#15](https://github.com/NASA-PDS/registry-dashboards/issues/15))
4040

4141

4242
This requirement is not impacted by the current version
43-
## As a PDS manager, I want to see the ingestion status in the registry ([#29](https://github.com/NASA-PDS/registry-dashboards/issues/29))
43+
## As a PDS manager, I want to see the ingestion status in the registry ([#29](https://github.com/NASA-PDS/registry-dashboards/issues/29))
4444

4545

4646
This requirement is not impacted by the current version
47-
## As a Node person I want to add a new bundle metrics visualization to the dashboard ([#30](https://github.com/NASA-PDS/registry-dashboards/issues/30))
47+
## As a Node person I want to add a new bundle metrics visualization to the dashboard ([#30](https://github.com/NASA-PDS/registry-dashboards/issues/30))
4848

4949

50-
This requirement is not impacted by the current version
50+
This requirement is not impacted by the current version

sonar-project.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sonar.projectKey=NASA-PDS_registry-dashboards
2+
sonar.organization=nasa-pds
3+
sonar.python.coverage.reportPaths=coverage.xml

tox.ini

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
11
[tox]
22
envlist = py313, docs, lint
3-
3+
requires = tox>=4.6
44

55
[testenv]
6-
deps = .[dev]
7-
whitelist_externals = pytest
8-
commands = pytest
9-
6+
description = run tests
7+
basepython = python3.13
8+
package = wheel
9+
extras = dev
10+
usedevelop = true
11+
commands = pytest --cov=src --cov-report=xml {posargs}
1012

1113
[testenv:docs]
12-
deps = .[dev]
13-
whitelist_externals = python
14+
description = build docs
15+
extras = dev
1416
commands = sphinx-build -b html docs/source docs/build
1517

16-
1718
[testenv:lint]
18-
deps = pre-commit
19-
commands=
20-
python -m pre_commit run --color=always {posargs:--all}
19+
description = run linters
2120
skip_install = true
22-
23-
24-
[testenv:dev]
25-
basepython = python3.13
26-
usedevelop = True
27-
deps = .[dev]
21+
deps = pre-commit
22+
commands = python -m pre_commit run --color=always {posargs:--all}
23+
24+
[coverage:run]
25+
source = src
26+
omit =
27+
*/tests/*
28+
*/test_*
29+
*/__pycache__/*
30+
31+
[coverage:report]
32+
exclude_lines =
33+
pragma: no cover
34+
def __repr__
35+
if self.debug:
36+
if settings.DEBUG
37+
raise AssertionError
38+
raise NotImplementedError
39+
if 0:
40+
if __name__ == .__main__.:
41+
class .*\bProtocol\):
42+
@(abc\.)?abstractmethod

0 commit comments

Comments
 (0)