-
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
Tests: Clarify the travis tests using build stages #3150
Merged
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
06b3403
Tests: Clarify the travis tests using build stages
youknowriad a55eccc
Tests: Run linting and unit tests in separate stages
youknowriad 26039fe
Tests: Drop Travis matrix in favor or stages
youknowriad e527081
CI: Run everything in parallel
youknowriad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env bash | ||
|
||
cd "$(dirname "$0")/../" | ||
|
||
export PATH="$HOME/.composer/vendor/bin:$PATH" | ||
bash bin/install-wp-tests.sh wordpress_test root '' localhost $WP_VERSION | ||
source bin/install-php-phpunit.sh | ||
# Run the build because otherwise there will be a bunch of warnings about | ||
# failed `stat` calls from `filemtime()`. | ||
npm install || exit 1 | ||
npm run build || exit 1 | ||
# Make sure phpegjs parser is up to date | ||
node bin/create-php-parser.js || exit 1 | ||
if ! git diff --quiet --exit-code lib/parser.php; then | ||
echo 'ERROR: The PEG parser has been updated, but the generated PHP version' | ||
echo ' (lib/parser.php) has not. Run `bin/create-php-parser.js` and' | ||
echo ' commit the resulting changes to resolve this.' | ||
sleep .2 # Otherwise Travis doesn't want to print the whole message | ||
exit 1 | ||
fi | ||
echo Running with the following versions: | ||
php -v | ||
phpunit --version | ||
# Check parser syntax | ||
php lib/parser.php || exit 1 | ||
# Run PHPUnit tests | ||
phpunit || exit 1 | ||
WP_MULTISITE=1 phpunit || exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we need to execute
npm run build
here, too? It's executed as part ofbin/run-wp-unit-tests.sh
for every PHP version.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 was added later to the PHP unit tests to build the parser. If the parser is no longer built this way in the future (say a Pure PHP parser), this could be removed.
While keeping it here ensure the build is tested as part of the JS unit tests which is more logical to me.
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 moved lint out, so we could do the same with the build, and call
npm run test-unit:coverage-ci
directly from Travis. We can leave it as it is, too. I don't think it makes any difference in the end.