Git Product home page Git Product logo

hmcts.vh-bookings-api's Introduction

vh-bookings-api

Running code coverage

  1. Install the report generator dotnet tool https://www.nuget.org/packages/dotnet-reportgenerator-globaltool/

You may need to restart your prompt to get the updated path.

  1. CD into the BookingsAPI folder

  2. Run the command for windows or osx ./run_coverage.sh or run_coverage.bat

The coverage report will open automatically after run, joining the results for both integration and unit tests.

Running Sonar Analysis

dotnet sonarscanner begin /k:"vh-bookings-api" /d:sonar.cs.opencover.reportsPaths="BookingsAPI/Artifacts/Coverage/coverage.opencover.xml" /d:sonar.coverage.exclusions="Bookings.API/Program.cs,Bookings.API/Startup.cs,Bookings.API/Extensions/**,Bookings.API/Swagger/**,Bookings.API/ConfigureServicesExtensions.cs,Testing.Common/**,Bookings.Common/**,Bookings.DAL/Mappings/**,Bookings.DAL/SeedData/**,Bookings.DAL/BookingsDbContext.cs,Bookings.DAL/**/DesignTimeHearingsContextFactory.cs,Bookings.DAL/Migrations/**,Bookings.Domain/Ddd/**,Bookings.Domain/Validations/**,Bookings.DAL/Commands/Core/**,Bookings.DAL/Queries/Core/**" /d:sonar.cpd.exclusions="Bookings.DAL/Migrations/**" /d:sonar.verbose=true
dotnet build BookingsAPI/BookingsApi.sln
dotnet sonarscanner end

##Branch name 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

##Commit message 
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.

Run Zap scan locally

To run Zap scan locally update the following settings and run acceptance\integration tests

Update following configuration under appsettings.json under VideoApi.AcceptanceTests or VideoApi.IntegrationTests

  • "Services:BookingsApiUrl": "https://BookingsApi_AC/"
  • "ZapConfiguration:ZapScan": true
  • "ConnectionStrings:VhBookings": "Server=localhost,1433;Database=VhBookings;User=sa;Password=VeryStrongPassword!;" (IntegrationTest alone)

Note: Ensure you have Docker desktop engine installed and setup

Run Stryker

To run stryker mutation test, go to UnitTest folder under command prompt and run the following command

dotnet stryker

From the results look for line(s) of code highlighted with Survived\No Coverage and fix them.

If in case you have not installed stryker previously, please use one of the following commands

Global

dotnet tool install -g dotnet-stryker

Local

dotnet tool install dotnet-stryker

To update latest version of stryker please use the following command

dotnet tool update --global dotnet-stryker

hmcts.vh-bookings-api's People

Contributors

shaed-parkar avatar valentinabennett avatar rochel avatar ddikman avatar jdssunil avatar kkodalikk avatar npoxon avatar abitec avatar rehmanab avatar muralikaturi avatar virensareen avatar rdbartram avatar phillipjchambers avatar shravankris avatar stravze avatar levibutler avatar robin-weller avatar tremolo64 avatar surfsquid avatar janisberz avatar venkatrangala avatar cts-code avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.