-
-
Notifications
You must be signed in to change notification settings - Fork 922
Use Brigade for coverage #1505
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
Use Brigade for coverage #1505
Conversation
meyerbaptiste
commented
Nov 21, 2017
Q | A |
---|---|
Bug fix? | no |
New feature? | no |
BC breaks? | no |
Deprecations? | no |
Tests pass? | I hope |
Fixed tickets | #1489 |
License | MIT |
Doc PR | N/A |
brigade.js
Outdated
'export COMPOSER_ALLOW_SUPERUSER=1', | ||
'curl -s -f -L -o /tmp/installer.php https://getcomposer.org/installer', | ||
'curl -s -f -L -o /tmp/install.sig https://composer.github.io/installer.sig', | ||
'php -r "\$signature = trim(file_get_contents(\'/tmp/install.sig\')); \$hash = hash(\'SHA384\', file_get_contents(\'/tmp/installer.php\')); if (!hash_equals(\$signature, \$hash)) { unlink(\'/tmp/installer.php\'); echo \'Integrity check failed, installer is either corrupt or worse.\' . PHP_EOL; exit(1); }"', |
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 use template strings? Would keep us from escaping the '
and allow multi lines on complex tasks like this one.
8765468
to
874b259
Compare
Shouldn't we handle the versions used (for php-code-coverage or coveralls for example) elsewhere? |
brigade.js
Outdated
const coverage = (event, project) => { | ||
console.log(`===> Building ${ project.repo.cloneURL } ${ event.commit }`); | ||
|
||
const job = new Job('coverage', 'php:rc-alpine'); |
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.
Maybe can you start from the composer
image directly?
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 I did in the DockerFile: https://gist.github.com/soyuka/6aa9da5649907372279a88e4eb0555ef
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.
We should use a custom Docker image stored on the coopTilleuls
account to save some CPU and speed up the builds.
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.
Done @dunglas. Can you please review?
@alanpoulain, in the end, we should probably use a pre-built Docker image containing all those tools to speed up the builds. |
Anyway, it doesn't work for now 😢 |
fa214ba
to
b677b33
Compare
It works! |
I'm glad that this is working, congrats @meyerbaptiste ! |
Wouhou! |
brigade.js
Outdated
const job = new Job('coverage', 'php:rc-alpine'); | ||
|
||
job.tasks = [ | ||
`set -xe`, |
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.
it's ok to use backticks for multiple lines but you can keep simple quotes here
But... the brigade commit status is a 404 URL and has Kevin's face on it 😄 |
What is the point of this by the way? 🤔 (Except the fancyness that I like 😛) |
We cannot compute the code coverage on Travis anymore (we consume too much resources). So we use Brigade to compute the coverage. |
A brigade with @dunglas as avatar is not something you see every day :p |
The full story: https://gist.github.com/soyuka/2c6d55da59b1ab74a9a92deed093df02 |
See brigadecore/brigade#126.
Yes it sounds weird but it's because the Github token used comes from @dunglas' account. Maybe we should create a specific account for API Platform? |
8a03f8c
to
3bcf2bc
Compare
ff06c86
to
9bed330
Compare
9bed330
to
c04904f
Compare
brigade.js
Outdated
'composer require --dev --no-update \'phpunit/php-code-coverage:^5.2.2\'', | ||
'composer update --prefer-dist --no-progress --no-suggest --ansi', | ||
'phpdbg -qrr vendor/bin/phpunit --coverage-php build/cov/coverage-phpunit.cov', | ||
'for f in $(find features -name \'*.feature\'); do FEATURE=${f//\\//_} phpdbg -qrr vendor/bin/behat --format=progress --profile coverage $f || exit $?; done', |
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.
here literals
brigade.js
Outdated
'set -xe', | ||
'cd /src/', | ||
'mkdir -p build/logs build/cov', | ||
'composer require --dev --no-update \'phpunit/php-code-coverage:^5.2.2\'', |
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.
here literals
brigade.js
Outdated
job.env = { | ||
'COVERALLS_RUN_LOCALLY': '1', | ||
'COVERALLS_REPO_TOKEN': project.secrets.coverallsToken, | ||
}; |
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.
quotes are not needed on keys
5d6cef9
to
bb5bcbe
Compare
🎆 thanks @meyerbaptiste! |
The 404 link is expected? |
🙊 🏃 |
@sroze anyway not a problem because this is only to keep the coverage up to date, we don't really care about the job itself :). |
Use Brigade for coverage