rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 heartwoodbebc3ff209c60c1f017b59ea8a953cb29f20f17a
{
"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": "923c3ad6836b565b2e02c9e65df31b47940f3bc4",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"title": "radicle: fix tests to not leave temporary files behind",
"state": {
"status": "merged",
"conflicts": []
},
"before": "574ac3566bd465d5306cd58d17ff9c87a5118ddd",
"after": "bebc3ff209c60c1f017b59ea8a953cb29f20f17a",
"commits": [
"bebc3ff209c60c1f017b59ea8a953cb29f20f17a"
],
"target": "6cfed884bf37cba1e0d8e97fa8b0e94df4a04b1f",
"labels": [],
"assignees": [],
"revisions": [
{
"id": "923c3ad6836b565b2e02c9e65df31b47940f3bc4",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "In radicle/src/test.rs, we have a helper type for a Node, which\ncreates a temporary directory using tempfile::tempdir, which creates a\nTempDir. When the TempDir is dropped, it deletes its associated\ndirectory. Before that happens, the Node has already stored the path.\nRight after that the TempDir is dropped, and the directory deleted.\nWhen the test code later opens the repository, using Storage::open,\nit recreates the directory. As a result, there is nothing that would\ndelete the directory when the test finishes.\n\nThis means tests that use the helper Node type leave temporary files\nbehind.\n\nFix this by storing the TempDir in the helper Node, not just its path.\nThis means the TempDir is only dropped at the end of the test its used\nin, and no temporary files are left behind.\n\nSigned-off-by: Lars Wirzenius <liw@liw.fi>",
"base": "574ac3566bd465d5306cd58d17ff9c87a5118ddd",
"oid": "6030a5d5a467e499d47c0fc4961e330e9ed717e5",
"timestamp": 1712933936
},
{
"id": "0e2336a6eda4b1bd81577db3d2ed17c6bd2f3fb6",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "refactor patch a little to drop use of tempdir_in\n\nSuggested in https://radicle.zulipchat.com/#narrow/stream/383670-patches/topic/fix.20tests.20to.20not.20leave.20temporary.20files.20behind/near/432932075",
"base": "574ac3566bd465d5306cd58d17ff9c87a5118ddd",
"oid": "bebc3ff209c60c1f017b59ea8a953cb29f20f17a",
"timestamp": 1713160065
},
{
"id": "763b1c024d4a5a77e246efad60336b12c73e17a3",
"author": {
"id": "did:key:z6MkgEMYod7Hxfy9qCvDv5hYHkZ4ciWmLFgfvm3Wn1b2w2FV",
"alias": "liw"
},
"description": "Rebase.",
"base": "c07522365a673a3a6b15fb2a356c0b23cc249ec2",
"oid": "1a0221f726225688928fd0a5644cb9ea336a8f2d",
"timestamp": 1713952101
}
]
}
}
{
"response": "triggered",
"run_id": {
"id": "a8fcd6d6-5e38-49af-a27c-ffb493efb1e0"
},
"info_url": "https://cci.rad.levitte.org//a8fcd6d6-5e38-49af-a27c-ffb493efb1e0.html"
}
Started at: 2025-10-21 17:19:14.008340+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/a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/w/
╭────────────────────────────────────╮
│ heartwood │
│ Radicle Heartwood Protocol & Stack │
│ 125 issues · 15 patches │
╰────────────────────────────────────╯
Run `cd ./.` to go to the repository directory.
Exit code: 0
$ rad patch checkout 923c3ad6836b565b2e02c9e65df31b47940f3bc4
✓ Switched to branch patch/923c3ad at revision 0e2336a
✓ Branch patch/923c3ad setup to track rad/patches/923c3ad6836b565b2e02c9e65df31b47940f3bc4
Exit code: 0
$ git config advice.detachedHead false
Exit code: 0
$ git checkout bebc3ff209c60c1f017b59ea8a953cb29f20f17a
HEAD is now at bebc3ff2 radicle: fix tests to not leave temporary files behind
Exit code: 0
$ git show bebc3ff209c60c1f017b59ea8a953cb29f20f17a
commit bebc3ff209c60c1f017b59ea8a953cb29f20f17a
Author: Lars Wirzenius <liw@liw.fi>
Date: Fri Apr 12 17:45:26 2024 +0300
radicle: fix tests to not leave temporary files behind
In radicle/src/test.rs, we have a helper type for a Node, which
creates a temporary directory using tempfile::tempdir, which creates a
TempDir. When the TempDir is dropped, it deletes its associated
directory. Before that happens, the Node has already stored the path.
Right after that the TempDir is dropped, and the directory deleted.
When the test code later opens the repository, using Storage::open,
it recreates the directory. As a result, there is nothing that would
delete the directory when the test finishes.
This means tests that use the helper Node type leave temporary files
behind.
Fix this by storing the TempDir in the helper Node, not just its path.
This means the TempDir is only dropped at the end of the test its used
in, and no temporary files are left behind.
Signed-off-by: Lars Wirzenius <liw@liw.fi>
diff --git a/radicle/src/test.rs b/radicle/src/test.rs
index 68c58131..ed374897 100644
--- a/radicle/src/test.rs
+++ b/radicle/src/test.rs
@@ -70,6 +70,8 @@ pub fn fetch<W: WriteRepository>(
pub mod setup {
use std::path::{Path, PathBuf};
+ use tempfile::{tempdir, TempDir};
+
use super::storage::{Namespaces, RefUpdate};
use crate::crypto::test::signer::MockSigner;
use crate::storage::git::transport::remote;
@@ -86,6 +88,7 @@ pub mod setup {
///
/// Note that this isn't a real node; only a profile with storage and a signing key.
pub struct Node {
+ pub tmp: TempDir,
pub root: PathBuf,
pub storage: Storage,
pub signer: MockSigner,
@@ -93,15 +96,15 @@ pub mod setup {
impl Default for Node {
fn default() -> Self {
- let root = tempfile::tempdir().unwrap();
+ let root = tempdir().unwrap();
Self::new(root, MockSigner::default(), "Radcliff")
}
}
impl Node {
- pub fn new(root: impl AsRef<Path>, signer: MockSigner, alias: &str) -> Self {
- let root = root.as_ref().to_path_buf();
+ pub fn new(tmp: TempDir, signer: MockSigner, alias: &str) -> Self {
+ let root = tmp.path().to_path_buf();
let home = root.join("home");
let paths = Home::new(home.as_path()).unwrap();
let storage = Storage::open(
@@ -116,6 +119,7 @@ pub mod setup {
remote::mock::register(signer.public_key(), storage.path());
Self {
+ tmp,
root,
storage,
signer,
@@ -242,29 +246,13 @@ pub mod setup {
pub bob: NodeWithRepo,
pub eve: NodeWithRepo,
pub rid: RepoId,
-
- #[allow(dead_code)]
- tmp: tempfile::TempDir,
}
impl Default for Network {
fn default() -> Self {
- let tmp = tempfile::tempdir().unwrap();
- let alice = Node::new(
- tmp.path().join("alice"),
- MockSigner::from_seed([!0; 32]),
- "alice",
- );
- let mut bob = Node::new(
- tmp.path().join("bob"),
- MockSigner::from_seed([!1; 32]),
- "bob",
- );
- let mut eve = Node::new(
- tmp.path().join("eve"),
- MockSigner::from_seed([!2; 32]),
- "eve",
- );
+ let alice = Node::new(tempdir().unwrap(), MockSigner::from_seed([!0; 32]), "alice");
+ let mut bob = Node::new(tempdir().unwrap(), MockSigner::from_seed([!1; 32]), "bob");
+ let mut eve = Node::new(tempdir().unwrap(), MockSigner::from_seed([!2; 32]), "eve");
let repo = alice.project();
let rid = repo.id;
@@ -294,7 +282,6 @@ pub mod setup {
bob,
eve,
rid,
- tmp,
}
}
}
Exit code: 0
shell: 'cargo --version rustc --version cargo fmt --check cargo clippy --all-targets --workspace -- --deny clippy::all cargo build --all-targets --workspace cargo doc --workspace cargo test --workspace --no-fail-fast '
Commands:
$ podman run --name a8fcd6d6-5e38-49af-a27c-ffb493efb1e0 -v /opt/radcis/ci.rad.levitte.org/cci/state/a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/s:/a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/s:ro -v /opt/radcis/ci.rad.levitte.org/cci/state/a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/w:/a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/w -w /a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/w -v /opt/radcis/ci.rad.levitte.org/.radicle:/${id}/.radicle:ro -e RAD_HOME=/${id}/.radicle rust:bookworm bash /a8fcd6d6-5e38-49af-a27c-ffb493efb1e0/s/script.sh
+ cargo --version
info: syncing channel updates for '1.77-x86_64-unknown-linux-gnu'
info: latest update on 2024-04-09, rust version 1.77.2 (25ef9e3d8 2024-04-09)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
cargo 1.77.2 (e52e36006 2024-03-26)
+ rustc --version
rustc 1.77.2 (25ef9e3d8 2024-04-09)
+ cargo fmt --check
error: 'cargo-fmt' is not installed for the toolchain '1.77-x86_64-unknown-linux-gnu'.
To install, run `rustup component add --toolchain 1.77-x86_64-unknown-linux-gnu rustfmt`
Exit code: 1
{
"response": "finished",
"result": "failure"
}