Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upimprove test-tidy #21056
improve test-tidy #21056
Conversation
| @@ -7,6 +7,9 @@ | |||
| - [ ] `./mach test-tidy` does not report any errors | |||
| - [ ] These changes fix #__ (github issue number if applicable). | |||
|
|
|||
| <!-- If you add new tests for wpt --> | |||
| - [ ] `./etc/ci/manifest_changed.sh` does not report any errors | |||
This comment has been minimized.
This comment has been minimized.
CYBAI
Jun 15, 2018
Collaborator
How about putting this checkbox under There are tests for these changes?
For example,
<!-- Either: -->
- [ ] There are tests for these changes
- [ ] `./etc/ci/manifest_changed.sh` does not report any errors
<!-- OR -->
- [ ] These changes do not require tests because _____
This comment has been minimized.
This comment has been minimized.
tigercosmos
Jun 15, 2018
Author
Collaborator
Put Either is good, but we need to mention that ./etc/ci/manifest_changed.sh is only for WPT
This comment has been minimized.
This comment has been minimized.
jdm
Jun 15, 2018
Member
What if we run the manifest_changed script as part of test-tidy if there are any files changed in test/wpt instead?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
r? jdm |
| @@ -319,6 +319,7 @@ def test_tidy(self, all_files, no_progress, self_test, stylo): | |||
| if self_test: | |||
| return test_tidy.do_tests() | |||
| else: | |||
| run_update(self.context.topdir, check_clean=True) | |||
This comment has been minimized.
This comment has been minimized.
CYBAI
Jun 16, 2018
Collaborator
I found the first diff in .travis.yml, we will run ./mach test-tidy --no-progress --self-test in Travis.
With the diff in this line, we won't check manifest_changed under --self-test.
So, if we removed bash etc/ci/manifest_changed.sh in it, then we won't check manifest changed.
Besides, it might be better to check manifest_changed when there's any WPT related file changes?
This comment has been minimized.
This comment has been minimized.
tigercosmos
Jun 16, 2018
Author
Collaborator
--self-test is for unit test. we don't need to update manifest for unit test.
I think the best way to detect WPT change is using manifest_changed, and this doesn't take much time, so this might be an Okay solution.
This comment has been minimized.
This comment has been minimized.
jdm
Jun 16, 2018
Member
Have you tested what happens now when you run ./mach test-tidy when the manifest does need updating? What does the output look like? I'm concerned that we suppress any non-zero return value from run_update right now.
This comment has been minimized.
This comment has been minimized.
tigercosmos
Jun 16, 2018
Author
Collaborator
@jdm you are right... error doesn't return non-zoro.
tigercosmos@ubuntu:~/servo$ ./mach test-tidy
0:11.98 INFO Diffing old and new manifests /home/tigercosmos/servo/tests/wpt/mozilla/meta/MANIFEST.json
0:12.47 INFO Diffing old and new manifests /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json
0:14.73 /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json 0 error core-aam/erer.html in source but not in manifest. (wpt-manifest)
0:14.99 ERROR Manifest /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json is outdated, use |./mach update-manifest| to fix.
Checking the config file...
Checking the wpt manifest file...
Checking directories for correct file extensions...
Checking files for tidiness...
Progress: 100% (3/3)
tidy reported no errors.
This comment has been minimized.
This comment has been minimized.
tigercosmos
Jun 16, 2018
•
Author
Collaborator
I have added system exit for this.
tigercosmos@ubuntu:~/servo$ ./mach test-tidy
0:09.36 INFO Diffing old and new manifests /home/tigercosmos/servo/tests/wpt/mozilla/meta/MANIFEST.json
0:09.71 INFO Diffing old and new manifests /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json
0:11.32 /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json 0 error core-aam/erer.html in source but not in manifest. (wpt-manifest)
0:11.49 ERROR Manifest /home/tigercosmos/servo/tests/wpt/metadata/MANIFEST.json is outdated, use |./mach update-manifest| to fix.
This comment has been minimized.
This comment has been minimized.
CYBAI
Jun 17, 2018
Collaborator
In my personal opinion, I'll prefer to keep run_update returning its status and check the status to exit the program here.
if self_test:
return test_tidy.do_tests()
else:
if run_update(self.context.topdir, check_clean=True):
sys.exit(1) # Maybe we can `return 1` instead?
return tidy.scan(not all_files, not no_progress, stylo=stylo)
# OR
if self_test:
return test_tidy.do_tests()
else:
return run_update(self.context.topdir, check_clean=True) and tidy.scan(not all_files, not no_progress, stylo=stylo)
This comment has been minimized.
This comment has been minimized.
|
The commit message no longer accurately describes the changes :) |
| @@ -319,6 +319,8 @@ def test_tidy(self, all_files, no_progress, self_test, stylo): | |||
| if self_test: | |||
| return test_tidy.do_tests() | |||
| else: | |||
| if run_update(self.context.topdir, check_clean=True): | |||
| sys.exit(1) | |||
| return tidy.scan(not all_files, not no_progress, stylo=stylo) | |||
This comment has been minimized.
This comment has been minimized.
jdm
Jun 19, 2018
Member
What if we do this instead:
manifest_dirty = run_update(self.context.topdir, check_clean=True)
tidy_failed = tidy.scan(not all_files, not no_progress, stylo=stylo)
return tidy_failed or manifest_dirty| @@ -27,5 +27,4 @@ env ./mach test-unit | |||
| env ./mach package --dev | |||
| env ./mach build --dev --no-default-features --features default-except-unstable | |||
| bash ./etc/ci/lockfile_changed.sh | |||
| bash ./etc/ci/manifest_changed.sh | |||
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@tigercosmos could you change the commit message to read "Check WPT manifest when running test-tidy."? |
|
@jdm done |
|
@bors-servo r+ |
|
|
improve test-tidy check wpt manifest when run tidy If CI has already run `test-tidy`, and then no need to run `etc/ci/manifest_changed.sh` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21056) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
improve test-tidy check wpt manifest when run tidy If CI has already run `test-tidy`, and then no need to run `etc/ci/manifest_changed.sh` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21056) <!-- Reviewable:end -->
|
|
|
@bors-servo retry |
improve test-tidy check wpt manifest when run tidy If CI has already run `test-tidy`, and then no need to run `etc/ci/manifest_changed.sh` <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21056) <!-- Reviewable:end -->
|
|
tigercosmos commentedJun 15, 2018
•
edited
check wpt manifest when run tidy
If CI has already run
test-tidy, and then no need to runetc/ci/manifest_changed.shThis change is