aboutsummaryrefslogtreecommitdiffstats
path: root/python/servo/testing_commands.py
Commit message (Collapse)AuthorAgeFilesLines
* tidy: A few small improvements and fixes (#30941)Martin Robinson2024-01-021-12/+10
| | | | | | | | | | 1. Make the tidy output easier to follow 2. Integrate the WPT manifest cleanliness step into tidy itself and don't run it if nothing has changed in the WPT directory. 3. Fix an issue where Python test requirements were not installed, which could cause issues with some modules not being found. Fixes #30002.
* Integrate hyper_serde into Servo source (#30803)Martin Robinson2023-12-141-0/+1
| | | | | | | hyper_serde changes very infrequently and typically only in order to upgrade Servo dependencies. crates.io lists hyper_serde as having no dependents, and its integration will not prevent releasing new versions. Integrating it will both reduce the number of repositories we have to maintain as well as making it easier to upgrade Servo dependencies.
* Compile Servo with the latest version of rust stable (#30831)Martin Robinson2023-12-061-2/+8
| | | | | | | | | | | | | | | | This completes the transition to compiling Servo with rust stable. Some nightly-only features are still used when compiling the `script` and `crown` crates, as well as for some style unit tests. These will likely break with newer compiler versions, but `crown` can be disabled for them conditionally. This is just the first step. This has some caveats: 1. We need to disable setting up the special linker on Linux. The -Z option isn't supported with stable rust so using this is out -- meanwhile we can't be sure that lld is installed on most systems. 2. `cargo fmt` still uses some unstable options, so we need to rely on the unstable toolchain just for running `fmt`. The idea is to fix this gradually.
* Replace script_plugins with a clippy like rustc driver (named crown) (#30508)Samson2023-12-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove script_plugins * Use crown instead of script_plugins * crown_is_not_used * Use crown in command base * bootstrap crown * tidy happy * disable sccache * Bring crown in tree * Install crown from tree * fix windows ci * fix warning * fix mac libscript_plugins.dylib is not available anymore * Update components/script/lib.rs Co-authored-by: Martin Robinson <mrobinson@igalia.com> * Update for nightly-2023-03-18 Mostly just based off https://github.com/servo/servo/pull/30630 * Always install crown it's slow only when there is new version * Run crown test with `mach test-unit` * Small fixups; better trace_in_no_trace tests * Better doc * crown in config.toml * Fix tidy for real * no sccache on rustc_wrapper * document rustc overrides * fixup of compiletest * Make a few minor comment adjustments * Fix a typo in python/servo/platform/base.py Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com> * Proper test types * Ignore tidy on crown/tests --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* Add `--production` option to mach (#30707)Samson2023-11-101-2/+10
| | | | | | | | | | | * --prod(uction) mach argument * Use profile in workflows instead of production * Use profiles in unit tests * ups * Build (${{ inputs.profile }})
* Remove `__future__` imports that are no longer necessary (#30661)Martin Robinson2023-11-021-2/+0
| | | These are no longer necessary as we always use Python 3.
* Stop using distutils (#30638)Martin Robinson2023-10-281-2/+1
| | | | This is removed from Python 3.12 so we can no longer rely on it. All of this functionality is either in `setuptools` or `shutil`.
* Adjust the missing taplo message (#30473)Martin Robinson2023-10-031-3/+1
| | | | The current message doesn't have a line break where you would expect it to and instead has a gap due to the indentation of the code in Python.
* Update WebGPU CTS (#30454)Samson2023-09-301-0/+2
| | | | | | | * Fix webgpu-cts import script * Update webgpu-cts to https://github.com/gpuweb/cts/commit/f2b59e03621238d0d0fd6305be2c406ce3e45ac2 * Updated expectations
* Enforce formatting of TOML files (#30128)Samson2023-09-191-2/+21
| | | | | | | | | * Fmt all toml files * bootstrap taplo * enforce toml formatting with taplo * Install taplo in CI using cargo-install action
* Move user input logic into servoshell (#30238)Atbrakhi2023-09-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * cleanup and move user input logix into servoshell * fix fmt * moves test from servoshell file * move command-line args into servoshell * remove feature media-gstreamer * fix fmt * move user input logic code into lib to make it more testable * remove opts_matches in fn instead get it from main2 * remove pub and fix import * add licence in new file * revert passing Matches, instead pass Option String * review update, also move sanitize fn to parser file * fmt fix * review fix: remove extra line
* Upgrade whole webgpu stack (#29795)Samson2023-08-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Allow noidl files in script/dom/webidls * Upgrade wgpu to 0.16 and refresh whole webgpu implementation * Update WebGPU test expectations * misc * MutNullableDom -> DomRefCell<Option<Dom for GPUTexture * Direct use of GPUTextureDescriptor * Remove config from GPUCanvasContext * misc * finally blue color * gpubuffer "handle" error * GPU object have non-null label * gpu limits and info * use buffer_size * fix warnings * Cleanup * device destroy * fallback adapter * mach update-webgpu write webgpu commit hash in file * Mising deps in CI for webgpu tests * Updated expectations * Fixups * early reject * DomRefCell<Option<Dom -> MutNullableDom for GPUTexture
* Make the `--release`/`--dev` more consistent and less surprising (#30091)Martin Robinson2023-08-141-88/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were some issues with the way that the `--release` and `--dev` arguments were handled in mach commands. - Not all commands accepted them in the same way. For instance `./mach test-wpt` didn't really accept them at all. - If you did not pass either of them, mach would try to guess which build you meant. This guess was often quite surprising as it wasn't printed and it depended on the state of the your target directory, which is difficult to remember. - The `dev` profile is colloquially called a "debug" profile and some commands accepted `-d` or `--debug...` like arguments, but `--debug` with `./mach run` meant run in a debugger. It was easy to mix this up. This change: - Centralizes where build type argument processing happens. Now it the same shared decorator in CommandBase. - Uses a `BuildType` enum instead of passing around two different booleans. This reduces the error checking for situations where both are true. - Be much less clever about guessing what build to use. Now if you don't specify a build type, `--dev` is chosen. I think this behavior matches cargo. - Makes it so that `./mach test-wpt` accepts the exact same arguments and has the same behavior as other commands. In addition, the suite correct for `test-wpt` is removed. There are only two suites now and it's quite unlikely that people will confuse WPT tests for rust unit tests.
* Make rustup a requirement and switch to `rust-toolchain.toml` (#30056)Martin Robinson2023-08-011-12/+2
| | | | | | | | | | | | | | This change makes rustup a requirement for building Servo with `./mach` and switches to the newer `rust-toolchain.toml` format. The goal here is to make mach builds more similar to non-mach builds. - The new format allows listing the required components, removing some of the complexity from our mach scripts. - This means we must raise the required version of rustup to 1.23. The current version is 1.26. - We no longer wrap every call to cargo and rustc in "rustup run" calls as both cargo and rustc will take care of installing and using all necessary components specified in `rust-toolchain.toml` when run inside the project directory.
* Run unit tests with both layout 2013 and layout 2020 (#30032)Oriol Brufau2023-07-271-6/+3
| | | | | | | | Since #29950, unit tests were only running with the legacy layout, and there was no way to run them for layout 2020. This patch makes './mach test-unit' run unit tests for both. Also doing some changes so that the layout 2020 floats.rs tests compile.
* Remove UWP / Hololens supportMartin Robinson2023-07-051-31/+4
|
* Auto merge of #29934 - mrobinson:move-third-party, r=atbrakhibors-servo2023-06-301-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a top-level "third_party" directory This directory now contains third_party software that is vendored into the Servo source tree. The idea is that it would eventually hold webrender and other crates from mozilla-central as well with a standard patch management approach for each. <!-- 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] These changes do not require tests because this should not change behavior. <!-- 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. -->
| * Create a top-level "third_party" directoryMartin Robinson2023-06-301-2/+2
| | | | | | | | | | | | | | This directory now contains third_party software that is vendored into the Servo source tree. The idea is that it would eventually hold webrender and other crates from mozilla-central as well with a standard patch management approach for each.
* | Auto merge of #29947 - mrobinson:update-mozangle, r=jdmbors-servo2023-06-301-1/+13
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update mozangle, cc, and cmake This also moves some environment variable configuration to the shared `build_env()` method, because previously clang was only being chosen for running `./mach build` and not `./mach test-unit` which was leading to rebuilds and thus build failures when running `test-unit`. I guess the cmake crate does not expect the compiler to change between subsequent runs. Fixes #29674 --- <!-- 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 do not require tests because they do not change behavior. <!-- 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. -->
| * Update mozangle, cc, and cmakeMartin Robinson2023-06-301-1/+13
| | | | | | | | | | | | | | | | | | This also moves some environment variable configuration to the shared `build_env()` method, because previously clang was only being chosen for running `./mach build` and not `./mach test-unit` which was leading to rebuilds and thus build failures when running `test-unit`. I guess the cmake crate does not expect the compiler to change between subsequent runs.
* | Auto merge of #29923 - mrobinson:test-scripts, r=jdmbors-servo2023-06-301-51/+51
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Combine all script tests into `test-scripts` Remove: - tidy self test support from `./mach test` - `./mach test-idl` Adds a `./mach test-scripts` command that is responsible for running all Python script tests. Run this during the CI to catch regressions in changes to scripts. The WebIDL tests are still *very* slow and there are from Gecko, so only run them when "-a" is passed meaning all tests. <!-- 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. -->
| * Combine all script tests into `test-scripts`Martin Robinson2023-06-291-51/+51
| | | | | | | | | | | | | | | | | | | | | | Remove: - tidy self test support from `./mach test` - `./mach test-idl` Adds a `./mach test-scripts` command that is responsible for running all Python script tests. Run this during the CI to catch regressions in changes to scripts. The WebIDL tests are still *very* slow and there are from Gecko, so only run them when "-a" is passed meaning all tests.
* | Update scripts to reflect new WPT directory nameMartin Robinson2023-06-261-4/+4
|/
* Collect build timings on GitHub CIMartin Robinson2023-06-231-18/+21
| | | | This will help to investigate slow builds on GitHub.
* Convert tidy to a non-egg Python packageMartin Robinson2023-06-151-4/+2
| | | | | | | | | | | It seems that servo-tidy is only used by webrender in my GitHub searches. WebRender could simply use `rustfmt` and the tidy on pypi hasn't been updated since 2018. Converting tidy to a normal Python package removes the maintenance burden of continually fixing the easy install configuration. Fixes #29094. Fixes #29334.
* Get clang-format from pip and upgrade to version 16Martin Robinson2023-06-081-32/+15
| | | | | | | | | This allows relying on a specific version of clang-format and no longer use any version checks. In addition, we can use --dry-run -Werror in order to avoid having to run against every file individually. Fix #29847. Fix #29846.
* Add webgpu cts vendoring mechanismsagudev2023-06-011-0/+51
|
* Remove more Python 2 compatibility codeMartin Robinson2023-05-291-4/+3
| | | | | | - os.environ is always `str` in Python 3. - The only string type is `str` so we can stop using `six.str_types`. - `iteritems()` isn't necessary because dicts have the `items()` method.
* Clean up cross-compilation and featuresMartin Robinson2023-05-251-2/+3
| | | | | | | | | | | | Integrate cross-compilation and media-stack handling into the `build_like_command_arguments` decorator. This removes a lot of repetition in the code and standardizes how targets are selected for all similar commands. Now cross compilation targets, feature flags, and helper variables are stored in the CommandBase instance. This also avoids having to continuously pass these arguments down to functions called by the commands.
* Implement `bootstrap-gstreamer` for all platformsMartin Robinson2023-05-251-13/+3
| | | | | | | | | | | | | | | | | | This change makes it so that the Platform classes can now handle installing GStreamer dependencies and properly setting up the environment including when cross-compiling. For Windows and Linux is now installed into `target/dependencies/gstreamer` when not installed system-wide. In addition: 1. Creating and moving existing environment path append helpers to `util.py`. 2. Combining the `set_run_env` and `build_dev` functions and moving some outside code into them so that it can be shared. Now code that used to call `set_run_env` calls `build_dev` and then `os.environ.update(...)`. 3. Adding Python typing information in many places. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* Auto merge of #29745 - mrobinson:compositor-side-scroll-tree, r=mukilanbors-servo2023-05-231-0/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a compositor-side scroll tree This will allow the compositor to properly chain scrolling requests up when a node has reached the extent of the scroll area. In addition, it removes the use of the deprecated WebRender `scroll()` API. This fixes scrolling on servo.org. --- <!-- 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 #29402. - Fix #27996. - Fix #27624. - Fix #24028. - Fix #23918. - Fix #21165. - [x] There are tests for these changes
| * Add a compositor-side scroll treeMartin Robinson2023-05-191-0/+1
| | | | | | | | | | | | This will allow the compositor to properly chain scrolling requests up when a node has reached the extent of the scroll area. This fixes scrolling on servo.org.
* | Auto merge of #29754 - mrobinson:organize-python-by-platform, r=mukilanbors-servo2023-05-191-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Start organizing platform-specific Python code This starts to split platform-specific Python code into its own module, which should help to tidy up our mach commands and make things more reusable. This is step one toward fixing #25335. <!-- 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] These changes do not require tests because they just change mach scripts. <!-- 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. -->
| * | Start organizing platform-specific Python codeMartin Robinson2023-05-191-1/+1
| |/ | | | | | | | | | | This starts to split platform-specific Python code into its own module, which should help to tidy up our mach commands and make things more reusable.
* / Thread panics should be a hard-fail in smoketestsMartin Robinson2023-05-181-1/+4
|/ | | | | | | This prevents, for instance, a script thread panic from hanging Servo and means those kind of panics won't cause CI to hang. Fixes #29749.
* Reorganize Servo's WPT Python scriptsMartin Robinson2023-04-201-57/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Have all mach command accept "--with-layout-2020" and "--layout-2020"Martin Robinson2023-04-071-2/+2
| | | | | | Some command accepted one and some the other. This changes makes them all accept both so it's no longer necessary to remember which uses which.
* Aggregate unexpected results into logsMartin Robinson2023-02-141-0/+3
| | | | | | This makes it easier to run `update-wpt` based on results from the bots. A future version of this could aggregate all unexpected results that were not filtered as intermittents.
* Auto merge of #29294 - servo:integrate-filter-intermittents, r=delanbors-servo2023-01-271-114/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrate filter-intermittents into test-wpt This change integrates the `filter-intermittents` command into `test-wpt`. This is in preparation for future work on tracking intermittent failures. This change also: - Removes `ServoJsonFormatter` and replaces it with a generic WPT log handler which tracks unexpected results. - The intermittent filter is now controlled via environment variables and the GitHub version requires a token instead of credentials. - Output is saved to a single file and is always text. --- <!-- 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 do not require tests because they are changes to build infrastructure.
| * Integrate filter-intermittents into test-wptMartin Robinson2023-01-241-114/+7
| | | | | | | | | | | | | | | | | | | | | | This change integrates the filter-intermittents command into test-wpt. This is in preparation for future work on tracking intermittent failures. This change also: - Removes the SrvoJson logger and replaces it with a generic WPT log handler which tracks unexpected results. - The intermittent filter is now controlled via environment variables and the GitHub version requires a token instead of credentials. - Output is saved to a single file and is always text.
* | Update clangfmt version.Josh Matthews2023-01-241-1/+1
|/
* Simplify Python code for running WPT testsMartin Robinson2023-01-131-45/+7
| | | | | | | | | | | Combine `run.py` and `update.py` into `servowpt.py` in order to allow them to share code. Import them directly into the mach script to avoid having to call `compile` and `exec` on the code. This makes it clearer how they are executed. In addition, move all of the setup into `setupwpt.py` to avoid differences between tests executed via mach and not. Finally, be more ambitious when detecting the build to use. If none was specified, try to use the one that exists between "release" and "debug."
* mach filter-intermittents: add progress and --json output modeDelan Azabani2023-01-101-3/+17
|
* Remove unnecessary always succeed flagcybai2022-08-161-8/+2
|
* Run WPT sync nightly on GitHub Actioncybai2022-08-161-2/+14
|
* Update clangfmt version.Josh Matthews2022-08-061-1/+1
|
* update Ubuntu version check to > 21.10Gio de Guzman2021-12-151-1/+1
| | | | Update clang-format version check to use find() instead of startswith() to deal with distro-specific discrepancy
* chore(mach): update the required clang-format version to 13yvt2021-10-161-1/+1
|
* chore(mach): update the required clang-format version to 12yvt2021-10-041-1/+1
|
* Updat clang-fmt version check.Josh Matthews2021-02-191-1/+1
|