-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Framework: Improve Travis build performance #14289
Changes from all commits
33cd071
ef23f7b
f4c926a
d69d056
732f500
651d562
7f31ee4
da40885
6379756
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 |
---|---|---|
|
@@ -34,9 +34,12 @@ jobs: | |
install: | ||
- npm ci | ||
script: | ||
- npm run lint | ||
- npm run check-local-changes | ||
- npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory="$HOME/.jest-cache" | ||
- npm run build | ||
- $( npm bin )/concurrently --kill-others-on-fail \ | ||
"npm run lint" \ | ||
"npm run check-local-changes" \ | ||
"npm run check-licenses" \ | ||
"npm run test-unit -- --ci --maxWorkers=2 --cacheDirectory=\"$HOME/.jest-cache\"" | ||
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. I'd be interested in seeing what putting 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.
Yeah, this is what prompted my most recent thread comments in Slack. I agree that ideally they'd be defined as separate jobs, but it's not clear how to do that without increasing build times (kinda contrary to the point of the pull request). On the general topic of "making sense of the build output", there might be some other options to explore for organizing the results in a way which is more easy to read. Right now, the concurrent output is a bit of a mess, since it just spews everything to
I guess it depends if it's more in the interest of the developer to have faster build times, or a more thorough report of every issue in the build if there are multiple issues. I don't really have a strong leaning one way or the other, but I'd be inclined to think the former would benefit more people in the vast majority of cases. 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. Have you tested with |
||
|
||
- name: PHP unit tests (Docker) | ||
env: WP_VERSION=latest DOCKER=true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,8 @@ else | |
# Run the build because otherwise there will be a bunch of warnings about | ||
# failed `stat` calls from `filemtime()`. | ||
composer install || exit 1 | ||
npm install || exit 1 | ||
fi | ||
|
||
npm run build || exit 1 | ||
|
||
echo Running with the following versions: | ||
if [[ $DOCKER = "true" ]]; then | ||
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm wordpress_phpunit php -v | ||
|
@@ -32,8 +29,9 @@ fi | |
|
||
# Run PHPUnit tests | ||
if [[ $DOCKER = "true" ]]; then | ||
npm run test-php || exit 1 | ||
npm run test-unit-php-multisite || exit 1 | ||
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm composer run-script lint | ||
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. What's the reason for calling those commands directly rather than continue using 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.
I guess I assumed if we weren't installing dependencies, we shouldn't run npm scripts. In retrospect, it's probably not strictly a problem. Overall, it's part of a move of "we don't need NPM (or even Node) at all here", maybe even opening up future possibilities to avoid having it be installed in the environment at all. 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. Sounds good, should we keep those npm scripts moving forward? There might be value in it but I'm afraid that at some point they will diverge from what is added to Travis config. 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.
Agreed on the concern. I know I've used the NPM script variants, likely out of convenience / familiarity over what would be the |
||
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm wordpress_phpunit phpunit | ||
docker-compose $DOCKER_COMPOSE_FILE_OPTIONS run --rm -e WP_MULTISITE=1 wordpress_phpunit phpunit | ||
else | ||
phpunit || exit 1 | ||
WP_MULTISITE=1 phpunit || exit 1 | ||
|
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.
In #14432 I'm proposing changes which would ensure that we always use the source code to run unit tests. If that change lands, we could do one of the following:
npm run build
altogether from this jobbuild
folders aren't usedAs far as I remember, if we do (2) we would have quite good coverage for all our codebase both transpiled with Babel and original source code. In development, we would always use source code and on Travis we would use setup closer to what you have when using code from npm.