Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

POI - Increased Code Coverage#219

Merged
BSamodien merged 2 commits intoAzure-Samples:openhack_refreshfrom
hattan:poi_code_coverage
Jun 4, 2020
Merged

POI - Increased Code Coverage#219
BSamodien merged 2 commits intoAzure-Samples:openhack_refreshfrom
hattan:poi_code_coverage

Conversation

@hattan
Copy link
Copy Markdown
Contributor

@hattan hattan commented Jun 2, 2020

Purpose

This PR adds extra unit tests to POI to provide code coverage. Note: This is focused on Unit Testing and not integration testing coverage so Program.cs and Startup.cs were excluded from Code Coverage.

This PR brings unit test code coverage to 95.65% for POI.

Does this introduce a breaking change?

[ ] Yes
[X] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Documentation content changes
[X] Other... Please describe:
Unit Tests for Code Coverage

How to Test

  • Get the code
  • cd apis/poi
  • dotnet test ./tests/UnitTests
  • All tests should pass

To run code coverage using coverlet / report generator
Install tools:

dotnet tool install -g dotnet-reportgenerator-globaltool 
dotnet add package coverlet.msbuild 

Run tests and collect coverage:

dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura 
reportgenerator -reports:coverage.cobertura.xml -report-types:Html -targetdir:Report 

What to Check

  • Unit Tests should pass
  • Code Coverage should be higher than 80%

Other Information

No changes were made to the core api code, other than adding thhe ExcludeFromCodeCoverage annotation. In a future PR we can remove that attribute with increased integration tests.

@hattan hattan changed the title Poi code coverage POI - Increased Code Coverage Jun 2, 2020
Copy link
Copy Markdown
Contributor

@BSamodien BSamodien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@BSamodien BSamodien merged commit 427fe96 into Azure-Samples:openhack_refresh Jun 4, 2020
DariuszPorowski added a commit that referenced this pull request Sep 17, 2021
* Migrated POI APIs to netcore 3.1 and implemented the native healthchecks (#194)

* Properly upgraded to netcore 2.2

* updated POI to netcore 3.0

* updated UnitTest to netcore 3.0

* updated IntegrationTest to netcore 3.0

* updated POI to netcore 3.1

* updated UnitTest to netcore 3.1

* updated IntegrationTest to netcore 3.1

* Cleanup

* Small refactoring

* Updated packages to latest version

* Migrate Health Checks to netcore 3.1 standard

* Migrate Health Checks to netcore 3.1 standard

* Migrate Health Checks to netcore 3.1 standard

* Ensure DB is created

* Added proper references to the README files

* Updated Dockerfile for netcore 3.1

* Fix

* Dmckinstry/v2 consolidated (#201)

* Dmckinstry/java updates (#196)

* Remove HELM Charts
Cleanup POM dependencies
Update to JRE8

* Cleanup imports / compiler warnings

* Bump acorn from 5.7.1 to 5.7.4 in /apis/userprofile (#197)

Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.1 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](acornjs/acorn@5.7.1...5.7.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump js-yaml from 3.12.0 to 3.13.1 in /apis/userprofile (#198)

Bumps [js-yaml](https://github.com/nodeca/js-yaml) from 3.12.0 to 3.13.1.
- [Release notes](https://github.com/nodeca/js-yaml/releases)
- [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md)
- [Commits](nodeca/js-yaml@3.12.0...3.13.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump lodash from 4.17.10 to 4.17.15 in /apis/userprofile (#199)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.10...4.17.15)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Bump morgan from 1.9.0 to 1.9.1 in /apis/userprofile (#200)

Bumps [morgan](https://github.com/expressjs/morgan) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/expressjs/morgan/releases)
- [Changelog](https://github.com/expressjs/morgan/blob/master/HISTORY.md)
- [Commits](expressjs/morgan@1.9.0...1.9.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Delete all HELM charts

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Removed AKS references fom Readme (#207)

* Enpolat/204 update swagger versions (#205)

* swagger aspnetcore version bumped

* swagger version bumped

* unneccessary sections removed

* main method is a one-liner

* commented code piece removed

* swagger generator middleware re-styled and description added

* redundant yaml file removed

* description field added

* schemas list removed in order to make it look-a-like with the other apis swagger uis

* http method names uppercased, no need to do it during runtime

* latest go version added to module

* go dependency bumped

* swagger ui dependency bumped

* testify version bumped

* swagger dependency version bumped to latest version

* mssql dependency added, in case machine does not have it

* api name modified, description added

* url paths changed to make it look like similar to other apis swagger uis

* name of the api modified and description field added

* schemas removed

* tags field added, so all the operations will be presented under the same section

* unneccessary field removed

* default response model renamed

* lock file updated with the latest versions of the dependencies

* all dependency versions bumped

* latest version of swaggerui dependency added

* unneccessary dependency removed

* code modified, according to the changes of the latest version of swagger ui dependency

* no need to set go version 1.11

* golang version bumped to latest in the build stage

* dropped buster from the golang tag

* dependency versions bumped

* localhost part removed from swagger json url

* updating user java pom.xml to add in missing sql server dependency (#216)

* updating user java pom.xml to add in missing sql server dependency

* removing extra mockito-core dependency

* Adding Version Endpoints to all apis (#217)

* poi version

* adding version to trips

* initial java version

* adding version for userprofile

* adding newlines to certain files to satisfy linter

* fixed runtime dependencies of user profile (#218)

* POI - Increased Code Coverage (#219)

* added more poi unit tests

* added healthcheck and POIConfig tests

* Trips  Increased Code Coverage (#220)

* moved golang tests to support coverage

* added more queries unit tests

* refactored queries test to use assert

* added version tests

* renamed healthcheck test file and added swagger service tests

* Added swagger service missing file test

* added logger tests

* added more query tests

* fixed integration tests and bug in gettripsforuser query

* Added dataaccess integration tests

* added failure tests for tripsservice

* Added cleanup to data access test

* updated readme for trips to include unit and integratino test instructions

* fixes userprofile unit tests (#227)

* Bump path-parse from 1.0.5 to 1.0.7 in /apis/userprofile (#286)

Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.5 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>

* Bump lodash from 4.17.10 to 4.17.21 in /apis/userprofile (#277)

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.10 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.10...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <3431813+DariuszPorowski@users.noreply.github.com>

* Bump extend from 3.0.0 to 3.0.2 in /apis/userprofile (#177)

Bumps [extend](https://github.com/justmoon/node-extend) from 3.0.0 to 3.0.2.
- [Release notes](https://github.com/justmoon/node-extend/releases)
- [Changelog](https://github.com/justmoon/node-extend/blob/master/CHANGELOG.md)
- [Commits](justmoon/node-extend@v3.0.0...v3.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update README.md (#299)

Co-authored-by: v-rajagt <31903563+v-rajagt@users.noreply.github.com>

* Ohfix master (#300)

* 3.1 mcr

* HealthCheckResponse (#302)

Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>

* Devcontainer (#303)

* added devcontainer (#226)

Co-authored-by: Ben Coleman <benc.uk@gmail.com>
Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>

Co-authored-by: Davide Benvegnù <davide.benvegnu@outlook.com>
Co-authored-by: Dave McKinstry <dmckinstry@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Brent <BSamodien@users.noreply.github.com>
Co-authored-by: Engin Polat <polatengin@hotmail.com>
Co-authored-by: Hattan Shobokshi <hattan@gmail.com>
Co-authored-by: Ben Coleman <benc.uk@gmail.com>
Co-authored-by: v-rajagt <31903563+v-rajagt@users.noreply.github.com>
Co-authored-by: Dariusz Porowski <Dariusz.Porowski@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants