This repository is no longer maintained. The code has been merged into the NHSDigital/integration-adaptor-mhs repo in the /common folder.
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 git+ssh://git@github.com/nhsconnect/integration-adaptor-common.git@0.0.1#egg=integration-adaptors-common
This must be ssh and not https in order to be able to push your branches changes when this is an external repository.
From the integration-adaptor-common folder
pipenv run unittests
will run all unit tests.
From the integration-adaptor-common folder
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.)
It is possible to edit the external package when using it in another repository, like nhais or mhs, in the same IntelliJ window as the opened project. There is no need to keep two windows open.
To do this you must ensure ssh was used to install this repository as an external package in your current repository to be able to push changes.
Edit files: Open IntelliJ → selected repo → Pipenv → external libraries → integration-adaptor-common → Select file you want to edit → pop-up window select (I want to edit all files in this directory)
Create directory: cd to root of desired directory, mkdir directory_name
Create File: cd to root of desired directory, touch file_name
Add files: cd into directory of file created, git add (file-name)
Push changes: Location of virtualenv → src → integration-adaptor-common → git status → git diff → git commit → git push HEAD