-
Notifications
You must be signed in to change notification settings - Fork 125
Retry code coverage upload 3 times and don't fail build #108
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
Changes from all commits
3266925
7817698
1c67a32
0ef91ea
6b7e1b8
7eb8e47
eba084f
0358b6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env node | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We might want to change the perms on this file so it's executable, similar to the |
||
|
||
const { execSilent } = require('./util'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shebang and wait for @lcampos for license comment :) |
||
|
||
/** | ||
* Script for publishing code coverage results to Codecov.io. Intended to run | ||
* during a CircleCI job. | ||
* | ||
* Not using path.join for the path to coverage report because in the Windows job, | ||
* this script runs with bash.exe to allow running the codecov.io publish script. | ||
* Hence using a Windows formatted path will confuse the process. | ||
*/ | ||
|
||
const MAX_ATTEMPTS = 3; | ||
|
||
let attempts = 0; | ||
|
||
do { | ||
try { | ||
const result = execSilent('curl -s https://codecov.io/bash | bash -s -- -f test-results/coverage/lcov.info'); | ||
console.log(result.stdout); | ||
break; | ||
} catch (e) { | ||
attempts += 1; | ||
let message = `Failed to publish coverage results on attempt ${attempts}`; | ||
if (attempts < MAX_ATTEMPTS) { | ||
message += ' - trying again...'; | ||
} | ||
console.log(message); | ||
console.log(e.message); | ||
} | ||
} while (attempts < MAX_ATTEMPTS); |
This file was 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.
Removed verifyTestArtifacts script because this used to help guard against silent compile errors in the test job. Now that we removed ts-node and compile tests in the build phase, we have that protection "built in" now.