Skip to content

Commit f409a2a

Browse files
committed
Add docs related to archives.
1 parent 074b283 commit f409a2a

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

tests/tools/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "git-testtools"
33
description = "Shared code for gitoxide crates to facilitate testing"
4-
version = "0.7.0"
4+
version = "0.7.1"
55
authors = ["Sebastian Thiel <[email protected]>"]
66
edition = "2018"
77
license = "MIT OR Apache-2.0"

tests/tools/src/lib.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,26 @@ pub fn fixture_bytes(path: impl AsRef<Path>) -> Vec<u8> {
100100

101101
/// Run the executable at `script_name`, like `make_repo.sh` to produce a read-only directory to which
102102
/// the path is returned.
103+
///
103104
/// Note that it persists and the script at `script_name` will only be executed once if it ran without error.
105+
///
106+
/// ### Automatic Archive Creation
107+
///
108+
/// In order to speed up CI and even local runs should the cache get purged, the result of each script run
109+
/// is automatically placed into a compressed _tar_ archive.
110+
/// If a script result doesn't exist, these will be checked first and extracted if present, which they are by default.
111+
/// This behaviour can be prohibited by setting the `GITOXIDE_TEST_IGNORE_ARCHIVES` to any value.
112+
///
113+
/// To speed CI up, one can add these archives to the repository. It's absoutely recommended to use `git-lfs` for that to
114+
/// not bloat the repository size.
115+
///
116+
/// #### Disable Archive Creation
117+
///
118+
/// If archives aren't useful, they can be disabled by using `.gitignore` specifications.
119+
/// That way it's trivial to prevent creation of all archives with `generated-archives/*.tar.xz` in the root
120+
/// or more specific `.gitignore` configurations in lower levels of the work tree.
121+
///
122+
/// The latter is useful if the the script's output is platform specific.
104123
pub fn scripted_fixture_repo_read_only(script_name: impl AsRef<Path>) -> Result<PathBuf> {
105124
scripted_fixture_repo_read_only_with_args(script_name, None)
106125
}

0 commit comments

Comments
 (0)