Skip to content
This repository was archived by the owner on Aug 5, 2024. It is now read-only.

Latest commit

 

History

History

common

NHS Integration Adaptors Common Utilities

This package contains common utilities used by the various projects that make up the NHS integration adaptors.

Installation

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

Run Tests

  • pipenv run unittests will run all unit tests.

Coverage

  • pipenv run unittests-cov will run all unit tests, generating a Coverage report in the test-reports directory.
  • pipenv run coverage-report will print the coverage report generated by unittests-cov
  • pipenv run coverage-report-xml will produce an XML version of the coverage report generated by unittests-cov, in a Cobertura compatible format
  • pipenv run coverage-report-html will produce an HTML version of the coverage report generated by unittests-cov

Analysis

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.)

Local Environment

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.