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

Reorganize Servo's WPT Python scripts #29639

Merged
merged 1 commit into from
Apr 23, 2023

Conversation

mrobinson
Copy link
Member

@mrobinson mrobinson commented Apr 17, 2023

This change moves all of Servo's WPT Python support scripts into one directory as they were previously scattered throughout the directory structure. This should allow more code reuse and make it easier to understand how everything fits together.

The changes:

  • tests/wpt/updatepython/wpt/importer
  • etc/ci/upstream-wpt-changes/wptupstreamerpython/wpt/exporter
  • etc/ci/upstream-wpt-changes/test.pypython/wpt/test.py
  • etc/ci/upstream-wpt-changes/testspython/wpt/tests
  • tests/wpt/servowpt.py → - python/wpt/update.py - python/wpt/run.py
  • tests/wpt/manifestupdate.pypython/wpt/manifestupdate.py

This change also removes

  • The ability to run the update-wpt and test-wpt commands without using mach. These didn't work very well, because it was difficult to get all of the wptrunner and mach dependencies installed outside of the Python virtualenv. It's simpler if they are always run through mach.
  • The old WPT change sync / upstreaming script that was no longer used. This allows this code to pass test-tidy now.

  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

@mrobinson mrobinson force-pushed the reorganize-wpt-python branch 2 times, most recently from 347b362 to 0b0d284 Compare April 17, 2023 09:08
import os
import sys

from .tree import GitTree, GeckoCommit
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious if there is any particular reason for retaining the 'gecko' terminology in this file (I see few more references to gecko in doc strings below).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. My thought was to only move the scripts now and then gradually start cleaning them up later. There are also some things that could be shared between the importer and exporter, once these two scripts are in the same module.

This change moves all of Servo's WPT Python support scripts into one
directory as they were previously scattered throughout the directory
structure. This should allow more code reuse and make it easier to
understand how everything fits together.

The changes:

- `tests/wpt/update` → `python/wpt/importer`
- `etc/ci/upstream-wpt-changes/wptupstreamer` → `python/wpt/exporter`
- `etc/ci/upstream-wpt-changes/test.py` → `python/wpt/test.py`
- `etc/ci/upstream-wpt-changes/tests` → `python/wpt/tests`
- `tests/wpt/servowpt.py` →
    - `python/wpt/update.py`
    - `python/wpt/run.py`
- `tests/wpt/manifestupdate.py` → `python/wpt/manifestupdate.py`

This change also removes
 - The ability to run the `update-wpt` and `test-wpt` commands without
   using `mach`. These didn't work very well, because it was difficult
   to get all of the wptrunner and mach dependencies installed outside
   of the Python virtualenv. It's simpler if they are always run through
   `mach`.
- The old WPT change upstreaming script that was no longer used.
Copy link
Member

@mukilan mukilan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice refactoring! Thank you for the walkthrough, @mrobinson !

@mrobinson
Copy link
Member Author

@bors-servo r=mukilan

@bors-servo
Copy link
Contributor

📌 Commit e2cf3e8 has been approved by mukilan

@bors-servo
Copy link
Contributor

⌛ Testing commit e2cf3e8 with merge 9638b38...

@mrobinson
Copy link
Member Author

Thank you for the review!

@mrobinson
Copy link
Member Author

@bors-servo ping

@bors-servo
Copy link
Contributor

😪 I'm awake I'm awake

@bors-servo
Copy link
Contributor

💥 Test timed out

@mrobinson
Copy link
Member Author

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit e2cf3e8 with merge c0ddee0...

bors-servo added a commit that referenced this pull request Apr 21, 2023
Reorganize Servo's WPT Python scripts

This change moves all of Servo's WPT Python support scripts into one directory as they were previously scattered throughout the directory structure. This should allow more code reuse and make it easier to understand how everything fits together.

The changes:

- `tests/wpt/update` → `python/wpt/importer`
- `etc/ci/upstream-wpt-changes/wptupstreamer` → `python/wpt/exporter`
- `etc/ci/upstream-wpt-changes/test.py` → `python/wpt/test.py`
- `etc/ci/upstream-wpt-changes/tests` → `python/wpt/tests`
- `tests/wpt/servowpt.py` → - `python/wpt/update.py` - `python/wpt/run.py`
- `tests/wpt/manifestupdate.py` → `python/wpt/manifestupdate.py`

This change also removes
 - The ability to run the `update-wpt` and `test-wpt` commands without using `mach`. These didn't work very well, because it was difficult to get all of the wptrunner and mach dependencies installed outside of the Python virtualenv. It's simpler if they are always run through `mach`.
- The old WPT change sync / upstreaming script that was no longer used. This allows this code to pass `test-tidy` now.

<!-- Please describe your changes on the following line: -->

---
<!-- 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] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
@github-actions
Copy link

Results from try job (#4762390522):

Flaky unexpected result (25)
  • OK [expected TIMEOUT] /FileAPI/url/url-charset.window.html (#26997)
    • PASS [expected TIMEOUT] subtest: Blob charset should override any auto-detected charset.
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/linebox/inline-negative-margin-001.html (#23862)
    • FAIL [expected PASS] subtest: [data-expected-height] 1
    • FAIL [expected PASS] subtest: [data-expected-height] 2
    • PASS [expected FAIL] subtest: [data-expected-height] 4
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-002.html (#29057)
    • FAIL [expected PASS] subtest: elementFromPoint
  • TIMEOUT [expected PASS] /css/css-color/animation/opacity-animation-ending-correctly-002.html (#29216)
  • OK /css/css-flexbox/hittest-anonymous-box.html (#27091)
    • FAIL [expected PASS] subtest: Hit-testing within an anonymous flex-item should return the flexbox as the hittest result.
  • OK /css/css-flexbox/hittest-before-pseudo.html (#26521)
    • FAIL [expected PASS] subtest: Hit-testing text within a pseudo-element flex-item should return the flexbox as the hittest result.
  • FAIL [expected PASS] /css/css-text/line-breaking/segment-break-transformation-unremovable-1.html (#28758)
  • FAIL [expected PASS] /css/css-ui/accent-color-invalidation-currentcolor.html (#28690)
  • OK /css/cssom-view/elementFromPoint-001.html (#22452)
    • PASS [expected FAIL] subtest: CSSOM View - 5 - extensions to the Document interface
  • OK /css/cssom-view/elementFromPoint-float-in-table.html (#27002)
    • FAIL [expected PASS] subtest: float-in-div
  • OK /css/cssom-view/elementFromPoint-list-001.html (#23915)
    • FAIL [expected PASS] subtest: <li>Inside 1</li>
    • FAIL [expected PASS] subtest: <li>Image Inside 1</li>
    • FAIL [expected PASS] subtest: <li>Image Inside 2</li>
  • OK /css/cssom-view/elementFromPoint-subpixel.html (#23623)
    • PASS [expected FAIL] subtest: Hit test top left corner of box
  • OK /css/cssom-view/elementFromPoint-visibility-hidden-resizer.html (#28695)
    • FAIL [expected PASS] subtest: elementFromPoint on resizer area of an element with visibility:hidden
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/a-click.html (#28697)
    • PASS [expected FAIL] subtest: aElement.click() before the load event must NOT replace
  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/traverse-during-unload.html (#28688)
    • TIMEOUT [expected PASS] subtest: Traversing the history during unload
  • OK /html/browsers/history/the-history-interface/traverse_the_history_3.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals, last would be aborted
  • OK /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • FAIL [expected PASS] subtest: first argument: absolute url
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/skip-another-top-level-browsing-context.html (#24161)
    • TIMEOUT [expected PASS] subtest: Autofocus elements queued in another top-level browsing context's documents should be skipped.
  • TIMEOUT [expected OK] /html/semantics/forms/form-submission-0/reparent-form-during-planned-navigation-task.html
    • TIMEOUT [expected PASS] subtest: reparent-form-during-planned-navigation-task
  • TIMEOUT /html/webappapis/scripting/events/compile-event-handler-settings-objects.html (#24246)
    • PASS [expected FAIL] subtest: The entry settings object while executing the compiled callback via Web IDL's invoke must be that of the node document
  • ERROR [expected OK] /resource-timing/cors-preflight.any.html (#28694)
    • TIMEOUT [expected FAIL] subtest: PerformanceResourceTiming sizes fetch with preflight test
  • TIMEOUT [expected OK] /webaudio/the-audio-api/the-analysernode-interface/realtimeanalyser-fft-scaling.html (#21743)
  • TIMEOUT [expected OK] /webmessaging/without-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:
Stable unexpected results that are known to be intermittent (19)
  • OK /css/CSS2/floats/hit-test-floats-001.html (#23693)
    • PASS [expected FAIL] subtest: hit-test-floats-001
  • OK /css/CSS2/floats/hit-test-floats-003.html (#25733)
    • PASS [expected FAIL] subtest: Miss float below something else
  • OK /css/cssom-view/elementFromPoint-dynamic-anon-box.html (#22337)
    • FAIL [expected PASS] subtest: Link should be clickable after hiding a scrollbox with an anonymous table inside
  • OK /css/cssom-view/elementFromPosition.html (#21295)
    • PASS [expected FAIL] subtest: test some point of the element: top left corner
    • PASS [expected FAIL] subtest: test the top of layer
  • OK /css/cssom-view/elementsFromPoint-invalid-cases.html (#21338)
    • FAIL [expected PASS] subtest: The root element is the last element returned for otherwise empty queries within the viewport
  • OK [expected TIMEOUT] /fetch/api/basic/keepalive.any.html (#29536)
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected FAIL] subtest: border-image sec-fetch-site - HTTPS downgrade (header not sent)
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • FAIL [expected TIMEOUT] subtest: Navigating to a different document with link click
    • FAIL [expected NOTRUN] subtest: Navigating to a different document with form submission
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • FAIL [expected PASS] subtest: The document for a standalone media file should have one child in the body.
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals from the same task
  • CRASH [expected OK] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • OK /html/semantics/embedded-content/the-img-element/non-active-document.html (#21544)
    • PASS [expected FAIL] subtest: createHTMLDocument
    • PASS [expected FAIL] subtest: <template>
  • OK /html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html (#29634)
    • PASS [expected FAIL] subtest: Verifies that location navigations take precedence when following form submissions.
  • TIMEOUT [expected OK] /html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html (#23205)
    • NOTRUN [expected PASS] subtest: Check that rel=noopener with target=_self does a normal load
  • OK [expected TIMEOUT] /html/webappapis/scripting/processing-model-2/integration-with-the-javascript-job-queue/promise-job-entry-different-function-realm.html (#25805)
    • FAIL [expected TIMEOUT] subtest: Fulfillment handler on pending-then-fulfilled promise
    • FAIL [expected TIMEOUT] subtest: Rejection handler on pending-then-rejected promise
  • TIMEOUT [expected OK] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
  • TIMEOUT [expected CRASH] /webmessaging/broadcastchannel/cross-partition.https.tentative.html (#29058)
  • TIMEOUT [expected OK] /webmessaging/without-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe

@bors-servo
Copy link
Contributor

💔 Test failed - checks-github

@mrobinson
Copy link
Member Author

@bors-servo retry

@bors-servo
Copy link
Contributor

⌛ Testing commit e2cf3e8 with merge 2268a0f...

@github-actions
Copy link

Results from try job (#4778278795):

Flaky unexpected result (21)
  • OK /_mozilla/mozilla/task_queue_throttling.any.html (#22519)
    • FAIL [expected PASS] subtest: Throttling the performance timeline task queue.
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-uniform-packing-restrictions.html (#28103)
    • NOTRUN [expected PASS] subtest: Overall test
  • TIMEOUT [expected OK] /_webgl/conformance/glsl/misc/shader-with-non-reserved-words.html (#16216)
    • NOTRUN [expected PASS] subtest: Overall test
  • OK /css/CSS2/floats/hit-test-floats-002.html (#25733)
    • FAIL [expected PASS] subtest: Hit test float
  • OK /css/CSS2/floats/hit-test-floats-003.html (#25733)
    • PASS [expected FAIL] subtest: Miss float below something else
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-001.html (#29064)
    • FAIL [expected PASS] subtest: block-in-inline-hittest-001
  • OK /css/CSS2/normal-flow/block-in-inline-hittest-002.html (#29057)
    • FAIL [expected PASS] subtest: elementFromPoint
  • OK /css/CSS2/normal-flow/hit-test-anonymous-block.html (#25807)
    • FAIL [expected PASS] subtest: Hit test beside line of text inside anonymous block
  • PASS [expected FAIL] /css/css-backgrounds/background-attachment-fixed-inline-scrolled.html
  • OK /css/css-transitions/properties-value-inherit-002.html (#21486)
    • FAIL [expected PASS] subtest: color color(rgba) / values
    • FAIL [expected PASS] subtest: font-size length(pt) / values
    • FAIL [expected PASS] subtest: font-size length(pc) / values
    • FAIL [expected PASS] subtest: font-size length(px) / values
    • FAIL [expected PASS] subtest: font-size length(em) / values
    • FAIL [expected PASS] subtest: font-size length(ex) / values
    • FAIL [expected PASS] subtest: font-size length(mm) / values
    • FAIL [expected PASS] subtest: font-size length(cm) / values
    • FAIL [expected PASS] subtest: font-size length(in) / values
    • FAIL [expected PASS] subtest: font-size percentage(%) / values
    • And 40 more unexpected results...
  • OK /css/cssom-view/elementsFromPoint-invalid-cases.html (#21338)
    • FAIL [expected PASS] subtest: The root element is the last element returned for otherwise empty queries within the viewport
  • TIMEOUT [expected OK] /fetch/api/redirect/redirect-keepalive.any.html (#29536)
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-window-open.html (#28691)
    • PASS [expected FAIL] subtest: load event does not fire on window.open('about:blank')
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/javascript-url-referrer.window.html (#29081)
    • PASS [expected TIMEOUT] subtest: no-referrer referrer policy used to create the starting page
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-cross-origin.sub.window.html (#29056)
    • PASS [expected FAIL] subtest: Cross-origin navigation started from unload handler must be ignored
  • OK /html/browsers/browsing-the-web/navigating-across-documents/navigation-unload-same-origin.window.html (#29049)
    • PASS [expected FAIL] subtest: Same-origin navigation started from unload handler must be ignored
  • TIMEOUT [expected OK] /html/browsers/history/the-history-interface/traverse-during-unload.html (#28688)
    • TIMEOUT [expected PASS] subtest: Traversing the history during unload
  • OK /html/browsers/history/the-history-interface/traverse_the_history_1.html (#21383)
    • PASS [expected FAIL] subtest: Multiple history traversals from the same task
  • OK /html/semantics/forms/form-submission-0/urlencoded2.window.html (#28687)
    • PASS [expected FAIL] subtest: application/x-www-form-urlencoded: \n in value (normal form)
  • OK /html/semantics/forms/historical.html (#28568)
    • PASS [expected FAIL] subtest: <input name=isindex> should not be supported
  • OK [expected TIMEOUT] /webstorage/localstorage-about-blank-3P-iframe-opens-3P-window.partitioned.tentative.html (#29053)
    • PASS [expected TIMEOUT] subtest: StorageKey: test 3P about:blank window opened from a 3P iframe
Stable unexpected results that are known to be intermittent (22)
  • OK [expected TIMEOUT] /FileAPI/url/url-charset.window.html (#26997)
    • PASS [expected TIMEOUT] subtest: Blob charset should override any auto-detected charset.
  • TIMEOUT /FileAPI/url/url-in-tags-revoke.window.html (#19978)
    • FAIL [expected TIMEOUT] subtest: Opening a blob URL in a new window immediately before revoking it works.
  • OK /css/CSS2/floats/hit-test-floats-001.html (#23693)
    • PASS [expected FAIL] subtest: hit-test-floats-001
  • OK /css/CSS2/floats/hit-test-floats-005.html (#25804)
    • PASS [expected FAIL] subtest: Miss clipped float
  • OK /css/cssom-view/CaretPosition-001.html (#21338)
    • PASS [expected FAIL] subtest: Element at (400, 100)
  • OK /css/cssom-view/elementFromPoint-001.html (#22452)
    • PASS [expected FAIL] subtest: CSSOM View - 5 - extensions to the Document interface
  • OK /css/cssom-view/elementFromPoint-subpixel.html (#23623)
    • PASS [expected FAIL] subtest: Hit test top left corner of box
  • TIMEOUT /fetch/metadata/generated/css-images.sub.tentative.html (#29047)
    • PASS [expected FAIL] subtest: border-image sec-fetch-site - HTTPS downgrade (header not sent)
  • OK [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/iframe-src-aboutblank-navigate-immediately.html (#29048)
    • FAIL [expected TIMEOUT] subtest: Navigating to a different document with link click
    • FAIL [expected NOTRUN] subtest: Navigating to a different document with form submission
  • OK /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html (#28681)
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src=''
    • FAIL [expected PASS] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank'
    • PASS [expected FAIL] subtest: load & pageshow events do not fire on contentWindow of <iframe> element created with src='about:blank#foo'
  • OK /html/browsers/browsing-the-web/read-media/pageload-image-in-popup.html (#23849)
    • FAIL [expected PASS] subtest: The document for a standalone media file should have one child in the body.
  • TIMEOUT [expected OK] /html/browsers/the-window-object/open-close/creating_browsing_context_test_01.html (#29046)
    • TIMEOUT [expected PASS] subtest: first argument: absolute url
  • CRASH [expected OK] /html/browsers/windows/embedded-opener-remove-frame.html (#23867)
  • TIMEOUT [expected OK] /html/interaction/focus/the-autofocus-attribute/supported-elements.html (#24145)
    • TIMEOUT [expected FAIL] subtest: Host element with delegatesFocus including no focusable descendants should be skipped
    • NOTRUN [expected FAIL] subtest: Area element should support autofocus
  • TIMEOUT [expected OK] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_escaping-2.html (#22667)
    • TIMEOUT [expected FAIL] subtest: Check that popups from a sandboxed iframe escape the sandbox if
      allow-popups-to-escape-sandbox is used
  • OK [expected TIMEOUT] /html/semantics/embedded-content/the-iframe-element/iframe_sandbox_popups_nonescaping-3.html (#24066)
    • FAIL [expected NOTRUN] subtest: Check that popups from a sandboxed iframe do not escape the sandbox
  • OK /html/semantics/forms/form-submission-0/form-submit-iframe-then-location-navigate.html (#29634)
    • PASS [expected FAIL] subtest: Verifies that location navigations take precedence when following form submissions.
  • TIMEOUT [expected OK] /html/semantics/links/links-created-by-a-and-area-elements/htmlanchorelement_noopener.html (#23205)
    • NOTRUN [expected PASS] subtest: Check that rel=noopener with target=_self does a normal load
  • TIMEOUT [expected OK] /webaudio/the-audio-api/the-audiocontext-interface/audiocontext-not-fully-active.html (#27664)
  • TIMEOUT [expected CRASH] /webmessaging/broadcastchannel/cross-partition.https.tentative.html (#29058)
  • TIMEOUT [expected OK] /webmessaging/with-ports/017.html (#24486)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, about:blank
  • TIMEOUT [expected OK] /webmessaging/with-ports/018.html (#24485)
    • TIMEOUT [expected PASS] subtest: origin of the script that invoked the method, javascript:

@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: mukilan
Pushing 2268a0f to master...

1 similar comment
@bors-servo
Copy link
Contributor

☀️ Test successful - checks-github
Approved by: mukilan
Pushing 2268a0f to master...

@bors-servo bors-servo merged commit 2268a0f into servo:master Apr 23, 2023
10 checks passed
@mrobinson mrobinson deleted the reorganize-wpt-python branch April 23, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants