Skip to content

Commit 6734e39

Browse files
adpaco-awstedinski
authored andcommitted
Dashboard: Use custom stages feature (rust-lang#582)
* Upgrade litani to latest version * Use custom stages. Other minor fixes.
1 parent e894843 commit 6734e39

File tree

6 files changed

+29
-15
lines changed

6 files changed

+29
-15
lines changed

scripts/ci/update_dashboard.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def main():
4444
run = BeautifulSoup(fp, 'html.parser')
4545

4646
# Update pipeline names to link to the example under test
47-
for row in run.find_all('div', attrs={'class': 'pipeline-row'}):
47+
for row in run.find_all(lambda tag: tag.name == 'div' and
48+
tag.get('class') == ['pipeline-row']):
4849
path = row.find('div', attrs={'class': 'pipeline-name'})
4950
# Some paths here may be `None` - skip them
5051
if path.p:

src/tools/dashboard/src/books.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,11 @@ fn litani_run_tests() {
421421
let output_prefix: PathBuf = ["build", "output"].iter().collect();
422422
let output_symlink: PathBuf = output_prefix.join("latest");
423423
let dashboard_dir: PathBuf = ["src", "test", "dashboard"].iter().collect();
424+
let stage_names = ["check", "codegen", "verification"];
425+
424426
util::add_rmc_and_litani_to_path();
425-
let mut litani = Litani::init("RMC", &output_prefix, &output_symlink);
427+
let mut litani = Litani::init("RMC", &stage_names, &output_prefix, &output_symlink);
428+
426429
// Run all tests under the `src/test/dashboard` directory.
427430
for entry in WalkDir::new(dashboard_dir) {
428431
let entry = entry.unwrap().into_path();

src/tools/dashboard/src/litani.rs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,12 @@ pub struct Litani {
152152

153153
impl Litani {
154154
/// Sets up a new [`Litani`] run.
155-
pub fn init(project_name: &str, output_prefix: &Path, output_symlink: &Path) -> Self {
155+
pub fn init(
156+
project_name: &str,
157+
stage_names: &[&str],
158+
output_prefix: &Path,
159+
output_symlink: &Path,
160+
) -> Self {
156161
Command::new("litani")
157162
.args([
158163
"init",
@@ -162,7 +167,9 @@ impl Litani {
162167
output_prefix.to_str().unwrap(),
163168
"--output-symlink",
164169
output_symlink.to_str().unwrap(),
170+
"--stages",
165171
])
172+
.args(stage_names)
166173
.spawn()
167174
.unwrap()
168175
.wait()
@@ -231,6 +238,11 @@ impl Litani {
231238
}
232239
self.spawned_commands.clear();
233240
// Run `run-build` command and wait for it to finish.
234-
Command::new("litani").arg("run-build").spawn().unwrap().wait().unwrap();
241+
Command::new("litani")
242+
.args(["run-build", "--no-pipeline-dep-graph"])
243+
.spawn()
244+
.unwrap()
245+
.wait()
246+
.unwrap();
235247
}
236248
}

src/tools/dashboard/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR MIT
3-
#![feature(command_access)]
43
#![feature(extend_one)]
54
#![feature(rustc_private)]
65

src/tools/dashboard/src/util.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ pub fn add_check_job(litani: &mut Litani, test_props: &TestProps) {
163163
let exit_status = if test_props.fail_step == Some(FailStep::Check) { 1 } else { 0 };
164164
let mut rmc_rustc = Command::new("rmc-rustc");
165165
rmc_rustc.args(&test_props.rustc_args).args(["-Z", "no-codegen"]).arg(&test_props.path);
166-
// TODO: replace `build` with `check` when Litani adds support for custom
167-
// stages (see https://github.com/model-checking/rmc/issues/391).
166+
168167
let mut phony_out = test_props.path.clone();
169168
phony_out.set_extension("check");
170169
litani.add_job(
@@ -173,7 +172,7 @@ pub fn add_check_job(litani: &mut Litani, test_props: &TestProps) {
173172
&[&phony_out],
174173
"Is this valid Rust code?",
175174
test_props.path.to_str().unwrap(),
176-
"build",
175+
"check",
177176
exit_status,
178177
5,
179178
);
@@ -188,6 +187,8 @@ pub fn add_codegen_job(litani: &mut Litani, test_props: &TestProps) {
188187
.args([
189188
"-Z",
190189
"codegen-backend=gotoc",
190+
"-Z",
191+
"trim-diagnostic-paths=no",
191192
"--cfg=rmc",
192193
"--out-dir",
193194
"build/tmp",
@@ -196,8 +197,7 @@ pub fn add_codegen_job(litani: &mut Litani, test_props: &TestProps) {
196197
"--crate-type=lib",
197198
])
198199
.arg(&test_props.path);
199-
// TODO: replace `test` with `codegen` when Litani adds support for custom
200-
// stages (see https://github.com/model-checking/rmc/issues/391).
200+
201201
let mut phony_in = test_props.path.clone();
202202
phony_in.set_extension("check");
203203
let mut phony_out = test_props.path.clone();
@@ -208,7 +208,7 @@ pub fn add_codegen_job(litani: &mut Litani, test_props: &TestProps) {
208208
&[&phony_out],
209209
"Does RMC support all the Rust features used in it?",
210210
test_props.path.to_str().unwrap(),
211-
"test",
211+
"codegen",
212212
exit_status,
213213
5,
214214
);
@@ -222,8 +222,7 @@ pub fn add_verification_job(litani: &mut Litani, test_props: &TestProps) {
222222
if !test_props.rustc_args.is_empty() {
223223
rmc.env("RUSTFLAGS", test_props.rustc_args.join(" "));
224224
}
225-
// TODO: replace `report` with `verification` when Litani adds support for
226-
// custom stages (see https://github.com/model-checking/rmc/issues/391).
225+
227226
let mut phony_in = test_props.path.clone();
228227
phony_in.set_extension("codegen");
229228
litani.add_job(
@@ -232,7 +231,7 @@ pub fn add_verification_job(litani: &mut Litani, test_props: &TestProps) {
232231
&[],
233232
"Can RMC reason about it?",
234233
test_props.path.to_str().unwrap(),
235-
"report",
234+
"verification",
236235
exit_status,
237236
10,
238237
);

0 commit comments

Comments
 (0)