codecov / codecov-bash Goto Github PK
View Code? Open in Web Editor NEWGlobal coverage report uploader for Codecov
Home Page: https://codecov.io
License: Apache License 2.0
Global coverage report uploader for Codecov
Home Page: https://codecov.io
License: Apache License 2.0
Appveyor has bash installed and in the path, and it should work.
As a short term measure, it should raise an error immediately on Appveyor, informing the user that it does not work on Appveyor.
The list of supported CI Providers in the README is missing BuddyBuild although it is according to the source code supported.
You can use -d
to dump the upload file instead of uploading, but that is quite verbose.
It would be nice if -d
would just output the URL, and only -v -d
would dump it - given that a long option like --dry-run
is not trivial to do with bash's getops (but would be possible), and that -n
is already taken.
Via #86.
We have started seeing an error a couple of weeks back when running the following (in AppVeyor using PowerShell script). It seems this is an error that get reported in the Python code for codecov.
Was hoping for some insight what could be going on.
I more detailed write up can be seen in the issue PowerShell/DscResource.Tests#203.
$null = pip install git+git://github.com/codecov/codecov-python.git
uploadResults = codecov -f $resolvedResultFile -X gcov
codecov : The filename, directory name, or volume label syntax is incorrect.
At C:\projects\xnetworking\DscResource.Tests\DscResource.CodeCoverage\CodeCovIo.psm1:336 char:22
+ $uploadResults = codecov -f $resolvedResultFile -X gcov
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (The filename, d...x is incorrect.:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
See test run here: https://ci.appveyor.com/project/PowerShell/xnetworking/build/3.1.786.0#L4671
Recently, all CodeCov GitHub emails are automatically flagged as spam by Google Inbox. Maybe an email setting is wrong and now incorrectly flagging this service as spam?
Seeing this error in one of my projects:
==> Appveyor CI detected.
project root: .
Yaml found at: codecov.yml
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ coverage/coverage.xml bytes=157786
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
bash : find: paths must precede expression: ./vendor/bin
At line:3 char:1
+ bash codecov.sh -f 'coverage/coverage.xml'
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (find: paths mus...n: ./vendor/bin:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
+ Found adjustments
==> Uploading reports
url: https://codecov.io
query: branch=appveyor&commit=d96c6a413b015a5ca98d60291cc671561879a4d6&build=8x2u2py364mp88w1&build_url=&name=&tag=&slug=felixfbecker%2Fphp-language-server&yaml=codecov.yml&service=appveyor&flags=&pr=&job=felixfbecker%2Fphp-language-server%2F24
-> Pinging Codecov
-> Uploading to S3 https://codecov.s3.amazonaws.com
-> View reports at https://codecov.io/github/felixfbecker/php-language-server/commit/d96c6a413b015a5ca98d60291cc671561879a4d6
Command executed with exception: Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
https://ci.appveyor.com/project/felixfbecker/php-language-server/build/24#L500
Port it from codecov/codecov-python#118.
A common false-positive I see from Codecov is as follows
The problem: The base of comparison being used is the latest-and-greatest of the integration branch, even though I branched off from an older commit of the integration branch.
One work-around is for me to simply rebase my feature branch atop the integration branch, and rebuild to get an accurate delta.
But it would be ideal if Codecov did a comparison against the merge-base for the PR. In git terms that would be git merge-base integration-branch feature-branch
.
There's an error in the current https://codecov.io/bash
script, reports aren't found - at least verified on Travis.
Debugging, I find that there is a .coverage
file:
From https://travis-ci.org/django-wiki/django-wiki/jobs/284586222 :
[snip]
The command "tox" exited with 0.
after_success.1
0.01s$ ls -la
total 176
drwxrwxr-x 9 travis travis 4096 Oct 7 08:56 .
drwxrwxr-x 3 travis travis 4096 Oct 7 08:55 ..
-rw-rw-r-- 1 travis travis 3217 Oct 7 08:55 CODE_OF_CONDUCT.md
-rw-rw-r-- 1 travis travis 2586 Oct 7 08:55 CONTRIBUTING.md
-rw-rw-r-- 1 travis travis 35143 Oct 7 08:55 COPYING
-rw-rw-r-- 1 travis travis 24109 Oct 7 08:56 .coverage
-rw-rw-r-- 1 travis travis 23 Oct 7 08:55 .coveragerc
drwxrwxr-x 4 travis travis 4096 Oct 7 08:55 docs
drwxrwxr-x 8 travis travis 4096 Oct 7 08:55 .git
-rw-rw-r-- 1 travis travis 805 Oct 7 08:55 .gitignore
-rw-rw-r-- 1 travis travis 29 Oct 7 08:55 .isort.cfg
-rw-rw-r-- 1 travis travis 2706 Oct 7 08:55 Makefile
-rw-rw-r-- 1 travis travis 346 Oct 7 08:55 MANIFEST.in
-rw-rw-r-- 1 travis travis 550 Oct 7 08:55 .pre-commit-config.yaml
-rw-rw-r-- 1 travis travis 150 Oct 7 08:55 pytest.ini
-rw-rw-r-- 1 travis travis 8530 Oct 7 08:55 README.rst
-rw-rw-r-- 1 travis travis 315 Oct 7 08:55 requirements_readthedocs.txt
-rwxrwxr-x 1 travis travis 1958 Oct 7 08:55 runtests.py
-rw-rw-r-- 1 travis travis 179 Oct 7 08:55 setup.cfg
-rwxrwxr-x 1 travis travis 2623 Oct 7 08:55 setup.py
drwxrwxr-x 4 travis travis 4096 Oct 7 08:56 src
-rw-rw-r-- 1 travis travis 656 Oct 7 08:55 SUPPORT.rst
drwxrwxr-x 3 travis travis 4096 Oct 7 08:55 testproject
drwxrwxr-x 7 travis travis 4096 Oct 7 08:56 tests
drwxrwxr-x 4 travis travis 4096 Oct 7 08:55 .tox
-rw-rw-r-- 1 travis travis 1263 Oct 7 08:55 tox.ini
-rw-rw-r-- 1 travis travis 766 Oct 7 08:55 .travis.yml
drwxrwxr-x 2 travis travis 4096 Oct 7 08:55 .tx
after_success.2
0.40s$ bash <(curl -s https://codecov.io/bash)
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-d109cc7
==> Travis CI detected.
project root: .
Yaml not found, that's ok! Learn more at http://docs.codecov.io/docs/codecov-yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
--> No coverage report found.
Please visit http://docs.codecov.io/docs/supported-languages
Done. Your build exited with 0.
Following this, I stopped using the source from https://codecov.io/bash
and switched to a Travis config with install: pip install codecov
+ after_success: codecov
.
That works.
I'm trying to upload multiple .coverage
files using the bash uploader.
I have tried specifying -s
to specify the location of each file, but this does not work, as the uploader always does a search from $git_root
, and always finds the first file.
See: https://circleci.com/gh/riyazdf/cli/1900 (last step "Upload to Codecov")
==> Circle CI detected.
project root: .
Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage.txt bytes=447884
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
find: unrecognized: ./vendor/golang.org
BusyBox v1.26.2 (2017-06-11 06:38:32 GMT) multi-call binary.
Usage: find [-HL] [PATH]... [OPTIONS] [ACTIONS]
It finds no files to upload, so the reports are empty.
[mixer] Running shell script
curl -s https://codecov.io/bash
bash /dev/stdin -K
/ | | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / ` |/ _ / / _ \ \ / /
| || () | (| | __/ (| () \ V /
______/ _,|_|____/ _/
Bash-e4a745b
==> Jenkins CI detected.
And then nothing else. After some investigation I think the issue is in here
https://github.com/codecov/codecov-bash/blob/e4a745b/codecov#L416
I also find it really weird that the script still checks for CI even though I am passing in the arguments.
The last working version for us is:
https://github.com/codecov/codecov-bash/blob/d642346/codecov#L406
This is what I get on codacy: https://www.codacy.com/app/vladureche/miniboxing/file/638296884/coverage?bid=2211210&fileBranchId=2211210 (it's not showing missed statements, only the ones hit) and here's what I get on codecov: https://codecov.io/github/miniboxing/miniboxing-plugin/components/plugin/src/miniboxing/plugin/transform/minibox/inject/MiniboxDuplTreeTransformation.scala?ref=wip
I tried to debug the bash script, but afaict it's pushing all the data to the server. Maybe I'm wrong...
I'm working with a frontend to a much, much larger project. However both must be built together.
After finishing the build with --coverage
this leaves over 900 gcov files that get picked up by the codecov script. However only less than 150 of them are relevant to my project. This results in almost 800 files being scanned, uploaded, then discarded post upload as they don't exist in the repository.
Would it be possible to add the inverse to -g
for paths to filter for gcov
? Such as -G
, which would mean that only files paths that match the given expression get scanned.
This would speed up the collection + upload times from hours to minutes. For instance, see here where the first is 8MB, while the other is over 100MB!
https://codecov.io/gh/ibuclaw/GDC/commit/9225c1b868bbf456d19a5ac27796ec12bedc0348/builds
I am using bash script to upload coverage report with command bash <(curl -s https://codecov.io/bash)
from CircleCI.
It seems uploading tasks are always fail when commit comment is like Merge branch 'feature' of github.com:suguru/repository into master
.
Our logs show that something happened in commit parameter.
(query) branch=debug-test&commit=branch&build=1871.0&build_url=&tag=&slug=suguru/repository&yaml=&service=circleci&flags=&pr=&job=
==> Uploading reports
Pinging Codecov
Uploading to S3
bash <(curl -s https://codecov.io/bash) returned exit code 6
Sorry I don't have a better title. :)
bash <(curl -s https://codecov.io/bash) -X coveragepy -t <token>
/dev/fd/63: line 1: syntax error near unexpected token `newline'
/dev/fd/63: line 1: `<!DOCTYPE html>'
bash <(curl -s https://codecov.io/bash) -X coveragepy -t <token>
returned exit code 2
Action failed: bash <(curl -s https://codecov.io/bash) -X coveragepy -t <token>
The output above was from output on Circle CI. Jobs were otherwise working well today, the error just started showing up in the last few hours.
Because of security concerns I'd like to install this bash uploader instead of piping the output of a network call through bash. This leaves a couple of options with the current setup.
Are there any plans to add this to homebrew, apt, or other dependency managers?
Similar to the Node.js module codecov
, would be useful if the bash script accepted a coverage report from stdin
; e.g.,
$ cat ./lcov.info | bash <(curl -s https://codecov.io/bash) -F test
This would allow support for pipelining without the need to write to disk in order to upload.
`language: go
go:
This is my conf file. Nothing happens - I think it should be plug-n-play, but it's not :(
I am using codecov-bash (commit 5ca7b8c) on GitLab CI. I use the -t
parameter to provide the private token of my project on codecov.io. Unfortunately, this private token gets printed to stdout and thus is visible in the build log. Build logs are public on GitLab (I'm not sure what's the case for other build servers).
$ bash <(curl -s https://codecov.io/bash) -p $CI_PROJECT_DIR/target/site/jacoco/jacoco.xml -t $codecov_upload_token
...
==> Reading reports
+ ./target/site/jacoco/jacoco.xml bytes=2691
(query) package=bash-5ca7b8c&branch=feature/codecov&commit=5d994fbbf1dd6554a46a447758783d4f9820a49f&build=640242&build_url=&slug=pvorblab-ci-java-gradle-codecov.git&service=gitlab&pr=&job=&token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
...
I think this behavior should be avoided. When I first configured CI and code coverage I didn't notice that my private token got published.
My current workaround pipes all output of codecov-bash into sed, which filters the token from the output and then prints what's left.
Using the bash script in docker fails to get the config because by default most docker images don't have git installed.
I figured it out eventually, but a warning/error would have been nice.
When running against master
in our setup, neither $BRANCH_NAME
or $GIT_BRANCH
exist in the environment. As a result, codecov exits when trying to detect the branch:
+ search_in=.
+ '[' fddf '!=' '' ']'
+ say '\033[0;90m==>\033[0m Jenkins CI detected.'
+ echo -e '\033[0;90m==>\033[0m Jenkins CI detected.'
==> Jenkins CI detected.
+ service=jenkins
++ '[' '!' -z '' ']'
++ '[' '!' -z '' ']'
++ '[' '!' -z '' ']'
+ branch=
I'm not sure what changed, but this used to work fine a few months ago when I last tried.
Since commit 72c885f the script always uses the "gcov" executable instead of using the executable name provided with the -x parameter. Since I use gcc 5 in my project I need to execute "gcov-5" on travis.
After taking a quick look at the code it also looks as if the gcov arguments are ignored in the latest version since it has $gcovargs instead of $gcov_arg (line 486) and the osx line (line 462) doesn't have either, but I'm not familiar enough with the script to say if this is wrong or not.
Hi there,
I am not able to update the codecov coverage report using the bash script in a Jenkins pipeline. After executing my tests, I call the codecov-bash script as follows:
sh "curl -s https://codecov.io/bash | bash -s - -t ${TORM_CODECOV_TOKEN} || echo 'Codecov did not collect coverage reports'"
In the Jenkins console we can check that the bash script failed:
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-d109cc7
�[0;90m==>�[0m Jenkins CI detected.
Codecov did not collect coverage reports
Looking for some similar open issues, I found this #68. It seems that the problem is related with the way in which environment variables such as GIT_COMMIT
and GIT_BRANCH
are read. I tried to solve it changing my Jenkinsfile as follows, but still no luck:
def codecovArgs = '-K '
if (env.GITHUB_PR_NUMBER != '') {
codecovArgs += "-B ${env.GITHUB_PR_TARGET_BRANCH} " +
"-C ${env.GITHUB_PR_HEAD_SHA} " +
"-P ${env.GITHUB_PR_NUMBER} "
} else {
codecovArgs += "-B ${env.GIT_BRANCH} " +
"-C ${env.GIT_COMMIT} "
}
sh "curl -s https://codecov.io/bash | bash -s - ${codecovArgs} -t ${TORM_CODECOV_TOKEN} || echo 'Codecov did not collect coverage reports'"
Any idea? Thanks in advance.
Dear Project maintainer,
Thanks again for providing such a neat infrastructure for managing code coverage 👍
That said, trying to download the env
script using https://codecov.io/env (as explained in the testing-with-docker documentation) fails with the following response:
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta charset="utf-8">
<title>Application Error</title>
<style media="screen">
html,body,iframe {
margin: 0;
padding: 0;
}
html,body {
height: 100%;
overflow: hidden;
}
iframe {
width: 100%;
height: 100%;
border: 0;
}
</style>
</head>
<body>
<iframe src="https://d234q63orb21db.cloudfront.net/cd118a714294f80d079e8514f43792f519841d20/media/html/error.html"></iframe>
</body>
</html>
When you have a chance, could you have a look ?
Merci
Cc: @thewtex
Looking at
-- Debugging --
-d Dont upload and dump to stdin
-K Remove color from the output
-v Verbose mode
I think stdout
is what you refer to, actually. True?
I do not know if it will actually work in the end, but
The problem: i run codecov bash script with -x llvm-cov-3.8 -a gcov
, which i assume should produce what the script expects.
However, $gcov_exe
is also run with some hardcoded arguments: -pb
or -pbcu
Line 805 in ef00447
llvm-cov gcov
does not support them, and fails https://travis-ci.org/darktable-org/rawspeed/builds/198960321#L1115
Perhaps these -pb
or -pbcu
should be configurable somehow?
slug=$(git config --get remote.origin.url)
commit=$(git rev-parse HEAD)
To setup default data during uploading
One of codecov's key features is that for each PR, it tells you how it changes coverage compared to the current master branch. In order to do this, it needs to have some idea of what the coverage is on the master branch. Sometime in the last week or so, on my project Trio, codecov started miscalculating the master coverage as being ~95%, when my coverage is actually ~99%. Since codecov is still calculating coverage correctly for PRs, this means that it's now reporting that every PR is amazing and causing a big jump in coverage. For example, here's a PR that doesn't touch the code at all, but codecov reports is adding hundreds of lines of new coverage: python-trio/trio#388
Of course this makes the codecov reporting rather useless, since it's impossible to see actual PR-related coverage changes in the noise.
If you look at codecov's commit history for my master branch, then you can see that it's all of the "Merge pull request #XX from XX" commits that have the incorrect coverage.
It looks like the reason this is happening is that this project is tested on Appveyor (Windows), Travis (Linux), and Jenkins (MacOS). The commits with correct coverage show uploads from all three sources (example). The commits with incorrect coverage show uploads only from Appveyor (example), and the 95% is what you get if just running the tests on Windows.
So that all makes sense, but why are my merge commits apparently only getting tested on Windows? Well, they are getting tested on Linux and MacOS... here's a Travis log testing that same 4f65fa74 commit that I linked above. And if you scroll down to the bottom of the Travis log, you can see that coverage is being uploaded to codecov..... but the codecov-bash uploaded says Fixing merge commit SHA
and then from the URL at the bottom we can see that even though we were testing 4f65fa74, the coverage has been attributed to commit 87d2c9ca1e3 (which is one of the merge parents).
And then the reason I'm getting different behavior on Windows vs. Linux and MacOS is that on Windows, there is no bash so I'm using codecov-python, while on Linux and MacOS I'm using codecov-bash.
Looking over the recent commit history, the problem seems to be this recent commit: beaae435 (which is also in codecov-python, but I'm guessing that part hasn't been shipped yet). The idea of that commit is to replace a hacky-looking regex check for merges, with a more reliable check based on git parentage.
However, this is based on a fundamental misunderstanding of what that code is doing. It's purpose is not to detect merges in general; its purpose is specifically to detect the temporary refs/pull/XX/merge
merge commits that Github generates for testing PRs, which have a special auto-generated commit message. The special handling is only supposed to be triggered on these merges, not for all merges, and in particular not for merge commits that are actually pushed to master, as in my case. So I believe that this change should be reverted from both codecov-bash and codecov-python.
CC: @stevepeak @blueyed
Hi!
Without a license header in codecov I need to assume "all rights reserved" for a license. Is that true? Please add a license header stating what the license is. Thank you!
Best, Sebastian
Hi,
I'm using codecov in Android library written in Java and I have the following question:
How to configure codecov to stop failing PRs when coverage is decreased by the small value?
Here I have an exemplary pull request: pwittchen/ReactiveNetwork#153.
Here's is my codecov.yml
file: https://github.com/pwittchen/ReactiveNetwork/blob/master/codecov.yml
As you can see, code coverage was decreased by 1.8% and I set the threshold to 20%, so I expected my PR to fail when code coverage will by decreased by 20% or more, but the PR failed anyway. My configuration does not work as I expect.
Can you show me, how can I configure codecov in my project, so it won't fail my PR every time when code coverage is decreased by the value lower than 20%?
I'm looking forward to your reply.
PS. I don't know if this project is the correct place for this issue. If not, please show me the place where I can report my issue.
Kind Regards,
Piotr
I think there is no option to disable searching gcov files in project root. The project root contains multiple build dirs and I don't want to upload all of these.
example raport:
https://codecov.io/gh/lplewa/codecov_tests/src/7483e6bc6f4b96525eef5657370cae84e7bf8791/foo.c#L15
In the raport above, if in line 15 is "yellow" , but all his branches are green, what looks like the bug.
if we will check a uploaded raport we can find 4 branches where there should be only two
2: 15: if (c == 0) {
branch 0 taken 100% (fallthrough)
branch 1 taken 0%
branch 2 taken 0% (fallthrough)
branch 3 taken 100%
1: 16: ret += 4;
-: 17: } else {
1: 18: ret += 8;
-: 19: }
it happened because i compiled this code two times (with two separate binaries) - so i have two separate gcda//gcno files per one source file. When you call gcov command on this two gcda at once
we will get one gcov file with branch data merged in way showed above (imo it might be gcov bug)
anyway i did a try to generate manually gcov files to get separate file per gcda//gcno file
a result this experiment you can find here: https://codecov.io/gh/lplewa/codecov_tests/src/c5c2ca0746b3a3829711a0370c6a8b07764e5ce6/foo.c#L15
now there is two gcov files
first:
1: 15: if (c == 0) {
branch 0 taken 100% (fallthrough)
branch 1 taken 0%
1: 16: ret += 4;
-: 17: } else {
#####: 18: ret += 8;
-: 19: }
second:
1: 15: if (c == 0) {
branch 0 taken 0% (fallthrough)
branch 1 taken 100%
#####: 16: ret += 4;
-: 17: } else {
1: 18: ret += 8;
-: 19: }
in my opinion in this case "if" should be green, but is still yellow, so it's seems that codecov didn't properly merged branching data.
also i did a test when i uploaded two separate raports - first for tests witch covers first branch, second raport for tests with covers second branch. Unfortunately if is still "yellow"
https://codecov.io/gh/lplewa/codecov_tests/src/ab9474598cd5af066227542962b205dd3cc5e9e4/foo.c
Can you fix merging branch data and add to codecov-bash script option to call gcov per gcda file (with -l flag to protect from file name conflict) instead of calling gcov for all gcda files at once.
Hi there. Now that #3 is merged, I could submit my coverage report.
However, when I go to https://codecov.io/github/zerovm/swift-browser?ref=87d20ee8e010b1e9172209dc8a0e742540654a95 -- the URL printed by the codecov
script, I see strange files I don't recognize. This is from a small AngularJS project built on Travis -- I have no idea who the "kpdecker" user could be.
Would the "raw" upload command be available (in particular for a Go
project with a coverage.txt
file)? Instead of running a shell download from the internet, some project might choose to use that instead. Thanks
In one of our Java apps, we have integration tests for permissions. Long story short, directories get created that are unreadable.
When codecov-bash recursively looks for coverage files, it bombs on these directories. I would expect the script to continue recursing through other directories rather than aborting the entire search.
(url) https://codecov.io
(root) .
==> Jenkins CI detected.
==> Running gcov (disable via -X gcov)
-> gcov in .
find: `./reach-engine-core/target/test/reachengine/scratch/bd9d1975-3c89-4b4a-b87a-3d51dcb79ece': Permission denied
find: `./reach-engine-core/target/test/reachengine/scratch/7f239d14-c036-43b5-8693-221940985df0': Permission denied
==> Searching for coverage reports
find: `./reach-engine-core/target/test/reachengine/scratch/bd9d1975-3c89-4b4a-b87a-3d51dcb79ece': Permission denied
find: `./reach-engine-core/target/test/reachengine/scratch/7f239d14-c036-43b5-8693-221940985df0': Permission denied
Something went wrong with Codecov.io coverage upload.
FWIW, I do know about -s DIR
. I'm going to add this to my CI as a patch, but it interferes with the ease-of-use that I so much like about codecov-bash.
The current test suite fails, which impedes the ability to make enhancements/fixes.
The file which is now at https://codecov.io/bash has VERSION="d109cc7"
I have a version cached 10 days ago, which has the same version, but is different to the "latest" on.
Here is the diff.
I think that the version on https://codecov.io/bash should have a different VERSION
diff --git a/tools/codecov.sh b/tools/codecov.sh
index f47caf7..4021502 100755
--- a/tools/codecov.sh
+++ b/tools/codecov.sh
@@ -1207,6 +1207,15 @@ do
fi
done <<< "$(echo -e "$files")"
+if [[ $(find $upload_file -type f -size +104857600c 2>/dev/null) ]]; then
+ say "${r}-->${x} Sorry, the resulting file is to large for uploading."
+ say " We are working on a solution for large files and will remove this message"
+ say " when we have resolved the issue. Thank you for your patience."
+ say " Max upload size is 100mb."
+ curl https://codecov.io/log?$query 2>/dev/null >/dev/null
+ exit ${exit_with};
+fi
+
if [ "$fr" = "0" ];
then
say "${r}-->${x} No coverage data found."
While following the documentation for Testing with docker(Codecov outside docker) I retrieve 400
response(s) when uploading report.
It could be interesting to know that I'm trying this in Docker cloud(autotesting)
(Note that I've replaced some uninteresting config specific values with <SOMETHING>
)
As stated in the documentation(linked above) I run bash <(curl -s https://codecov.io/bash)
as a final step.
Running with the yaml config file:
.codecov.yml
codecov:
branch: develop
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
require_base: no
require_head: yes
branches: null
I get this result:
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-e3f8e98
==> Docker detected.
project root: .
--> token set from env
Yaml found at: .codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Appending build variables
+ IMAGE_NAME
==> Reading reports
+ ./coverage-vol/coverage.xml bytes=41817
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=develop&commit=<HASH>&build=&build_url=&name=&tag=latest&slug=index.docker.io%2F<ORG NAME>%2F<REPO NAME>&service=docker&flags=&pr=&job=
-> Pinging Codecov
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
/dev/fd/63: line 1441: echo: write error: Broken pipe
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Uploading to Codecov
HTTP 400
slug must match pattern ^[\w\-\.]{1,255}\/[\w\-\.]{1,255}$
I've tried another run by changing the slug
value by setting it through the .codecov.yml
file. This run results in the following:
.codecov.yml
codecov:
slug: <ORG NAME>/<REPO NAME>
branch: develop
comment:
layout: "reach, diff, flags, files"
behavior: default
require_changes: false
require_base: no
require_head: yes
branches: null
I get this result:
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-e3f8e98
==> Docker detected.
project root: .
--> token set from env
Yaml found at: .codecov.yml
--> slug set from yaml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Appending build variables
+ IMAGE_NAME
==> Reading reports
+ ./coverage-vol/coverage.xml bytes=41817
==> Appending adjustments
http://docs.codecov.io/docs/fixing-reports
-> No adjustments found
==> Gzipping contents
==> Uploading reports
url: https://codecov.io
query: branch=develop&commit=<HASH>&build=&build_url=&name=&tag=latest&slug=<ORG NAME>%2F<REPO NAME>&service=docker&flags=&pr=&job=
-> Pinging Codecov
/dev/fd/63: line 1441: echo: write error: Broken pipe
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Pinging Codecov
/dev/fd/63: line 1441: echo: write error: Broken pipe
-> Uploading
X> Failed to upload
-> Sleeping for 30s and trying again...
-> Uploading to Codecov
HTTP 400
service must be ci-provider
Just as an FYI with many files (atm 162) codecov-bash takes a quite noticable time to read all reports. In fact compiling all those files is about as fast as codecov ;-)
See e.g. this build:
https://circleci.com/gh/dlang/phobos/13
(when watched "live" it felt like it spent all the time on "reading the reports")
Codecov
(version) cd5c049
(url) https://codecov.io
==> No CI detected, using git for branch and commit sha.
Wercker Steps - setup enviroment
http://devcenter.wercker.com/docs/environment-variables/available-env-vars.html
export CI="true" // not True
codecov-bash
elif [ "$CI" = "True" ] && [ "$WERCKER_GIT_BRANCH" != "" ];
then
say "==> Wercker CI detected."
# http://devcenter.wercker.com/articles/steps/variables.html
query="service=wercker\
&branch=$WERCKER_GIT_BRANCH\
&build=$WERCKER_MAIN_PIPELINE_STARTED\
&slug=$WERCKER_GIT_OWNER/$WERCKER_GIT_REPOSITORY\
&commit=$WERCKER_GIT_COMMIT"
wercker.yml
export CI="True" // add this line; working properly
bash <(curl -s https://codecov.io/bash)
Here's my full output of calling codecov-bash:
$ bash <(curl -s https://codecov.io/bash) -p $CI_PROJECT_DIR -t $codecov_upload_token || echo "Codecov did not collect coverage reports"
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
5ca7b8c
(url) https://codecov.io
(root) .
==> GitLab CI detected.
==> Trying gcov (disable via -X gcov)
-> Running gcov
==> Searching for coverage reports
**> Python coverage not found
==> Detecting git/mercurial file structure
==> Reading reports
+ ./target/site/jacoco/jacoco.xml bytes=2806
(query) package=bash-5ca7b8c&branch=feature/codecov&commit=1921b64c41af1819966877003ba9e1780da9cf45&build=640303&build_url=&slug=pvorblab-ci-java-gradle-codecov.git&service=gitlab&pr=&job=&token=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
==> Uploading reports
Pinging Codecov
Uploading to S3
Codecov did not collect coverage reports
I obfuscated the token in the output (see #22).
What might be the cause of the problem? I can't really tell from the output, but the code tells me that either "Reports queued to [...]" or "Failed to upload to s3" should be printed after "Uploading to S3".
It looks like this commis broke the script. Now if fails on Circle CI. Here is a CI log:
#!/bin/bash -eo pipefail
bash <(curl -s https://codecov.io/bash) -cF jasmine1
_____ _
/ ____| | |
| | ___ __| | ___ ___ _____ __
| | / _ \ / _` |/ _ \/ __/ _ \ \ / /
| |___| (_) | (_| | __/ (_| (_) \ V /
\_____\___/ \__,_|\___|\___\___/ \_/
Bash-8ba5469
==> Circle CI detected.
project root: .
--> token set from env
Yaml found at: codecov.yml
==> Running gcov in . (disable via -X gcov)
==> Python coveragepy not found
==> Searching for coverage reports in:
+ .
-> Found 1 reports
==> Detecting git/mercurial file structure
==> Reading reports
+ ./coverage/karma/HeadlessChrome 0.0.0 (Linux 0.0.0)/lcov.info bytes=223972
basename: extra operand '(Linux'
Try 'basename --help' for more information.
Exited with code 1
Feature request for codecov bash script:
codecov.yml
files when source control is unavailablecodecov.yml
was not found when it's not (eg. "We couldn't find .git or .hg directories, so we only looked in the project-root directory")Figuring out why codecov.yml wasn't being found sucked up a few hours of my and my coworker's time.
Our builds are in CodeShip Pro; since it's a Docker build, the .git
directory is unavailable. Codecov's bash script says Yaml not found!
despite it being present in the current directory (the problem was actually that .git
is unavailable).
Here's the code in the bash script that is causing this problem for us:
yaml=$(cd "$git_root" && \
git ls-files "*codecov.yml" "*codecov.yaml" 2>/dev/null \
|| hg locate "*codecov.yml" "*codecov.yaml" 2>/dev/null \
|| echo '')
yaml=$(echo "$yaml" | head -1)
Related: #84
When you run coverage
from a virtual environment the bash script skips the .coverage
file since which coverage
doesn't return a valid path.
CircleCI 2.0, currently in closed beta, supports Docker out-of-the-box. It brings a lot of nice improvements.
However, there are changes in environment variables. The variables CIRCLE_PROJECT_USERNAME
and CIRCLE_PROJECT_REPONAME
has been removed.
I have added support in Node version here: codecov/codecov-node#46
I am not that familiar with bash scripting, I will leave this as an issue. Thanks!
I suspect this is the culprit of an error I’m seeing, but I’m not 100% sure. The error is here: https://travis-ci.org/zbeekman/json-fortran/jobs/66252248#L1519 which in turn implicates https://github.com/codecov/codecov-bash/blob/master/codecov#L328 But, L328 should not cause a problem if an executable named coverage
exists, and this is checked for in line 321 which leads me to suspect that this test is incorrectly thinking that the coverage program is present when it is not.
Why not just test the return status of the which
command? It seems fragile to test against a specific output string. I think this would be more robust:
if which coverage >/dev/null 2>&1; then
…
else
…
fi
From the man page:
Which returns the number of failed arguments, or -1 when no `programname´ was given.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.