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

[MRG + 1] Run codecov only once #132

Merged
merged 8 commits into from
Oct 11, 2018
Merged

Conversation

vaibhavmule
Copy link
Contributor

@vaibhavmule vaibhavmule commented Oct 6, 2018

Closes: #114

@codecov-io
Copy link

codecov-io commented Oct 6, 2018

Codecov Report

Merging #132 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #132   +/-   ##
=======================================
  Coverage   84.47%   84.47%           
=======================================
  Files          12       12           
  Lines        1198     1198           
  Branches      288      288           
=======================================
  Hits         1012     1012           
  Misses        142      142           
  Partials       44       44

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8d38907...86e18f7. Read the comment docs.

@vinayak-mehta
Copy link
Contributor

Hey @vaibhavmule, why is this needed? Why did you move Python 3.6 in the matrix? I think the current way it is done clearly separates generation of coverage.xml and uploading it to codecov.

@vaibhavmule
Copy link
Contributor Author

after_success will send codecov for every version.

This way it will send only send for once, which is for 3.6.

@vinayak-mehta
Copy link
Contributor

after_success will send codecov for every version.

Why is that bad?

@vaibhavmule
Copy link
Contributor Author

Three things,

  • code coverage identical for all version
  • you should have one source
  • What you see on PR from codecov is generated from the recent CI is run.

So why not have one version to check coverage and send that to codecov.

@vaibhavmule
Copy link
Contributor Author

vaibhavmule commented Oct 7, 2018

Check this image, see that it has been edited 4 times? 4 versions?

Why do you want to repeat the same thing?

And check this PR, no edits.

screenshot 2018-10-07 at 2 02 33 pm

@vinayak-mehta
Copy link
Contributor

Hmm, makes sense. Though the current way doesn't look very clean. Requests does this in a nice way, check out their .travis.yml and Makefile. Can you create a Makefile and then add jobs to .travis.yml? Would also solve #114!

@vaibhavmule
Copy link
Contributor Author

vaibhavmule commented Oct 7, 2018

Exactly, I can attempt for creating Makefile, and see even requests generate codecov only once.

@vinayak-mehta
Copy link
Contributor

We can reuse the Requests Makefile, it should be straightforward. We need the following directives: install, test, coverage, publish and docs. For install, we can add both apt and brew commands for dependencies based on the operating system on which the Makefile is run (check out this gist).

@vinayak-mehta
Copy link
Contributor

We can add flake8 later.

@vaibhavmule vaibhavmule changed the title [MRG] run codecov only once [WIP] run codecov only once Oct 8, 2018
@vaibhavmule vaibhavmule changed the title [WIP] run codecov only once [MRG] run codecov only once Oct 8, 2018
@vaibhavmule
Copy link
Contributor Author

vaibhavmule commented Oct 8, 2018

@vinayak-mehta This is up for review.

Installing dependencies via Makefile is getting failed.

That is why I have moved things to before_install: 835278e

@vinayak-mehta
Copy link
Contributor

@vaibhavmule Thanks! Will look into it today.

Makefile Outdated
@@ -0,0 +1,16 @@
.PHONY: docs
init:
Copy link
Contributor

Choose a reason for hiding this comment

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

@vaibhavmule Can you add the apt and brew install commands in here by detecting the OS? https://gist.github.com/sighingnow/deee806603ec9274fd47

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can add that, have you seen this 835278e and seen how a build is failing if I add that to init: section: https://travis-ci.org/socialcopsdev/camelot/jobs/438470439

Copy link
Contributor

Choose a reason for hiding this comment

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

Checking.

.travis.yml Outdated
- stage: coverage
python: 3.6
script: make test && codecov --verbose
Copy link
Contributor

Choose a reason for hiding this comment

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

@vaibhavmule The requests Makefile just calls codecov at this stage? I see in the docs that files aren't preserved between stages, any idea how they get the coverage.xml to upload at this stage?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They (Requests) don't, their coverage thing is broken.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh didn't know that. Any idea why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, but as far as I know, codecov requires the tests to be run and coverage file to be generated when you want send things to codecov.

This is how we do at @MasoniteFramework https://github.com/MasoniteFramework/core/blob/develop/.travis.yml#L13

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah just not a big fan of the && :) Let's keep it for now till we can think of a nicer way. Maybe adding a directive in the Makefile will reduce this to a single command.

Copy link
Contributor Author

@vaibhavmule vaibhavmule Oct 10, 2018

Choose a reason for hiding this comment

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

@vinayak-mehta if not &&, does this make sense?

script: 
  - make test
  - codecov --verbose

@vinayak-mehta vinayak-mehta changed the title [MRG] run codecov only once [MRG + 1] Run codecov only once Oct 11, 2018
@vinayak-mehta
Copy link
Contributor

vinayak-mehta commented Oct 11, 2018

Fixed it! Also reworded the commit messages so that they start with a capital letter, tip for next time! @vaibhavmule https://camelot-py.readthedocs.io/en/master/dev/contributing.html#work-on-your-pull-request

@vinayak-mehta vinayak-mehta merged commit 1ba0cfc into atlanhq:master Oct 11, 2018
@vinayak-mehta
Copy link
Contributor

Thanks for the codecov catch @vaibhavmule!

@vaibhavmule
Copy link
Contributor Author

vaibhavmule commented Oct 11, 2018

Now these Makefile and .travis.yml files which people should look up to. 💁

@vinayak-mehta
Copy link
Contributor

Haha, not familiar with that emoji.

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