Skip to content

Commit

Permalink
Describe ./mach try and expand workflow for updating test results (#38
Browse files Browse the repository at this point in the history
)

* Add section on ./mach try

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Move and rephrase section about testing with release mode

Release mode is not just required when running the full suite,
for example the PBKDF2 tests in WebCryptoAPI/derive_bits will
consistently time out in development mode.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add section about partial test-wpt runs

Doing a full ./mach test-wpt run is really impractical,
because it takes a long time even in release mode
and causes tons of unrelated failures.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Specify that WPT test expectations are based on CI results

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Address review comments

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Ensure one sentence per line

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
  • Loading branch information
simonwuelker authored Dec 11, 2024
1 parent e79c3a8 commit 4fcfe2c
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions src/hacking/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,19 @@ to run all the DOM tests.

There are also a large number of command line options accepted by the test harness; these are documented by running with `--help`.

### Running all web tests
Running the WPT tests with a debug build often results in timeouts.
Instead, consider building with `mach build -r` and testing with `mach test-wpt -r`.

Running all the WPT tests with debug mode results in a lot of timeout.
If one wants to run all the tests, build with `mach build -r` and
test with `mach test-wpt --release`
### Running tests on your GitHub fork

Alternatively, you can execute the tests on GitHub-hosted runners using `mach try`.
Usually, `mach try wpt-2020` (all tests, linux, `layout-2020`) will be enough.

You can view the run results in your fork under the "Actions" tab.
Any failed tasks will include a list of stable unexpected results at the bottom of the log.
Unexpected results that are known-intermittent can likely be ignored.

When opening a PR, you can include a link to the run. Otherwise, reviewers will run the tests again.

### Running web tests with an external WPT server

Expand Down Expand Up @@ -192,6 +200,14 @@ Once the log is saved, run from the root directory:

./mach update-wpt /tmp/servo.log

Running *all* Web Platform Tests locally will take a long time and often cause unrelated failures (such as the runner exceeding the maximum number of open files on your system).
The test expectations are also set based on the results of Servo's CI machines, so differences in your setup might cause failures.

Usually you will have a rough idea where tests for your changes are.
For example, almost all tests for [SubtleCrypto](https://github.com/servo/servo/blob/63793ccbb7c0768af3f31c274df70625abacb508/components/script/dom/subtlecrypto.rs) code are in the [`WebCryptoAPI`](https://github.com/web-platform-tests/wpt/tree/550fb109615cf434b03b30b76aa0dea6bfb0ebe1/WebCryptoAPI) directory.
In this case you can run only these tests with `./mach test-wpt WebCryptoAPI`, followed by `./mach update-wpt` as described above.
To ensure that other tests didn't break, do a [try run](#running-tests-on-your-github-fork) afterwards.

## Writing new web tests

The simplest way to create a new test is to use the following command:
Expand Down

0 comments on commit 4fcfe2c

Please sign in to comment.