-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Test rustdoc js #47250
Test rustdoc js #47250
Conversation
Some changes occurred in HTML/CSS. |
(rust_highfive has picked a reviewer for you, use r? to override) |
Ah apparently, @Mark-Simulacrum is the one! Could you give me a hand when you have time please? |
src/bootstrap/check.rs
Outdated
}); | ||
} | ||
|
||
fn run(self, _: &Builder) { |
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.
- The
_
probably needs to bebuilder
for line 457 to work. - This function needs to return
Self::Output
anyway, for the trait to match. SinceSelf::Output
isPathBuf
, that's what this needs to return. However, all of the otherStep
impls in this file return()
, so that's probably what theOutput
needs to be here as well.
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.
Certainly, I stopped trying to make it work and certainly forgot to commit the version which compiles. The problem is more global anyway. But thanks for taking a look in here. ;)
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.
Left some basic feedback. Let me know if you have any questions.
src/bootstrap/tool.rs
Outdated
@@ -260,6 +260,7 @@ tool!( | |||
BuildManifest, "src/tools/build-manifest", "build-manifest", Mode::Libstd; | |||
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client", Mode::Libstd; | |||
RustInstaller, "src/tools/rust-installer", "fabricate", Mode::Libstd; | |||
RustdocJS, "node", "node", Mode::Tool; |
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.
You almost certainly want these arguments to be closer to the above. Something like RustdocJs, "rustdoc-js", "js-tests", Mode::Tool
.
But frankly I'm not entirely certain what this tool is doing either way -- you'd probably actually not want it, or at least it seems like at the very least it shouldn't be generated by the macro. If this doesn't make sense, explaining why it's here would help.
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 just tried my best understanding what was going on in here. My goal is to test the search in rust documentation. So I need to run this tool once the documentation has been generated. To run it, I need nodejs and I don't really know how to pick up the currently installed one.
src/bootstrap/check.rs
Outdated
const ONLY_HOSTS: bool = true; | ||
|
||
fn should_run(run: ShouldRun) -> ShouldRun { | ||
run.path("node") |
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.
This should be something more reasonable, like src/tests/rustdoc-js
.
src/bootstrap/check.rs
Outdated
} else { | ||
let command = Command::new("sh"); | ||
command.args(&["-c", "node src/tools/rustdoc-js/tester.js"]); | ||
command |
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.
The commands here likely want to use the configured node executable (builder.config.nodejs
or something like that).
src/bootstrap/check.rs
Outdated
@@ -570,6 +604,7 @@ static HOST_COMPILETESTS: &[Test] = &[ | |||
}, | |||
Test { path: "src/test/run-make", mode: "run-make", suite: "run-make" }, | |||
Test { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" }, | |||
Test { path: "src/test/rustdoc-js", mode: "rustdoc-js", suite: "rustdoc-js" }, |
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.
This (probably) shouldn't be here, unless you want to branch on rustdoc-js as the mode below and call into RustdocJs
... I would remove this, and add RustdocJs
to the list of tests here
Lines 254 to 257 in ee220da
Kind::Test => describe!(check::Tidy, check::Bootstrap, check::DefaultCompiletest, | |
check::HostCompiletest, check::Crate, check::CrateLibrustc, check::Rustdoc, | |
check::Linkcheck, check::Cargotest, check::Cargo, check::Rls, check::Docs, | |
check::ErrorIndex, check::Distcheck, check::Rustfmt, check::Miri, check::Clippy), |
@Mark-Simulacrum: Ok, moved a bit forward (still not compiling). Are you sure I need to put |
Sorry for the delay in getting back to you. Since the tool |
It requires at least rustdoc compilation in order to have a doc built (I need generated docs). Therefore it requires rustc and everything coming beforehand. :) |
So if you need specific generated docs, you can call Does that help? |
7edd379
to
6952199
Compare
Yes, thanks a lot! This is now ready on my side. |
Looks like we'll need to install nodejs for this to work. cc @alexcrichton -- are we okay with a default test requiring this (new) dependency? You can see examples of how we do it in the emscripten script: https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh#L50-L53. |
Could we perhaps not run these tests by default but run them on one builder or when node is already detected? I think it'd be best to not pick up a new dependency for all builds but just some (opt-in) builds. |
Sure. Let's go for testing only when node is present. |
Done! |
I'll put the explanation in this comment, don't hesitate to copy/paste it anywhere you might want. This PR is pretty "simple" and "just" add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example). |
r=me if you're ready and don't want docs team review; I have not looked over the tests themselves to verify that they make sense. It is also be worth checking that we have at least one builder on CI that would run these tests, and if not, probably adding nodejs to one of our test-running builders. My impression is that |
The doc team already gave its go through @QuietMisdreavus so I suppose it's fine. For me it seems good enough for a first step. We can always add more later on. :) Thanks a lot for your help in here @Mark-Simulacrum! @bors: r=Mark-Simulcram |
📌 Commit 026c749 has been approved by |
@bors r- r+ |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 026c749 has been approved by |
…ark-Simulacrum Test rustdoc js Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).
Apparently windows uses an old version:
|
@bors: r=Mark-Simulacrum |
📌 Commit 3a7e247 has been approved by |
…ark-Simulacrum Test rustdoc js Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).
…ark-Simulacrum Test rustdoc js Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).
…ark-Simulacrum Test rustdoc js Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).
Add tests for the rustdoc search. It was heavily required because of all the recent breaking changes that happened while I went through improvements in doc search (add search in/for generic search for example).