radicle-heartwood-lfs/radicle-cli/examples
Fintan Halpenny 2584ecdb0a
radicle: Pin timestamp for testing
When testing the CLI, "since"-calculations will result in different
values over time:

    now
    1 month ago
    2 months ago
    10 months ago
    1 year ago
    10 years ago

Initially, the solution was to use the wildcard match from `snapbox`,
`[..]`, to match on these values. However, since these values change
in length it means that they will affect the width of the tables
produced by the CLI.

To ensure the width is stable across runs over time it's possible to
use a time that is the same as the commit time used at testing.

To do this the `Timestamp` type is now a newtype which has a
constructor `now` which will use the `RAD_COMMIT_TIME` env variable
for construction, if it's available and in debug mode. This ensure
that all "since"-calculations will result in `now`.

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
2023-10-30 14:48:38 +01:00
..
framework cli-test: Update framework with new features 2023-08-04 12:23:49 +02:00
git cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
workflow radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-auth.md cli: Minor output improvements to `rad auth` 2023-10-11 14:49:37 +02:00
rad-checkout-repo-config-linux.md cli: Add canonical remote to `init` and `checkout` 2023-04-24 15:42:00 +02:00
rad-checkout-repo-config-macos.md cli: Add canonical remote to `init` and `checkout` 2023-04-24 15:42:00 +02:00
rad-checkout.md cli: Add canonical remote to `init` and `checkout` 2023-04-24 15:42:00 +02:00
rad-clone-all.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-clone-connect.md cli: Adjust output of `rad sync` slightly 2023-09-05 11:16:09 +02:00
rad-clone-unknown.md cli: Simplify fatal error output 2023-09-01 15:17:41 +02:00
rad-clone.md cli: Show repo summary on `rad clone` 2023-09-01 12:22:50 +02:00
rad-cob.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-fetch.md cli: Fix rad-fetch readme link 2023-07-25 11:52:24 +02:00
rad-fork.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-id-conflict.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-id-multi-delegate.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-id.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-init-no-git.md cli: Move `init` errors up so it fails sooner 2023-09-03 17:21:39 +02:00
rad-init-private-clone.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-init-private.md cli: Add tests for `rad publish` 2023-09-05 11:16:09 +02:00
rad-init-sync.md cli: Choose repo visibility on init 2023-09-03 17:21:37 +02:00
rad-init.md cli: Show repo visibility in `rad ls` 2023-09-03 17:21:39 +02:00
rad-inspect-noauth.md cli: Simplify fatal error output 2023-09-01 15:17:41 +02:00
rad-inspect.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-issue.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-label.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-merge-after-update.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-merge-no-ff.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-merge-via-push.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-node.md cli: Improve `rad node` output 2023-09-01 12:22:50 +02:00
rad-patch-ahead-behind.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-patch-draft.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-patch-pull-update.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-patch-update.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-patch-via-push.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-patch.md radicle: Pin timestamp for testing 2023-10-30 14:48:38 +01:00
rad-publish.md cli: Add tests for `rad publish` 2023-09-05 11:16:09 +02:00
rad-remote.md remote-helper: Run sync on `git-fetch` 2023-09-27 12:29:46 +02:00
rad-review-by-hunk.md cob: Introduce `xyz.radicle.id` COB 2023-10-12 17:32:33 +02:00
rad-rm.md cli: Show repo visibility in `rad ls` 2023-09-03 17:21:39 +02:00
rad-self.md node: Make node aliases required 2023-07-11 18:08:59 +02:00
rad-sync-without-node.md cli: Simplify fatal error output 2023-09-01 15:17:41 +02:00
rad-sync.md cli: Simplify fatal error output 2023-09-01 15:17:41 +02:00
rad-track.md cli: Get fetch after track working 2023-04-26 09:49:37 +02:00