Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SHIPA-2139] enforce unit test coverage #195

Merged
merged 1 commit into from
Nov 29, 2021
Merged

[SHIPA-2139] enforce unit test coverage #195

merged 1 commit into from
Nov 29, 2021

Conversation

stinkyfingers
Copy link
Contributor

@stinkyfingers stinkyfingers commented Nov 17, 2021

Description

Fixes # 2139

Relies on https://github.com/theketchio/unit-test-coverage, which I made public. unit-test-coverage may be used by our private shipa repos, but I figured it should be public as it is used by Ketch. This PR adds CI steps that run unit-test-covreage using ci/limits.json. In the event test coverage drops below the current level specified in limits.json, you'll get a failure and see output like this:

Screen Shot 2021-11-17 at 9 41 03 AM

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (documentation addition or typo, file relocation)

Testing

  • New tests were added with this PR that prove my fix is effective or that my feature works (describe below this bullet)
  • This change requires no testing (i.e. documentation update)

Documentation

  • All added public packages, funcs, and types have been documented with doc comments
  • I have commented my code, particularly in hard-to-understand areas

Final Checklist:

  • I followed standard GitHub flow guidelines
  • I have performed a self-review of my own code
  • My changes generate no new warnings

Copy link
Contributor

@DavisFrench DavisFrench left a comment

Choose a reason for hiding this comment

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

This looks good to me. I am a bit curious though, is this kind of constraint usually defined within the codebase as opposed to the ci/cd pipeline?

@stinkyfingers
Copy link
Contributor Author

@DavisFrench I have the same question. Maybe it would be more idiomatic to just sed package coverages and compare to some file maintained in the .github directory?

@stinkyfingers stinkyfingers force-pushed the shipa-2139 branch 4 times, most recently from 7606ea7 to 5dde56f Compare November 22, 2021 21:25
move test coverage to ci

lint yaml

fix ci

fix paths

delete unit test script

checkout and use unit-test-coverage

use public ketch repo

add limits.json
@stinkyfingers
Copy link
Contributor Author

@DavisFrench Forget everything I said. I moved the unit-test-coverage script to a separate repo. This PR is just the CI steps now.

Copy link
Contributor

@aleksej-paschenko aleksej-paschenko left a comment

Choose a reason for hiding this comment

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

looks awesome!

@stinkyfingers stinkyfingers merged commit 1621d9c into main Nov 29, 2021
@stinkyfingers stinkyfingers deleted the shipa-2139 branch November 29, 2021 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants