-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Rustdoc gui tests #79979
Rustdoc gui tests #79979
Conversation
Also: weird CI failure... |
I think either a README in the directory they're in, or in the dev-guide would be a good place. Possibly one could link to the other. |
I am still a little uncertain about the approach here of needing a JS out-of-tree dependency expected to be installed through nodejs/npm; I definitely think this cannot land without some amount of published documentation on how to update these tests. I am a bit worried that it's going to be a significant increase in the overhead for contributors to rustdoc (needing a JS toolchain installed to test things locally), but I could be wrong about that. Ultimately that's a T-rustdoc decision, I suppose. The comment I left should hopefully fix CI. |
We can clone the framework too. I don't have much preference for a solution, just thought that it might be simpler to use |
Even cloning the framework presumably doesn't decouple us from needing the JS toolchain though? I think that's my primary concern. If it's just nodejs that's not too bad, but I'm a bit worried about running npm install mid-build. |
Then let's go for a submodule. Like that at least we'll know what's going on and no need for npm. |
To make things a bit simpler to track down, I made the
In case only the second condition isn't respected, a warning is displayed. The last commit is the CI update. I took the changes mostly from #70533 but we'll still need to have @Mark-Simulacrum to confirm them. :) So once everything else has been validated, I'll add the documentation. |
If we're going to require npm anyway I see no reason for the submodule I think? We probably want to put the lockfile in git though... |
That's the thing: either we put a lockfile in rust repository, or we keep the submodule and use its own lockfile. One way or another, it's fine by me. Maybe you have an opinion @jyn514 ? |
I have several requirements:
It's up to the rustdoc team whether you think this requirement is a reasonable ask of contributors - it seems like a high bar to me, but maybe editing these tests is rare and not too worrisome. I will take a look at this PR's implementation soon. |
These tests are mostly for me. To be more precise: I spend most of my time fixing GUI issues and I'd that to slow down quite a lot. So unless someone is changing the front-end, they don't need to run this test suite, and even if they do, I'm pretty sure in most cases there won't be an issue (but if there is one, the CI will tell us, finally!). |
7610ca1
to
1aeddde
Compare
This comment has been minimized.
This comment has been minimized.
@GuillaumeGomez that's not how testing works, though. CI can fail on anyone's changes, not just yours. The scenario is someone does make changes and either needs to add a new test or an existing test fails. That said, I think if we print "run |
I maybe badly tried to explain my point of view. The idea was "if you broke the GUI tests, you very likely know how npm works". 😄 |
@Mark-Simulacrum I might need help for the CI scripts update (not too sure what to change here without breaking everything...). So whenever you have time, it'd be super appreciated! :) |
I think this is still adding a submodule which seems like the wrong approach. I would expect us to use browser-ui-test just like we expect e.g. a C compiler to be installed to run this test. I presume that it can be readily installed by contributors via npm or so? |
Hmmm... Well, it doesn't hurt to have |
Commits squashed, @bors: r=Mark-Simulacrum |
📌 Commit 20f2497 has been approved by |
⌛ Testing commit 20f2497 with merge f8297b6ad3ae48ff88b8cdd31dcc8fbe34355050... |
💔 Test failed - checks-actions |
There is no failure apparently? Well, let's rety... @bors: retry |
⌛ Testing commit 20f2497 with merge 9d32bf0a81931e6e833eb0155aa5f067e7b7b3f6... |
💥 Test timed out |
@bors retry |
☀️ Test successful - checks-actions |
@@ -50,4 +50,6 @@ Session.vim | |||
.cargo | |||
!/src/test/run-make/thumb-none-qemu/example/.cargo | |||
no_llvm_build | |||
**node_modules | |||
**package-lock.json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is valid syntax. At least I can't find it in man gitignore
and ripgrep complains about it:
rust/.gitignore: line 55: error parsing glob '**node_modules': invalid use of **; must be one path component
rust/.gitignore: line 56: error parsing glob '**package-lock.json': invalid use of **; must be one path component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**
is to look for all subfolders, whatever the level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that would be **/node_modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for me as is but don't hesitate to send an update.
This is a reopening of #70533.
For this first version, there will be no screenshot comparison. Also, a big change compared to the previous version: the tests are now hosted in the rust repository directly. Since there is no image, it's pretty lightweight to say the least.
So now, only remains the nodejs script to run the tests and the tests themselves. Just one thing is missing: where should I put the documentation for these tests? I'm not sure where would be the best place for that. The doc will contain important information like the documentation of the framework used and how to install it (
npm install browser-ui-test
, but still needs to be put somewhere so no one is lost).We'd also need to install the package when running the CI too. For now, it runs as long as we have nodejs installed, but I think we don't it to run in all nodejs targets?
cc @jyn514
r? @Mark-Simulacrum