cli: Allow using `git` in doc tests
Define git author name and email address, and others to allow using it deterministically in documentation tests. Signed-off-by: Slack Coder <slackcoder@server.ky>
This commit is contained in:
parent
284aadc37c
commit
54bcb91339
|
|
@ -16,8 +16,8 @@ commit the changes to git.
|
||||||
|
|
||||||
```
|
```
|
||||||
$ git add README.md
|
$ git add README.md
|
||||||
$ git commit -m "Define power requirements"
|
$ git commit -v -m "Define power requirements"
|
||||||
[flux-capacitor-power 7939a9e] Define power requirements
|
[flux-capacitor-power 9dad201] Define power requirements
|
||||||
1 file changed, 0 insertions(+), 0 deletions(-)
|
1 file changed, 0 insertions(+), 0 deletions(-)
|
||||||
create mode 100644 README.md
|
create mode 100644 README.md
|
||||||
```
|
```
|
||||||
|
|
@ -32,10 +32,10 @@ $ rad patch open --message "define power requirements" --no-confirm
|
||||||
ok Pushing HEAD to storage...
|
ok Pushing HEAD to storage...
|
||||||
ok Analyzing remotes...
|
ok Analyzing remotes...
|
||||||
|
|
||||||
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/master (cdf76ce) <- z6MknSL…StBU8Vi/flux-capacitor-power (7939a9e)
|
z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/master (cdf76ce) <- z6MknSL…StBU8Vi/flux-capacitor-power (9dad201)
|
||||||
1 commit(s) ahead, 0 commit(s) behind
|
1 commit(s) ahead, 0 commit(s) behind
|
||||||
|
|
||||||
7939a9e Define power requirements
|
9dad201 Define power requirements
|
||||||
|
|
||||||
|
|
||||||
╭─ define power requirements ───────
|
╭─ define power requirements ───────
|
||||||
|
|
@ -45,7 +45,7 @@ No description provided.
|
||||||
╰───────────────────────────────────
|
╰───────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
ok Patch 3b1f58414e51266d7621203554a63eaee242b744 created 🌱
|
ok Patch b9bb418c6f504ee91e54c555bdc8fc37b4d9b28b created 🌱
|
||||||
```
|
```
|
||||||
|
|
||||||
It will now be listed as one of the project's open patches.
|
It will now be listed as one of the project's open patches.
|
||||||
|
|
@ -55,7 +55,7 @@ $ rad patch
|
||||||
|
|
||||||
- YOU PROPOSED -
|
- YOU PROPOSED -
|
||||||
|
|
||||||
define power requirements 3b1f58414e5 R0 7939a9e (flux-capacitor-power) ahead 1, behind 0
|
define power requirements b9bb418c6f5 R0 9dad201 (flux-capacitor-power) ahead 1, behind 0
|
||||||
└─ * opened by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [..]
|
└─ * opened by z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi (you) [..]
|
||||||
|
|
||||||
- OTHERS PROPOSED -
|
- OTHERS PROPOSED -
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,17 @@ fn test(
|
||||||
};
|
};
|
||||||
|
|
||||||
TestFormula::new()
|
TestFormula::new()
|
||||||
.env("RAD_PASSPHRASE", "radicle")
|
.env("GIT_AUTHOR_DATE", "1671125284")
|
||||||
.env("RAD_HOME", home.to_string_lossy())
|
.env("GIT_AUTHOR_EMAIL", "radicle@localhost")
|
||||||
|
.env("GIT_AUTHOR_NAME", "radicle")
|
||||||
|
.env("GIT_COMMITTER_DATE", "1671125284")
|
||||||
|
.env("GIT_COMMITTER_EMAIL", "radicle@localhost")
|
||||||
|
.env("GIT_COMMITTER_NAME", "radicle")
|
||||||
.env("RAD_DEBUG", "1")
|
.env("RAD_DEBUG", "1")
|
||||||
|
.env("RAD_HOME", home.to_string_lossy())
|
||||||
|
.env("RAD_PASSPHRASE", "radicle")
|
||||||
|
.env("TZ", "Etc/GMT")
|
||||||
|
.env(radicle_cob::git::RAD_COMMIT_TIME, "1671125284")
|
||||||
.cwd(cwd)
|
.cwd(cwd)
|
||||||
.file(base.join(test))?
|
.file(base.join(test))?
|
||||||
.run()?;
|
.run()?;
|
||||||
|
|
@ -93,10 +101,6 @@ fn rad_patch() {
|
||||||
|
|
||||||
// Setup a test repository.
|
// Setup a test repository.
|
||||||
fixtures::repository(working.path());
|
fixtures::repository(working.path());
|
||||||
// Set a fixed commit time.
|
|
||||||
env::set_var(radicle_cob::git::RAD_COMMIT_TIME, "1671125284");
|
|
||||||
env::set_var("GIT_COMMITTER_DATE", "1671125284");
|
|
||||||
env::set_var("GIT_AUTHOR_DATE", "1671125284");
|
|
||||||
|
|
||||||
test("examples/rad-init.md", working.path(), Some(&profile)).unwrap();
|
test("examples/rad-init.md", working.path(), Some(&profile)).unwrap();
|
||||||
test("examples/rad-issue.md", working.path(), Some(&profile)).unwrap();
|
test("examples/rad-issue.md", working.path(), Some(&profile)).unwrap();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue