Skip to content

Commit 078ccc9

Browse files
committed
test(report): HTML replay snapshot
This adds a log file generated by ``` cargod build --timings -Zsection-timings -p cargo-util-schemas ``` With this we can track what changed in HTML report.
1 parent 7954f11 commit 078ccc9

8 files changed

Lines changed: 5523 additions & 1 deletion

File tree

.ignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,8 @@ src/etc/man
1212
!src/doc/src/commands/index.md
1313
!src/doc/src/commands/manifest-commands.md
1414
!src/doc/src/commands/package-commands.md
15-
!src/doc/src/commands/publishg-commands.md
15+
!src/doc/src/commands/publishing-commands.md
16+
17+
# Snapshots of HTML reports and log files are just too large
18+
tests/testsuite/cargo_report_timings/log_file_specified/in/cargo-home/log/2006-07-24T012128000Z-b0fd440798ab3cfb.jsonl
19+
tests/testsuite/cargo_report_timings/log_file_specified/out/target/cargo-timings/cargo-timing-2006-07-24T012128000Z-b0fd440798ab3cfb.html
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[package]
2+
name = "foo"
3+
edition = "2021"

tests/testsuite/cargo_report_timings/log_file_specified/in/cargo-home/log/2006-07-24T012128000Z-b0fd440798ab3cfb.jsonl

Lines changed: 425 additions & 0 deletions
Large diffs are not rendered by default.

tests/testsuite/cargo_report_timings/log_file_specified/in/src/lib.rs

Whitespace-only changes.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
use crate::prelude::*;
2+
use cargo_test_support::Project;
3+
use cargo_test_support::compare::assert_ui;
4+
use cargo_test_support::current_dir;
5+
use cargo_test_support::file;
6+
use cargo_test_support::str;
7+
8+
#[cargo_test]
9+
fn case() {
10+
let project = Project::from_template(current_dir!().join("in"));
11+
let project_root = project.root();
12+
let cwd = &project_root;
13+
let cargo_home = project_root.join("cargo-home");
14+
15+
snapbox::cmd::Command::cargo_ui()
16+
.arg_line("report timings -Zunstable-options --id 2006-07-24T012128000Z-b0fd440798ab3cfb")
17+
.masquerade_as_nightly_cargo(&["build-analysis"])
18+
.current_dir(cwd)
19+
.env("CARGO_HOME", cargo_home)
20+
.assert()
21+
.success()
22+
.stdout_eq(str![""])
23+
.stderr_eq(file!["stderr.term.svg"]);
24+
25+
assert_ui().subset_matches(current_dir!().join("out"), &project_root);
26+
}

0 commit comments

Comments
 (0)