Skip to content

libservo: Stop using the custom test harness and run_api_tests#40131

Merged
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:fix-api-tests
Oct 24, 2025
Merged

libservo: Stop using the custom test harness and run_api_tests#40131
mrobinson merged 1 commit intoservo:mainfrom
mrobinson:fix-api-tests

Conversation

@mrobinson
Copy link
Copy Markdown
Member

The changes in #39812 seem to have completely disabled the API tests, so
this PR gets them running again by removing the custom test harness
(apart from the multiprocess test). The custom test harness is typically
not necessary now that all tests are run in their own process.

In addition, the behavior of the WebView::page_zoom() is fixed when
set via the viewport meta tag. This functionality was broken, but the
unit test wasn't catching it.

There is still one failing test, but that is tracked via #40129.

Testing: This change fixes the tests.

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Oct 24, 2025
@mrobinson
Copy link
Copy Markdown
Member Author

cc @jschwe

Copy link
Copy Markdown
Member

@jschwe jschwe left a comment

Choose a reason for hiding this comment

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

Ug, that unfortunate. I wonder what went wrong there. Sorry about that.
But I guess removing the custom harness where not necessary is anyway a good step.
I'll take a closer look after lunch

// my-test-2: test
// ```
if args.contains(&String::from("--list")) {
println!("test_multiprocess_preference_observer: test")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think we would want to exit here (and not run the test), otherwise an error in the test, would cause the test list gathering step to also fail.

// my-test-2: test
// ```
if args.contains(&String::from("--list")) {
println!("test_multiprocess_preference_observer: test")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we return here after printing the list of tests, to avoid increasing the runtime of the harness when only listing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh. Curious that this worked at all. This is fixed now.

println!("test_multiprocess_preference_observer: test")
}

test_multiprocess_preference_observer();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should this be guarded by a check on --nocapture --exact being present in args?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think it is better to be flexible in the arguments allowed and the order that they are delivered in. I believe that expecting them in a certain order was causing the issue in the first place.

The changes in servo#39812 seem to have completely disabled the API tests, so
this PR gets them running again by removing the custom test harness
(apart from the multiprocess test). The custom test harness is typically
not necessary now that all tests are run in their own process.

In addition, the behavior of the `WebView::page_zoom()` is fixed when
set via the `viewport` meta tag. This functionality was broken, but the
unit test wasn't catching it.

There is still one failing test, but that is tracked via servo#40129.

Signed-off-by: Martin Robinson <[email protected]>
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Oct 24, 2025
@mrobinson mrobinson enabled auto-merge October 24, 2025 10:10
@mrobinson
Copy link
Copy Markdown
Member Author

mrobinson commented Oct 24, 2025

Ug, that unfortunate. I wonder what went wrong there. Sorry about that. But I guess removing the custom harness where not necessary is anyway a good step. I'll take a closer look after lunch

No problem. The switch to nexttest does allow us to remove the custom harness in the general case, which is very nice.

@mrobinson mrobinson added this pull request to the merge queue Oct 24, 2025
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 24, 2025
Merged via the queue into servo:main with commit c32049e Oct 24, 2025
30 checks passed
@mrobinson mrobinson deleted the fix-api-tests branch October 24, 2025 11:18
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Oct 24, 2025
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.

4 participants