rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwood3d77f29ab19e08f362b9384f06aab3a91d77619a
{
"request": "trigger",
"version": 1,
"event_type": "patch",
"repository": {
"id": "rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5",
"name": "heartwood",
"description": "Radicle Heartwood Protocol & Stack",
"private": false,
"default_branch": "master",
"delegates": [
"did:key:z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT",
"did:key:z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW",
"did:key:z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM",
"did:key:z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz",
"did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz"
]
},
"action": "Created",
"patch": {
"id": "bbec2544e8acc00eefa7e4024773df27205c628e",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": "lorenz"
},
"title": "cli/test: Clean up testing environment",
"state": {
"status": "open",
"conflicts": []
},
"before": "10e7b94c304d215ad4a1ff326233098ab182d0b1",
"after": "3d77f29ab19e08f362b9384f06aab3a91d77619a",
"commits": [
"3d77f29ab19e08f362b9384f06aab3a91d77619a"
],
"target": "191c287955f8673ce664fdfd7a88cbbd43f2d30e",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "bbec2544e8acc00eefa7e4024773df27205c628e",
"author": {
"id": "did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz",
"alias": "lorenz"
},
"description": "This is a small cleanup to path generation during testing.\n 1. Separate `rad_home` and `unix_home` to avoid confusion.\n 2. Remove now unnecessary `trait HasHome`.\n 3. Move setting `$USER` to the environment.\n 4. Make paths shorter overall, to fix macOS tests.",
"base": "10e7b94c304d215ad4a1ff326233098ab182d0b1",
"oid": "3d77f29ab19e08f362b9384f06aab3a91d77619a",
"timestamp": 1760189652
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "b9aeea1d-153d-4272-b5ba-45a559261ff9"
},
"info_url": "https://cci.rad.levitte.org//b9aeea1d-153d-4272-b5ba-45a559261ff9.html"
}
Started at: 2025-10-11 15:52:01.120076+02:00
Commands:
$ rad clone rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 .
✓ Creating checkout in ./...
✓ Remote cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT added
✓ Remote-tracking branch cloudhead@z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT/master created for z6MksFqXN3Yhqk8pTJdUGLwATkRfQvwZXPqR2qMEhbS9wzpT
✓ Remote cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW added
✓ Remote-tracking branch cloudhead@z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW/master created for z6MktaNvN1KVFMkSRAiN4qK5yvX1zuEEaseeX5sffhzPZRZW
✓ Remote fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM added
✓ Remote-tracking branch fintohaps@z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM/master created for z6MkireRatUThvd3qzfKht1S44wpm4FEWSSa4PRMTSQZ3voM
✓ Remote erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz added
✓ Remote-tracking branch erikli@z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz/master created for z6MkgFq6z5fkF2hioLLSNu1zP2qEL1aHXHZzGH1FLFGAnBGz
✓ Remote lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz added
✓ Remote-tracking branch lorenz@z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz/master created for z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
✓ Repository successfully cloned under /opt/radcis/ci.rad.levitte.org/cci/state/b9aeea1d-153d-4272-b5ba-45a559261ff9/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 125 issues · 27 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout bbec2544e8acc00eefa7e4024773df27205c628e
✓ Switched to branch patch/bbec254 at revision bbec254
✓ Branch patch/bbec254 setup to track rad/patches/bbec2544e8acc00eefa7e4024773df27205c628e
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout 3d77f29ab19e08f362b9384f06aab3a91d77619a
HEAD is now at 3d77f29a cli/test: Clean up testing environment
Exit code: 0
$ git show 3d77f29ab19e08f362b9384f06aab3a91d77619a
commit 3d77f29ab19e08f362b9384f06aab3a91d77619a
Author: Lorenz Leutgeb <lorenz.leutgeb@radicle.xyz>
Date: Sat Oct 11 13:13:38 2025 +0200
cli/test: Clean up testing environment
This is a small cleanup to path generation during testing.
1. Separate `rad_home` and `unix_home` to avoid confusion.
2. Remove now unnecessary `trait HasHome`.
3. Move setting `$USER` to the environment.
4. Make paths shorter overall, to fix macOS tests.
diff --git a/crates/radicle-cli/examples/framework/home.md b/crates/radicle-cli/examples/framework/home.md
index 66795003..7ee169eb 100644
--- a/crates/radicle-cli/examples/framework/home.md
+++ b/crates/radicle-cli/examples/framework/home.md
@@ -8,23 +8,23 @@ $ touch file.bin
$ rad self --did
did:key:z6Mkt67GdsW7715MEfRuP4pSZxJRJh6kj6Y48WRqVv4N1tRk
$ pwd
-[..]/home/bob/.radicle
+[..]/bob/.radicle
$ mkdir src
$ cd src
$ pwd
-[..]/home/bob/.radicle/src
+[..]/bob/.radicle/src
```
``` ~alice
$ rad self --did
did:key:z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
$ pwd
-[..]/home/alice/.radicle
+[..]/alice/.radicle
```
``` ~bob
$ pwd
-[..]/home/bob/.radicle/src
+[..]/bob/.radicle/src
```
```
diff --git a/crates/radicle-cli/examples/rad-id-threshold.md b/crates/radicle-cli/examples/rad-id-threshold.md
index 8860b53e..924a9005 100644
--- a/crates/radicle-cli/examples/rad-id-threshold.md
+++ b/crates/radicle-cli/examples/rad-id-threshold.md
@@ -176,7 +176,7 @@ Fetching rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji from the network, found 2 potential s
✓ Creating checkout in ./heartwood..
✓ Remote alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi added
✓ Remote-tracking branch alice@z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi/master created for z6MknSLrJoTcukLrE435hVNQT4JUhbvWLX4kUzqkEStBU8Vi
-✓ Repository successfully cloned under [..]/bob/heartwood/
+✓ Repository successfully cloned under [..]/bob/work/heartwood/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
diff --git a/crates/radicle-cli/examples/rad-self.md b/crates/radicle-cli/examples/rad-self.md
index 72cd06a1..440db13a 100644
--- a/crates/radicle-cli/examples/rad-self.md
+++ b/crates/radicle-cli/examples/rad-self.md
@@ -9,11 +9,11 @@ Node not running
SSH not running
├╴Key (hash) SHA256:UIedaL6Cxm6OUErh9GQUzzglSk7VpQlVTI1TAFB/HWA
└╴Key (full) ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHahWSBEpuT1ESZbynOmBNkLBSnR32Ar4woZqSV2YNH1
-Home [..]/home/alice/.radicle
-├╴Config [..]/home/alice/.radicle/config.json
-├╴Storage [..]/home/alice/.radicle/storage
-├╴Keys [..]/home/alice/.radicle/keys
-└╴Node [..]/home/alice/.radicle/node
+Home [..]/alice/.radicle
+├╴Config [..]/alice/.radicle/config.json
+├╴Storage [..]/alice/.radicle/storage
+├╴Keys [..]/alice/.radicle/keys
+└╴Node [..]/alice/.radicle/node
```
If you need to display only your DID, Node ID, or SSH Public Key, you can use
@@ -41,5 +41,5 @@ ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIHahWSBEpuT1ESZbynOmBNkLBSnR32Ar4woZqSV2YNH1
```
$ rad self --home
-[..]/home/alice/.radicle
+[..]/alice/.radicle
```
diff --git a/crates/radicle-cli/tests/util/environment.rs b/crates/radicle-cli/tests/util/environment.rs
index 5fc512e1..47ae272a 100644
--- a/crates/radicle-cli/tests/util/environment.rs
+++ b/crates/radicle-cli/tests/util/environment.rs
@@ -82,39 +82,42 @@ impl Default for Environment {
impl Environment {
/// Create a new test environment.
- fn named(name: &'static str) -> Self {
+ pub fn new() -> Self {
Self {
- tempdir: tempfile::TempDir::with_prefix("radicle-".to_owned() + name).unwrap(),
+ tempdir: tempfile::TempDir::new().unwrap(),
users: 0,
}
}
- /// Create a new test environment.
- pub fn new() -> Self {
- Self::named("")
- }
-
- /// Return the temp directory path.
+ /// Return the path of the temporary directory at which
+ /// this testing environment is rooted.
pub fn tempdir(&self) -> PathBuf {
self.tempdir.path().into()
}
- /// Path to the working directory designated for given alias.
- pub fn work(&self, has_alias: &impl HasAlias) -> PathBuf {
- self.tempdir().join("work").join(has_alias.alias().as_ref())
+ /// Return the home directory of the user with the given alias.
+ /// This is in analogy to a Unix home directory.
+ pub fn unix_home(&self, has_alias: &impl HasAlias) -> PathBuf {
+ self.tempdir().join(has_alias.alias().to_string())
}
- /// We don't have `RAD_HOME` or `HOME` to rely on to compute a home as usual.
- pub fn home(&self, alias: &Alias) -> Home {
+ /// Return the Radicle path of the user with the given alias.
+ /// This is in analogy to `$RAD_HOME` and always a subdirectory of
+ /// the user's home directory (see [`Environment::unix_home`]).
+ pub fn rad_home(&self, has_alias: &impl HasAlias) -> Home {
Home::new(
- self.tempdir()
- .join("home")
- .join(alias.to_string())
- .join(".radicle"),
+ self.unix_home(has_alias).join(".radicle"),
)
.unwrap()
}
+ /// Path to the working directory of the user with the given alias.
+ /// Tests that need to act on multiple repositories should crate
+ /// subdirecories within this directory.
+ pub fn work(&self, has_alias: &impl HasAlias) -> PathBuf {
+ self.unix_home(has_alias).join("work")
+ }
+
/// Create a new default configuration.
pub fn config(&self, alias: &str) -> profile::Config {
let alias = Alias::new(alias);
@@ -135,7 +138,7 @@ impl Environment {
/// is provided.
pub fn profile_with(&mut self, config: profile::Config) -> Profile {
let alias = config.alias().clone();
- let home = self.home(&alias);
+ let home = self.rad_home(&alias);
let keypair = KeyPair::from_seed(Seed::from([!(self.users as u8); 32]));
let policies_db = home.node().join(POLICIES_DB_FILE);
let cobs_db = home.cobs().join(COBS_DB_FILE);
@@ -224,7 +227,12 @@ impl Environment {
self.node_with(config::seed(alias))
}
- /// Convenience method for placing repository fixture.
+ /// Convenience method for placing repository fixture into the
+ /// directory returned by [`Environment::work`] for the user.
+ /// Use this only in tests that act on *a single repository* only.
+ /// For tests that need to act on multiple repositories,
+ /// create the repositories as subdirectories of the working
+ /// directory returned by [`Environment::work`].
pub fn repository(
&self,
has_alias: &impl HasAlias,
@@ -236,24 +244,20 @@ impl Environment {
pub fn test(
&self,
test_file: &'static str,
- subject: &(impl HasAlias + HasHome),
+ subject: &impl HasAlias,
) -> Result<(), Box<dyn std::error::Error>> {
formula(
self.work(subject).as_ref(),
PathBuf::from("examples").join(test_file.to_owned() + ".md"),
)?
+ .env("USER", subject.alias().as_ref())
.env(
"RAD_HOME",
- subject.home().path().to_path_buf().to_string_lossy(),
+ self.rad_home(subject).path().to_string_lossy(),
)
.env(
"JJ_CONFIG",
- subject
- .home()
- .path()
- .parent()
- .unwrap()
- .to_path_buf()
+ self.unix_home(subject)
.join(".jjconfig.toml")
.to_string_lossy(),
)
@@ -262,10 +266,11 @@ impl Environment {
Ok(())
}
+ /// Convenience method for executing multiple test formulas with standard configuration.
pub fn tests(
&self,
test_files: impl IntoIterator<Item = &'static str>,
- subject: &(impl HasAlias + HasHome),
+ subject: &impl HasAlias,
) -> Result<(), Box<dyn std::error::Error>> {
for test_file in test_files {
self.test(test_file, subject)?;
@@ -288,6 +293,12 @@ pub trait HasAlias {
fn alias(&self) -> &Alias;
}
+impl HasAlias for Alias {
+ fn alias(&self) -> &Alias {
+ self
+ }
+}
+
impl HasAlias for Node<MemorySigner> {
fn alias(&self) -> &Alias {
&self.config.alias
@@ -304,26 +315,4 @@ impl<G> HasAlias for NodeHandle<G> {
fn alias(&self) -> &Alias {
&self.alias
}
-}
-
-pub trait HasHome {
- fn home(&self) -> &Home;
-}
-
-impl HasHome for Profile {
- fn home(&self) -> &Home {
- &self.home
- }
-}
-
-impl HasHome for Node<MemorySigner> {
- fn home(&self) -> &Home {
- &self.home
- }
-}
-
-impl HasHome for NodeHandle<MemorySigner> {
- fn home(&self) -> &Home {
- &self.home
- }
-}
+}
\ No newline at end of file
diff --git a/crates/radicle-cli/tests/util/formula.rs b/crates/radicle-cli/tests/util/formula.rs
index 7e75bc3d..7bffda73 100644
--- a/crates/radicle-cli/tests/util/formula.rs
+++ b/crates/radicle-cli/tests/util/formula.rs
@@ -28,7 +28,6 @@ pub(crate) fn formula(
.env("EDITOR", "true")
.env("TZ", "UTC")
.env("LANG", "C")
- .env("USER", "alice")
.env(env::RAD_PASSPHRASE, "radicle")
.env(env::RAD_KEYGEN_SEED, RAD_SEED)
.env(env::RAD_RNG_SEED, "0")
Exit code: 0
shell: 'export RUSTDOCFLAGS=''-D warnings'' cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny warnings cargo build --all-targets --workspace cargo doc --workspace --no-deps cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name b9aeea1d-153d-4272-b5ba-45a559261ff9 -v /opt/radcis/ci.rad.levitte.org/cci/state/b9aeea1d-153d-4272-b5ba-45a559261ff9/s:/b9aeea1d-153d-4272-b5ba-45a559261ff9/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/b9aeea1d-153d-4272-b5ba-45a559261ff9/w:/b9aeea1d-153d-4272-b5ba-45a559261ff9/w -w /b9aeea1d-153d-4272-b5ba-45a559261ff9/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:bookworm bash /b9aeea1d-153d-4272-b5ba-45a559261ff9/s/script.sh
+ export 'RUSTDOCFLAGS=-D warnings'
+ RUSTDOCFLAGS='-D warnings'
+ cargo --version
info: syncing channel updates for '1.88-x86_64-unknown-linux-gnu'
info: latest update on 2025-06-26, rust version 1.88.0 (6b00bc388 2025-06-23)
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-docs'
info: downloading component 'rust-src'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: downloading component 'rustfmt'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-docs'
info: installing component 'rust-src'
info: installing component 'rust-std'
info: installing component 'rustc'
info: installing component 'rustfmt'
cargo 1.88.0 (873a06493 2025-05-10)
+ rustc --version
rustc 1.88.0 (6b00bc388 2025-06-23)
+ cargo fmt --check
Diff in /b9aeea1d-153d-4272-b5ba-45a559261ff9/w/crates/radicle-cli/tests/util/environment.rs:105:
/// This is in analogy to `$RAD_HOME` and always a subdirectory of
/// the user's home directory (see [`Environment::unix_home`]).
pub fn rad_home(&self, has_alias: &impl HasAlias) -> Home {
- Home::new(
- self.unix_home(has_alias).join(".radicle"),
- )
- .unwrap()
+ Home::new(self.unix_home(has_alias).join(".radicle")).unwrap()
}
/// Path to the working directory of the user with the given alias.
Diff in /b9aeea1d-153d-4272-b5ba-45a559261ff9/w/crates/radicle-cli/tests/util/environment.rs:251:
PathBuf::from("examples").join(test_file.to_owned() + ".md"),
)?
.env("USER", subject.alias().as_ref())
- .env(
- "RAD_HOME",
- self.rad_home(subject).path().to_string_lossy(),
- )
+ .env("RAD_HOME", self.rad_home(subject).path().to_string_lossy())
.env(
"JJ_CONFIG",
self.unix_home(subject)
Diff in /b9aeea1d-153d-4272-b5ba-45a559261ff9/w/crates/radicle-cli/tests/util/environment.rs:316:
&self.alias
}
}
+
Exit code: 1
{
"response": "finished",
"result": "failure"
}