443 Commits

Author SHA1 Message Date
Kornel
f3c7525a61
Tests rely on absence of RUST_BACKTRACE 2024-08-21 23:12:05 +01:00
renovate[bot]
74f01c4b65
chore(deps): update msrv 2024-07-26 12:52:37 +00:00
Ed Page
922cfe5759 fix(test): Remove unused deprecated function 2024-07-24 16:35:11 -05:00
Ed Page
16448d45d7 doc(test): Document 'with_json' replacement 2024-07-24 10:42:51 -05:00
Weihang Lo
ab8ac44b49
chore: bump cargo-test-support to 0.4.0 2024-07-22 15:37:13 -04:00
Ed Page
83cbca0141 refactor(test): Document 'registry' mod 2024-07-22 08:58:52 -05:00
Ed Page
b931d98b90 refactor(test): Document 'publish' mod 2024-07-22 08:58:52 -05:00
Ed Page
6d0eea0e33 refactor(test): Document 'paths' mod
I considered hiding `init_root` as an implementation detail of
`#[cargo_test]` but decided to be conservative about that for now.
2024-07-22 08:58:52 -05:00
Ed Page
062652c856 docs(test): Expand 'install' documentation 2024-07-22 08:58:52 -05:00
Ed Page
64a62ff8fe docs(test): Expand 'git' documentation 2024-07-22 08:58:52 -05:00
Ed Page
97ccb653b0 docs(test): Expose git documentation 2024-07-22 08:58:52 -05:00
Ed Page
8f88a8af31 docs(test): Expand 'compare' documentation 2024-07-22 08:58:52 -05:00
Ed Page
cb528403fa docs(test): Expand docs for ProjectBuilder 2024-07-22 08:58:52 -05:00
Ed Page
45f61ccfa8 docs(test): Expand docs for Project 2024-07-22 08:58:52 -05:00
Ed Page
3dff0ec945 docs(test): Document project* functions 2024-07-22 08:58:52 -05:00
Ed Page
e53f2aff55 docs(test): Document panic_error function 2024-07-22 08:58:52 -05:00
Ed Page
c9dddd27c8 docs(test): Document main_file function 2024-07-22 08:58:52 -05:00
Ed Page
170756601c docs(test): Document 'process' 2024-07-22 08:58:52 -05:00
Ed Page
b4b56d4d65 docs(test): Document basic_*manifest functions 2024-07-22 08:58:52 -05:00
Ed Page
1fe8ae6c3e docs(test): Document Execs
I'm intentionally being light as I want to pull in a lot of "lessons
learned" from the port to snapbox into the docs and want that as a
dedicated PR to make it easier for the contributors to that effort to
review it.
2024-07-22 08:58:52 -05:00
Ed Page
4674f2b84d docs(test): Organize docs for Execs 2024-07-22 08:58:52 -05:00
Ed Page
f42ae4c9c1 docs(test): Pull RawOutput from API
Its not used anywhere
2024-07-22 08:58:52 -05:00
Ed Page
7762d1f98c docs(test): Document cargo_exe 2024-07-22 08:58:52 -05:00
Ed Page
fa0e66e738 docs(test): Document git_process 2024-07-22 08:58:52 -05:00
Ed Page
504d377c8e docs(test): Document cargo_process 2024-07-22 08:58:52 -05:00
Ed Page
86945a211e docs(test): Document t! 2024-07-22 08:58:52 -05:00
Ed Page
ca9fc47fe0 docs(test): Add high level example 2024-07-22 08:58:52 -05:00
Ed Page
ad6abb54be docs(test): Verify they work 2024-07-22 08:58:52 -05:00
Ed Page
8e524ae561 docs(test): Link to two different docs builds 2024-07-22 08:58:52 -05:00
Ed Page
49deefe477 refactor(test): Reuse 'cargo_home' in more cases 2024-07-19 10:54:17 -05:00
Ed Page
b0e515aa61 fix(test): Move 'cargo_home' from 'install' to 'paths'
This is used outside of `cargo install` contexts and this makes it more
discoverable for those use cases.
2024-07-19 10:50:42 -05:00
bors
dad331c5ba Auto merge of #14269 - epage:test-ext, r=ehuss
fix(test)!: Clarify extension trait role with rename

When browsing the docs, I feel like this will make it easier to tell the role of these traits within the API.
Or in other words, I can easily tell that these fill a support role and for what, so I know when I care to look into them.

We use this naming pattern for
`cargo_test_support::paths::CargoPathExt`.
2024-07-19 15:11:26 +00:00
Ed Page
a49921f829 fix(test)!: Clarify extension trait role with rename
When browsing the docs, I feel like this will make it easier to tell the
role of these traits within the API.
Or in other words, I can easily tell that these fill a support role and
for what, so I know when I care to look into them.

We use this naming pattern for
`cargo_test_support::paths::CargoPathExt`.
2024-07-18 20:52:22 -05:00
Ed Page
879bc9e3c3 feat(test): Re-export ProcessBuilder
Since its tied heavily into the API, this should make it easier to use
and document.
2024-07-18 20:51:43 -05:00
bors
f10c069629 Auto merge of #14266 - epage:path2url, r=weihanglo
fix(test): Move path2url to CargoPathExt::to_url

### What does this PR try to resolve?

This is a small step, like #14243, to improve the clarity of `cargo-test-support`s API.

Overall, I'm trying to make it more obvious on https://docs.rs/cargo-test-support/latest/cargo_test_support/ which items to reach for when.  I figured this is one that could be demoted to `paths` When doing so, I noticed `CargoPathExt`. I figured if we had any extension traits for `Path`, then this is a
reasonable one to add.

### How should we test and review this PR?

### Additional information
2024-07-18 20:57:05 +00:00
Ed Page
d17322dccb fix(test): Move path2url to CargoPathExt::to_url
I was considering moving this into `paths` and noticed `CargoPathExt`.
I figured if we had any extension traits for `Path`, then this is a
reasonable one to add.
2024-07-18 15:41:26 -05:00
Ed Page
3a615ca9c8 feat(test): Add CargoPathExt to prelude 2024-07-18 15:22:29 -05:00
Ed Page
5d4ac652f5 feat(test): Offer CargPathExt for PathBuf 2024-07-18 14:51:57 -05:00
d1t2
df43a23235
test: Update HASH redaction for registry files 2024-07-16 23:07:06 +08:00
Ed Page
090064cc14 feat(test): Add cargo_test to test-support prelude 2024-07-12 15:56:22 -05:00
Ed Page
7fcd580b3b fix(test): Redact elapsed time in the minutes time frame
This came up in #14231
```
---- expected: tests/testsuite/lto.rs:611:27
++++ actual:   stderr
   1    1 | [FRESH] registry-shared v0.0.1
   2    2 | [FRESH] registry v0.0.1
   3    3 | [COMPILING] bar v0.0.0 ([ROOT]/foo/bar)
   4    4 | [RUNNING] `rustc --crate-name bar [..]-C lto [..]--test [..]`
   5    5 | [RUNNING] `rustc --crate-name b [..]-C lto [..]--test [..]`
   6      - [FINISHED] `release` profile [optimized] target(s) in [ELAPSED]s
   7    6 | [RUNNING] `[ROOT]/foo/target/release/deps/bar-[HASH][EXE]`
   8    7 | [RUNNING] `[ROOT]/foo/target/release/deps/b-[HASH][EXE]`
   9    8 | [DOCTEST] bar
  10    9 | [RUNNING] `rustdoc --edition=2015 --crate-type cdylib --crate-type rlib --crate-name bar --test [..]-C lto [..]
       10 + [FINISHED] `release` profile [optimized] target(s) in 1m 00s

Update with SNAPSHOTS=overwrite
```
2024-07-10 16:42:21 -05:00
Ed Page
5ed63926d3 test(test): Verify elapsed redaction 2024-07-10 16:40:47 -05:00
Ed Page
a10b3ca8b2 refactor(test): Split out 'pure' redactions for testing 2024-07-10 16:37:12 -05:00
Ed Page
c8113d3a1c refactor(test): Move compare tests into a mod 2024-07-10 16:33:14 -05:00
bors
753ae28c06 Auto merge of #14161 - choznerol:issue-14039-snapshot-port-freshness, r=weihanglo
test: Auto-redact `... after last build at ...`; Migrate `freshness` to Snapbox
2024-07-03 21:53:31 +00:00
Lawrence Chou
bbc18d7009
Auto-redact dirty reason like 1719325877.527949100s, 61549498ns after last build at 1719325877.466399602s
7dcf764cbc/src/cargo/core/compiler/fingerprint/dirty_reason.rs (L131)
2024-07-03 23:48:14 +08:00
bors
a0b280398c Auto merge of #14171 - heisen-li:dir_doc, r=weihanglo
test:migrate `doc/directory/docscrape` to snapbox

### What does this PR try to resolve?

Complete the following file migration:
```
 tests/testsuite/directory.rs
 tests/testsuite/doc.rs
 tests/testsuite/docscrape.rs
```

part of #14039
2024-07-03 03:09:49 +00:00
heisen-li
78983534df add opening redact 2024-07-03 09:59:13 +08:00
bors
9441b91186 Auto merge of #14159 - dieterplex:migrate-git-snapbox, r=weihanglo
test: Migrate git to snapbox

Part of #14039.

There is a case need to modify regex for file size redaction.
2024-06-28 13:05:10 +00:00
d1t2
ed027736e7
test: Allow redact file size w/o fraction
`cargo clean` shows file size without fraction in summary when the size
is lower than 1024. And we need to avoid matching things like `%2B%23..`
found in other test cases, the trailing `\s` is added to regex.
2024-06-27 16:58:52 +08:00