-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add --all option to mach test-tidy, with compatibility with --faster
#11267
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
Add --all option to mach test-tidy, with compatibility with --faster
#11267
Conversation
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon. |
|
Heads up! This PR modifies the following files:
|
python/servo/testing_commands.py
Outdated
| @CommandArgument('--self-test', default=False, action="store_true", | ||
| help="Run unit tests for tidy") | ||
| def test_tidy(self, faster, no_progress, self_test): | ||
| def test_tidy(self, all, no_progress, self_test): |
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 shouldn't use all, since it's a built-in method in python.
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.
How do I make @CommandArgument map from --all to a different variable, like all_files? It doesn't appear to map by parameter index:
@Command('test-tidy',
description='Run the source code tidiness check on changed files',
category='testing')
@CommandArgument('--all', default=False, action="store_true",
help="Check all files, and run the WPT lint in tidy, "
"even if unchanged")
@CommandArgument('--no-progress', default=False, action="store_true",
help="Don't show progress for tidy")
@CommandArgument('--self-test', default=False, action="store_true",
help="Run unit tests for tidy")
def test_tidy(self, all_files, no_progress, self_test):
if self_test:
return test_tidy.do_tests()
else:
return tidy.scan(all_files, not no_progress)
Produces the output:
TypeError: test_tidy() got an unexpected keyword argument 'all'
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.
I'm not sure whether we can do that with mach. I believe the binding is brought into scope using the string we supply to the decorator. So, we should probably have something like --all-checks
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.
Figured it out! The dest option 😄
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.
That's great news! Thanks :)
|
This doesn't change the current behavior, since only the names of bindings have been changed. We should invert the |
|
Though This is the inverse of the current behaviour, and what I believe is expected :) |
|
I think the CI scripts should be updated to use --all |
|
New code was committed to pull request. |
.travis.yml
Outdated
| script: | ||
| - ./mach test-tidy --self-test | ||
| - ./mach test-tidy --no-progress | ||
| - ./mach test-tidy --no-progress --self-test |
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.
I'm not sure if this is a good idea.
I saw that buildbot_steps.yml has --no-progress with --self-test, and I'm assuming that they're supposed to be the same? Perhaps they just fell out-of-sync, with regard to parameters?
|
@mitchhentges The actual CI scripts live in the servo/saltfs repo, in the This also means that in order to keep full test coverage, this PR will need to be split in two - first we need to land a PR that adds the --all option while keeping --faster (without changing the default), then land a PR in saltfs to add the --all option to the CI scripts, then land a followup PR here to switch the default over (and get rid of --faster). |
|
Sure, no problem, I'll make this test only add |
python/tidy/servo_tidy/tidy.py
Outdated
| def scan(all=False, progress=True): | ||
| # standard checks | ||
| files_to_check = filter_files('.', faster, progress) | ||
| only_changed_files = not all |
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.
Sorry, I missed this in my first look 😅
03d94e7 to
316f9cb
Compare
|
New code was committed to pull request. |
mach test-tidy, with compatibility with --faster
|
And here's what it looks like, with different combos of parameters: |
|
New code was committed to pull request. |
|
|
||
| def filter_files(start_dir, faster, progress): | ||
| file_iter = get_file_list(start_dir, faster, ignored_dirs) | ||
| def filter_files(start_dir, only_changed_files, progress): |
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.
I changed this file a little bit, because I think that only_changed_files is a little more descriptive than faster
|
LGTM. r? @aneeshusa |
|
Maybe |
|
I think that I think it's OK now, with |
|
wfm |
|
This looks good to me, just needs a squash. A few comments:
|
|
@bors-servo r+ You can make the follow-up PR while we wait for this one to land. (Queue's a bit long today: http://build.servo.org/homu/queue/all) |
|
📌 Commit 29da462 has been approved by |
|
Already done :) |
|
Right, I meant a followup for the servo repo where we actually change the default over. I checked the saltfs PR and it LGTM, just waiting for this to land. Thanks again for the PR. |
|
💡 This pull request was already approved, no need to approve it again.
|
|
📌 Commit 29da462 has been approved by |
…eshusa Add --all option to `mach test-tidy`, with compatibility with --faster Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy --faster` does not report any errors - [X] These changes partially fix #11217 Either: - [ ] There are tests for these changes OR - [X] These changes do not require tests because it just affects `mach` script parameters Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11267) <!-- Reviewable:end -->
|
💔 Test failed - mac-rel-wpt |
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows are reusable. Rebuilding only mac-rel-wpt... |
|
@bors-servo retry
|
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows are reusable. Rebuilding only mac-rel-wpt... |
|
💔 Test failed - mac-rel-wpt |
|
|
⚡ Previous build results for android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, windows are reusable. Rebuilding only mac-rel-wpt... |
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
Use --all flag when running `./mach test-tidy` [`./mach test-tidy` should be `--faster` by default](servo/servo#11217). However, the [CI server should still check everything using the `--all` flag](servo/servo#11267 (comment)). This PR changes the CI server to use the `--all` flag, but shouldn't be merged until Servo's [`11267`](servo/servo#11267) gets merged, because `11267` adds `--all` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/saltfs/377) <!-- Reviewable:end -->
…husa Remove --faster flag from test-tidy, go fast by default. Fixes 11217 Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors - [X] These changes fix #11217 (github issue number if applicable). Either: - [ ] There are tests for these changes OR - [X] These changes do not require tests because they just change command-line options, which aren't tested Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. This finishes #11267 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11409) <!-- Reviewable:end -->
Thank you for contributing to Servo! Please replace each
[ ]by[X]when the step is complete, and replace__with appropriate data:./mach build -ddoes not report any errors./mach test-tidy --fasterdoes not report any errorsEither:
machscript parametersPull requests that do not address these steps are welcome, but they will require additional verification as part of the review process.
This change is