909 Commits

Author SHA1 Message Date
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
83d1c14b4e docs(test): Point to docs, rather than source
I pointed to the nightly docs because I figured that was the most likely
one for users to be looking at.
2024-07-22 08:58:52 -05:00
bors
5f6b9a9220 Auto merge of #14271 - Alexendoo:schemas, r=epage
Add `TomlPackage::new`, `Default` for `TomlWorkspace`

Ran into this when using it to create a `Cargo.toml` rather than consume an existing one
2024-07-19 18:09:17 +00:00
Alex Macleod
9f85086fd2 Add TomlPackage::new, Default for TomlWorkspace 2024-07-19 17:51:38 +00:00
Ed Page
f05eba0ac5 docs(test): Migrate cargo_test docs from contrib to API reference
This will make them more easily discovered and make it easier to
remember to update them.
2024-07-19 12:04:02 -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
tianyeyouyou
87084c176b remove duplicate words 2024-07-10 20:51:45 +08: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
eth3lbert
03a0b5c999
Auto-redact not found 2024-06-27 12:55:34 +08:00
eth3lbert
cfabfe5467
test: Auto-redact target dir hashes 2024-06-23 11:10:15 +08:00
eth3lbert
91569f84b0
test: Add auto-redaction for not found error 2024-06-22 05:13:58 +08:00
Ed Page
fd8a91d185 fix(test): Un-redact Packaged files
This is a partial revert of ##14121
(e11d1722bb6e1e58c91adb1964993c74b45f4293)

Our focus for redacting (auto or with globs) includes
- run-specific information (timing, hashes, platform-specific wording)
- rustc-specific information

(We tend to use globs for rustc-specific information because there might
be some very specific times we need to care about some of the details)

However, "Packaged files" does not fit into any of that and, for now, we
are erring on the side of redacting less, rather than more, with the
move to snapbox.
As we see how it works out and what the underlying requirements are, we
can revisit this.
2024-06-21 11:05:41 -04:00