Skip to content
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

improve test-tidy #21056

Merged
merged 1 commit into from Jun 20, 2018
Merged

improve test-tidy #21056

merged 1 commit into from Jun 20, 2018

Conversation

@tigercosmos
Copy link
Collaborator

tigercosmos commented Jun 15, 2018

check wpt manifest when run tidy

If CI has already run test-tidy, and then no need to run etc/ci/manifest_changed.sh


This change is Reviewable

@@ -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.

@CYBAI

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.

@tigercosmos

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.

@jdm

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.

@CYBAI

CYBAI Jun 15, 2018

Collaborator

@jdm oh! wow! Sounds a good solution for me!

This comment has been minimized.

@tigercosmos

tigercosmos Jun 15, 2018

Author Collaborator

Sounds good.

@tigercosmos tigercosmos changed the title pull request template for wpt [WIP] improve test-tidy Jun 15, 2018
@tigercosmos tigercosmos changed the title [WIP] improve test-tidy improve test-tidy Jun 15, 2018
@tigercosmos
Copy link
Collaborator Author

tigercosmos commented Jun 15, 2018

r? jdm

@highfive highfive assigned jdm and unassigned Manishearth Jun 15, 2018
@@ -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.

@CYBAI

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.

@tigercosmos

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.

@jdm

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.

@tigercosmos

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.

@tigercosmos

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.

@CYBAI

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.

@tigercosmos

tigercosmos Jun 17, 2018

Author Collaborator

sounds good to me

Copy link
Member

jdm left a comment

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.

@jdm

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.

@jdm

jdm Jun 19, 2018

Member

Let's remove manifest_changed.sh since no code uses it any more.

This comment has been minimized.

@tigercosmos

tigercosmos Jun 19, 2018

Author Collaborator

OK

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@tigercosmos could you change the commit message to read "Check WPT manifest when running test-tidy."?

@tigercosmos
Copy link
Collaborator Author

tigercosmos commented Jun 19, 2018

@jdm done

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

📌 Commit 80c41b4 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

Testing commit 80c41b4 with merge b7d44e0...

bors-servo added a commit that referenced this pull request Jun 19, 2018
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
Copy link
Contributor

bors-servo commented Jun 19, 2018

💔 Test failed - mac-rel-css2

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

Testing commit 80c41b4 with merge 01d5765...

bors-servo added a commit that referenced this pull request Jun 19, 2018
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
Copy link
Contributor

bors-servo commented Jun 19, 2018

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Jun 19, 2018

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2018

Testing commit 80c41b4 with merge 7f74513...

bors-servo added a commit that referenced this pull request Jun 19, 2018
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
Copy link
Contributor

bors-servo commented Jun 20, 2018

@bors-servo bors-servo merged commit 80c41b4 into servo:master Jun 20, 2018
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@tigercosmos tigercosmos deleted the tigercosmos:ttt branch Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.