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
bugfix: Fix codecov broken backend coverage upload. #14972
Conversation
Hello @zulip/server-tooling members, this pull request was labeled with the "area: tooling" label, so you may want to check it out! |
.circleci/config.yml
Outdated
@@ -96,7 +96,7 @@ aliases: | |||
name: upload coverage report | |||
command: | | |||
. /srv/zulip-py3-venv/bin/activate | |||
pip install codecov && codecov \ | |||
pip install codecov==2.0.15 && codecov \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/undeterministic/nondeterminstic/ (the "un" version isn't a word AFAIK)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also can you add more details about the "gov find error"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Like, are newer versions buggy, or is something else going on?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated the commit message with what I could find/know about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put the issue link in a comment, so it's handy when one's looking at this code.
6ebcfc1
to
a538afc
Compare
Can you report the |
tools/coveragerc
Outdated
@@ -24,7 +24,6 @@ exclude_lines = | |||
^\s*\.\.\. | |||
|
|||
[run] | |||
data_file=var/.coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain this piece of the change a bit more? Will this adjust what path things get written to in a development environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, .coverage
will be written in ~/zulip (or pwd) but .coverage
is already in our .gitignore
file, so this will not bring any change. Anyways, we are not calling the --no-cov-cleanup
argument in development environment, so this file will be deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, but I think we want the coverage data to be written to var/.coverage
, not the root of the project. Is there a bug in upstream coverage
related to this as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not related to coverage
but how codecov
works when discovering coverage files for uploading. I can't find a setting to specify the location of coverage file when running codecov. (Also google search reveals nothing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do mv
to put things in place for codecov
? I think it makes sense to write coveragerc
for local development (test-backend --coverage
there) and then fix things up for codecov as needed.
@@ -407,7 +413,6 @@ def main() -> None: | |||
cov.stop() | |||
cov.save() | |||
cov.combine() | |||
cov.data_suffix = False # Disable suffix so that filename is .coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we should have the data_suffix
change as a separate commit? I was confused for a minute about why this was necessary for the no-cov-cleanup
option, before realizing that this is a conceptually separate change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's necessary for this fix, we should keep them in same commit. Let me see their documentation about data_suffix and see if we can do better here.
Filed the issue as nedbat/coveragepy#989 |
So, looking at this change, I have a few thoughts:
|
a538afc
to
1f7aa2d
Compare
Updated the commit message with issue links.
It's hard to discover which version introduced this issue, we can wait for someone to reply on the issue are proceeded as they suggest. Although, since we have pinned coverage to 5.1 in our dev.txt, this behaviour will remain the same unless this gets fixed in a future version, which we will possibly know with issue I opened being closed. |
Some conversation is going on in nedbat/coveragepy#989, we can wait for them to reply. |
6cefa98
to
f501c14
Compare
Fixes zulip#14962 * codecov needs `.coverage` file in the pwd to upload coverage results. * concurrency='multiprocessing' forces `.coverage` file to have a data_suffix, we explicity set it to "" for the file to have no suffix. Filed issue as nedbat/coveragepy#989
f501c14
to
94a8915
Compare
@timabbott IDK how I missed it, but pinning the codecov version to 2.0.15 has error in uploading the files. Wrote a big comment to explain this in the code. |
Look great, merged, thanks @amanagr! |
Looks like @mateuszmandera 's #13946 introduces this issue. The commits before this have backend coverage. Also, there appears to be some problem with suffix of the file, which should be blank.
Also, removes the find error we see: