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

Add test-coverage & codecov target and update circleci #109

Merged
merged 2 commits into from
May 23, 2017

Conversation

vdemeester
Copy link
Collaborator

@vdemeester vdemeester commented May 18, 2017

This is more or less what we used on some other docker project.

  • Not sure if test-coverage should be on his own or be just test
  • @dnephin I added parellel here too 👼
  • @nandhini915 the codecov token is set on circleci I guess ? 👼

Signed-off-by: Vincent Demeester [email protected]

@dnephin
Copy link
Contributor

dnephin commented May 18, 2017

Looks like it's failing because of missing dep.

Do you think we need this in the Makefile, or only the circleci?

I think parallel might actually slow it down, because we only get 1 CPU on CI.

I'm going to push some changes and you can let me know what you think.

@nandhini915
Copy link

@vdemeester I don't think the token would be required (since docker/cli is a public repo), but yes for private repos we'd setup codecov token in circleci.

@dnephin dnephin force-pushed the codecov-in-circle branch 3 times, most recently from f5e6f42 to a248158 Compare May 18, 2017 15:06
@codecov-io
Copy link

codecov-io commented May 18, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@883d28c). Click here to learn what that means.
The diff coverage is n/a.

@@            Coverage Diff            @@
##             master     #109   +/-   ##
=========================================
  Coverage          ?   46.16%           
=========================================
  Files             ?      161           
  Lines             ?    10998           
  Branches          ?        0           
=========================================
  Hits              ?     5077           
  Misses            ?     5631           
  Partials          ?      290

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

LGTM

although this now includes some of my changes

@dnephin dnephin requested a review from tiborvass May 18, 2017 15:18
@aaronlehmann
Copy link
Contributor

We run codecov on PRs against the swarmkit and distribution repositories. I don't have anything against it. But I also can't recall a time when the coverage information has been useful. We've pushed back against PRs that didn't have adequate tests, but that came from reviewing the PR and noticing that the tests were insufficient. I don't think we've ever made the decision based on the codecov report. In the past we tried to automatically fail CI for PRs that decreased the coverage ratio, and this worked very poorly. There was random fluctuation in the results because of nondeterminism in some code and tests (for example, the order in which two goroutines execute might affect which code paths are taken). It also penalized changes that added extensive error checking, when those errors were not possible to trigger in practice (and therefore the code paths did not show up in code coverage).

cc @stevvooe

@dnephin
Copy link
Contributor

dnephin commented May 19, 2017

I don't think we have any plans to make it fail CI, I agree that is unreliable.

For me the benefit to this integration is that it makes it easier to see the test coverage for a PR. Test coverage may be easy to see in a PR that adds new features, but test coverage in a PR that refactor lots of code is less obvious.

The valuable metric to me is patch coverage, not total coverage.

Copy link
Contributor

@mlaventure mlaventure left a comment

Choose a reason for hiding this comment

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

LGTM

#!/usr/bin/env bash
set -eu -o pipefail

go test -tags daemon -v $@
Copy link
Contributor

Choose a reason for hiding this comment

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

Why aren't these just in the Makefile? These kinds of systems are extremely hard to maintain.

Copy link
Contributor

Choose a reason for hiding this comment

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

What are "these kinds of systems" ? And what makes them hard to maintain?

Copy link
Contributor

Choose a reason for hiding this comment

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

A mess of bash scripts. It contributes to a horrid build experience and is very hard to modify.

This particular example is absurd. Why is this in its own file?

-covermode=atomic \
${pkg}

if test -f profile.out; then
Copy link
Contributor

Choose a reason for hiding this comment

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

Please include a comment as to why this required.

Copy link
Contributor

Choose a reason for hiding this comment

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

Please address this. Why is this not an argument to the original command?

Copy link
Contributor

Choose a reason for hiding this comment

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

What is "this"? The profile.out filename?

https://lk4d4.darth.io/posts/multicover/

Copy link
Contributor

Choose a reason for hiding this comment

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

The file is given as one argument, then copied to the other. Why not give the original file to the command and have it write directly? Are you trying to append it to a global coverage file?

Copy link
Contributor

Choose a reason for hiding this comment

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

The file isn't copied. The file is appended to the global coverage file yes. That's what it's doing.

Copy link
Collaborator Author

@vdemeester vdemeester left a comment

Choose a reason for hiding this comment

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

LGTM @dnephin's commit 👍

@dnephin dnephin merged commit e47cc91 into docker:master May 23, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.06.0 milestone May 23, 2017
@vdemeester vdemeester deleted the codecov-in-circle branch May 23, 2017 16:01
@stevvooe
Copy link
Contributor

@vdemeester I would hope that you would at least address my comments before merging.

This Makefile setup gets a hard REJECT.

@thaJeztah
Copy link
Member

@dnephin @vdemeester can this PR be discussed so that things are addressed or consensus reached?

@dnephin
Copy link
Contributor

dnephin commented May 23, 2017

Yes, I'm still trying to understand the concerns with this PR. It was important to get it merged so that we have coverage on other PRs. If there are things that need to be changed, we can change them.

@thaJeztah
Copy link
Member

This didn't make it into 17.06 - moving milestone

@thaJeztah thaJeztah modified the milestones: 17.07.0, 17.06.0 Jul 21, 2017
trapier pushed a commit to trapier/cli that referenced this pull request Sep 30, 2019
…-master-f2123b3fe41e7e126e9c8f4794214a50f71e866b

[master] sync to upstream master f2123b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants