Include the vh-packages source
https://pkgs.dev.azure.com/hmctsreform/VirtualHearings/_packaging/vh-packages/nuget/v3/index.json
Run the following in a terminal at the root of the repository
dotnet tool restore
Under the unit test project directory
dotnet reportgenerator "-reports:./Coverage/coverage.opencover.xml" "-targetDir:./Artifacts/Coverage/Report" -reporttypes:Html -sourcedirs:./NotificationApi
git hook will run on pre commit and control the standard for new branch name.
The branch name should start with: feature/VIH-XXXX-branchName (X - is digit). If git version is less than 2.9 the pre-commit file from the .githooks folder need copy to local .git/hooks folder. To change git hooks directory to directory under source control run (works only for git version 2.9 or greater) : $ git config core.hooksPath .githooks
The commit message will be validated by prepare-commit-msg hook. The commit message format should start with : 'feature/VIH-XXXX : ' folowing by 8 or more characters description of commit, otherwise the warning message will be presented.
To update latest version of stryker please use the following command
dotnet tool update --global dotnet-stryker
docker run -d --name sonarqube -e SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true -p 9000:9000 sonarqube:latest
The unit and integration tests can be run inside a container. You will need a an access token to build the image locally
Open a terminal at the root of the repo and run the following in a terminal to build the test image:
docker build . --file tests/Dockerfile -t notification-api-tests --build-arg PAT=<PAT TOKEN>
docker run --name notification-api-local --network=host -it --mount src="$(pwd)",target=/app,type=bind notification-api-tests:latest
Open a terminal at the root level of the repository and run the following command
docker-compose -f "docker-compose.tests.yml" up --build --abort-on-container-exit
You may need to create a
.env
file to store the environment variables