Rollup merge of #149071 - ferrocene:pvdrz/remote-test-client-timeout-tests, r=jieyouxu

Add test scaffolding for the `remote-test-client`

r? ``@jieyouxu``
This commit is contained in:
Matthias Krüger 2025-11-20 11:15:55 +01:00 committed by GitHub
commit 37dc26c816
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 131 additions and 0 deletions

View file

@ -229,6 +229,21 @@ dependencies = [
"winnow 0.7.13",
]
[[package]]
name = "assert_cmd"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcbb6924530aa9e0432442af08bbcafdad182db80d2e560da42a6d442535bf85"
dependencies = [
"anstyle",
"bstr",
"libc",
"predicates",
"predicates-core",
"predicates-tree",
"wait-timeout",
]
[[package]]
name = "autocfg"
version = "1.5.0"
@ -1151,6 +1166,12 @@ version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
[[package]]
name = "difflib"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
[[package]]
name = "digest"
version = "0.10.7"
@ -2982,6 +3003,33 @@ version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
[[package]]
name = "predicates"
version = "3.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573"
dependencies = [
"anstyle",
"difflib",
"predicates-core",
]
[[package]]
name = "predicates-core"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa"
[[package]]
name = "predicates-tree"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c"
dependencies = [
"predicates-core",
"termtree",
]
[[package]]
name = "prettydiff"
version = "0.7.0"
@ -3262,6 +3310,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "remote-test-client"
version = "0.1.0"
dependencies = [
"assert_cmd",
]
[[package]]
name = "remote-test-server"
@ -5459,6 +5510,12 @@ dependencies = [
"windows-sys 0.60.2",
]
[[package]]
name = "termtree"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683"
[[package]]
name = "test-float-parse"
version = "0.1.0"
@ -6077,6 +6134,15 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
[[package]]
name = "wait-timeout"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11"
dependencies = [
"libc",
]
[[package]]
name = "walkdir"
version = "2.5.0"

View file

@ -4003,3 +4003,40 @@ impl Step for CollectLicenseMetadata {
dest
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct RemoteTestClientTests {
host: TargetSelection,
}
impl Step for RemoteTestClientTests {
type Output = ();
const IS_HOST: bool = true;
const DEFAULT: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/tools/remote-test-client")
}
fn make_run(run: RunConfig<'_>) {
run.builder.ensure(Self { host: run.target });
}
fn run(self, builder: &Builder<'_>) {
let bootstrap_host = builder.config.host_target;
let compiler = builder.compiler(0, bootstrap_host);
let cargo = tool::prepare_tool_cargo(
builder,
compiler,
Mode::ToolBootstrap,
bootstrap_host,
Kind::Test,
"src/tools/remote-test-client",
SourceType::InTree,
&[],
);
run_cargo_test(cargo, &[], &[], "remote-test-client", bootstrap_host, builder);
}
}

View file

@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test
---
[Test] test::Tidy
@ -158,6 +159,9 @@ expression: test
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})

View file

@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=coverage
---
[Test] test::Tidy
@ -157,6 +158,9 @@ expression: test --skip=coverage
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})

View file

@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=tests
---
[Test] test::Tidy
@ -121,6 +122,9 @@ expression: test --skip=tests
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
- Set({test::tidyselftest})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})

View file

@ -1,5 +1,6 @@
---
source: src/bootstrap/src/core/builder/cli_paths/tests.rs
assertion_line: 68
expression: test --skip=tests --skip=coverage-map --skip=coverage-run --skip=library --skip=tidyselftest
---
[Test] test::Tidy
@ -100,6 +101,9 @@ expression: test --skip=tests --skip=coverage-map --skip=coverage-run --skip=lib
- Set({test::src/tools/coverage-dump})
- Set({test::src/tools/jsondoclint})
- Set({test::src/tools/replace-version-placeholder})
[Test] test::RemoteTestClientTests
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/remote-test-client})
[Test] test::Linkcheck
targets: [x86_64-unknown-linux-gnu]
- Set({test::src/tools/linkchecker})

View file

@ -904,6 +904,7 @@ impl<'a> Builder<'a> {
test::CrateRustdoc,
test::CrateRustdocJsonTypes,
test::CrateBootstrap,
test::RemoteTestClientTests,
test::Linkcheck,
test::TierCheck,
test::Cargotest,

View file

@ -4,3 +4,4 @@ version = "0.1.0"
edition = "2021"
[dependencies]
assert_cmd = "2"

View file

@ -0,0 +1,10 @@
#[test]
fn test_help() {
let mut cmd = assert_cmd::cargo::cargo_bin_cmd!();
cmd.arg("help");
let output = cmd.unwrap();
let stdout = String::from_utf8(output.stdout.clone()).unwrap();
assert!(stdout.trim().starts_with("Usage:"));
}