-
Notifications
You must be signed in to change notification settings - Fork 13.4k
htmldocck: Compare HTML tree instead of plain text html #95933
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
I don't think this is a good idea. We want to check the generated HTML as is, not that the attributes look like what we want. The problem lies in your PR I think. |
Fair enough. Closing this. |
So the best solution would be to compare the HTML content directly but it's currently not possible with the tool we use. This will at least prevent random sorting bugs. Thanks! @bors: r+ |
📌 Commit 7cc043333ca63e91966b69dca2d1254918a91c1c has been approved by |
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment has been minimized.
This comment has been minimized.
@bors: r- |
7cc0433
to
4cc2261
Compare
This comment has been minimized.
This comment has been minimized.
4cc2261
to
e6a8720
Compare
@bors: r+ |
📌 Commit e6a8720 has been approved by |
…e, r=GuillaumeGomez htmldocck: Compare HTML tree instead of plain text html This PR improves `htmldocck` by comparing HTML trees instead of plain text html in the case of doing a ``@snapshot`` test. This fix the [CI issue](https://github.com/rust-lang-ci/rust/runs/5964305020?check_suite_focus=true) encounter in rust-lang#95813 where for some unknown reason one of the attributes is not always at the same place. The code is largely based on https://github.com/formencode/formencode/blob/3a1ba9de2fdd494dd945510a4568a3afeddb0b2e/formencode/doctest_xml_compare.py#L72-L120 which is behind MIT License. The comparison function is straightforward except for the `text_compare` function which does some weird stuff that we may want to simply reduce to a plain old comparison. r? `@GuillaumeGomez`
Rollup of 6 pull requests Successful merges: - rust-lang#95346 (Stablize `const_extern_fn` for "Rust" and "C") - rust-lang#95933 (htmldocck: Compare HTML tree instead of plain text html) - rust-lang#96105 (Make the debug output for `TargetSelection` less verbose) - rust-lang#96112 (Strict provenance lint diagnostics improvements) - rust-lang#96119 (update Miri) - rust-lang#96124 (to_digit tweak) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…=GuillaumeGomez Fix snapshot --bless not working anymore in htmldocck I broke it in rust-lang#95933 r? `@GuillaumeGomez`
…=GuillaumeGomez Fix snapshot --bless not working anymore in htmldocck I broke it in rust-lang#95933 r? ``@GuillaumeGomez``
…=GuillaumeGomez Fix snapshot --bless not working anymore in htmldocck I broke it in rust-lang#95933 r? ```@GuillaumeGomez```
This PR improves
htmldocck
by comparing HTML trees instead of plain text html in the case of doing a@snapshot
test.This fix the CI issue encounter in #95813 where for some unknown reason one of the attributes is not always at the same place.
The code is largely based on https://github.com/formencode/formencode/blob/3a1ba9de2fdd494dd945510a4568a3afeddb0b2e/formencode/doctest_xml_compare.py#L72-L120 which is behind MIT License. The comparison function is straightforward except for the
text_compare
function which does some weird stuff that we may want to simply reduce to a plain old comparison.r? @GuillaumeGomez