Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 293522

Run phpcs in parallel in commit-code-check.sh

$
0
0

Problem/Motivation

phpcs has a --parallel option that significantly speeds up test runs by using multiple PHP processes. Compare:

$ time vendor/bin/phpcs -ps --standard=core/phpcs.xml.dist
............................................................    60 / 11909 (1%)
...
.............................                                11909 / 11909 (100%)


Time: 3 mins, 26.21 secs; Memory: 208MB


real	3m26.606s
user	3m21.222s
sys	0m3.417s

vs

$ time vendor/bin/phpcs -ps --standard=core/phpcs.xml.dist --parallel=$(nproc)
........ 8 / 8 (100%)


Time: 1 mins, 24.88 secs; Memory: 6MB


real	1m24.992s
user	6m56.904s
sys	0m6.074s

Steps to reproduce

Proposed resolution

Add --parallel=$(nproc) to the lines that invoke phpcs.

Remaining tasks

Check that the script still fails correctly when coding standards are not met.

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 293522

Trending Articles