This package contains common utilities used by the various projects that make up the NHS integration adaptors.
To use this package as part of your project, ensure you have pipenv
installed and on your path, then from your
project's directory run:
pipenv install -e ./relative/path/to/package/directory
E.g:
pipenv install -e ./../common
pipenv run unittests
will run all unit tests.
pipenv run unittests-cov
will run all unit tests, generating a Coverage report in thetest-reports
directory.pipenv run coverage-report
will print the coverage report generated byunittests-cov
pipenv run coverage-report-xml
will produce an XML version of the coverage report generated byunittests-cov
, in a Cobertura compatible formatpipenv run coverage-report-html
will produce an HTML version of the coverage report generated byunittests-cov
To use sonarqube analysis you will need to have installed sonar-scanner
.
Ensure sonar-scanner is on your path, and configured for the sonarqube host with appropriate token.
sonar-scanner
will use sonar-project.properties
to submit source to sonarqube for analysis.
(See: SonarQube)
NOTE: Coverage will not show in the analysis unless you have already generated the xml report (as per above.)
Three scripts are available from pipenv run
, they are:
local-env-prep
This will prepare any docker images required to run a local-environment.local-env-start
This will run a local environment which can be used for local exploratory testing.local-env-stop
This will stop the local environment which was started, so that it is not running when not needed.