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

Use SimpleCov to monitor code coverage #1000

Merged
merged 1 commit into from
Oct 13, 2020
Merged

Use SimpleCov to monitor code coverage #1000

merged 1 commit into from
Oct 13, 2020

Conversation

benthorner
Copy link
Contributor

https://trello.com/c/epNWudCR/176-write-an-rfc-for-continuous-deployment-and-seek-review

We should always monitor the amount of code that is exercised when
we run our tests.

We should always monitor the amount of code that is exercised when
we run our tests.
@kevindew
Copy link
Member

It looks like this produces two different coverage reports (RSpec and Cucumer) do we not want a single one that combines them both? I've no idea if that's possible, mind.

@benthorner
Copy link
Contributor Author

It does produce two reports, but they're distinct and automatically aggregated by SimpleCov:

{
  "RSpec": {
    "coverage": {
      "/govuk/transition/app/controllers/concerns/track_mappings_progress.rb": {
        "lines": [
          1,

...

    "timestamp": 1600778396
  },
  "Cucumber Features": {
    "coverage": {
      "/govuk/transition/app/controllers/concerns/track_mappings_progress.rb": {
        "lines": [
          1,

...

@kevindew
Copy link
Member

Oh cool, so are we going to generate something with the file produced?

Thanks for explaining.

@benthorner
Copy link
Contributor Author

Oh cool, so are we going to generate something with the file produced?

I'm not sure I follow. The combined coverage is visible in the coverage/index.html file, although it doesn't indicate what (kind of) test is covering the code. We get the web page report by default - perhaps that was an unknown for you?

@kevindew
Copy link
Member

Oh cool, so are we going to generate something with the file produced?

I'm not sure I follow. The combined coverage is visible in the coverage/index.html file, although it doesn't indicate what (kind of) test is covering the code. We get the web page report by default - perhaps that was an unknown for you?

Sorry I wasn't very clear. I know that currently a file is created, however Jenkins doesn't do anything with it (as far as I'm aware) so I wondered if we'd be using it as part of a step or process.

@benthorner
Copy link
Contributor Author

Discussed in person and all is well: the aggregated coverage is visible in a single file; the use of SimpleCov is primarily for some minimal visibility on a local machine, although we could monitor it more comprehensively in future.

@benthorner benthorner merged commit b28481f into master Oct 13, 2020
@benthorner benthorner deleted the monitor-coverage branch October 13, 2020 14:10
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.

2 participants