Skip to content

Commit a5efddc

Browse files
Frandob5
authored andcommitted
more feature flags
1 parent 79ca566 commit a5efddc

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

src/ranger.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ pub trait Store<E: RangeEntry>: Sized {
288288
///
289289
/// This will remove just the entry with the given key, but will not perform prefix deletion.
290290
#[cfg(test)]
291+
#[allow(unused)]
291292
fn entry_remove(&mut self, key: &E::Key) -> Result<Option<E>, Self::Error>;
292293

293294
/// Remove all entries whose key start with a prefix and for which the `predicate` callback

src/store/fs.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -984,13 +984,12 @@ fn into_entry(key: RecordsId, value: RecordsValue) -> SignedEntry {
984984
SignedEntry::new(entry_signature, entry)
985985
}
986986

987-
#[cfg(test)]
987+
#[cfg(all(test, feature = "fs-store"))]
988988
mod tests {
989-
use super::{tables::LATEST_PER_AUTHOR_TABLE, *};
989+
use super::*;
990990
use crate::ranger::Store as _;
991991

992992
#[tokio::test]
993-
#[cfg(feature = "fs-store")]
994993
async fn test_ranges() -> Result<()> {
995994
let dbfile = tempfile::NamedTempFile::new()?;
996995
let mut store = Store::persistent(dbfile.path())?;
@@ -1018,7 +1017,6 @@ mod tests {
10181017
}
10191018

10201019
#[test]
1021-
#[cfg(feature = "fs-store")]
10221020
fn test_basics() -> Result<()> {
10231021
let dbfile = tempfile::NamedTempFile::new()?;
10241022
let mut store = Store::persistent(dbfile.path())?;
@@ -1112,6 +1110,7 @@ mod tests {
11121110
#[tokio::test]
11131111
#[cfg(feature = "fs-store")]
11141112
async fn test_migration_001_populate_latest_table() -> Result<()> {
1113+
use super::tables::LATEST_PER_AUTHOR_TABLE;
11151114
let dbfile = tempfile::NamedTempFile::new()?;
11161115
let namespace = NamespaceSecret::new(&mut rand::rng());
11171116

tests/gc.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![allow(unused)]
2+
13
use std::{path::PathBuf, time::Duration};
24

35
use anyhow::Result;
@@ -18,6 +20,7 @@ pub fn create_test_data(size: usize) -> Bytes {
1820
}
1921

2022
/// Wrap a bao store in a node that has gc enabled.
23+
#[cfg(feature = "fs-store")]
2124
async fn persistent_node(
2225
path: PathBuf,
2326
gc_period: Duration,
@@ -35,6 +38,7 @@ async fn persistent_node(
3538
}
3639

3740
#[tokio::test]
41+
#[cfg(feature = "fs-store")]
3842
async fn redb_doc_import_stress() -> Result<()> {
3943
let _ = tracing_subscriber::fmt::try_init();
4044
let dir = testdir!();

tests/sync.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use iroh_docs::{
1717
};
1818
use n0_future::time::Instant;
1919
use rand::{CryptoRng, Rng, SeedableRng};
20+
#[cfg(feature = "fs-store")]
2021
use tempfile::tempdir;
2122
use tracing::{debug, error_span, info, Instrument};
2223
use tracing_test::traced_test;
@@ -584,6 +585,7 @@ async fn test_sync_via_relay() -> Result<()> {
584585
#[tokio::test]
585586
#[traced_test]
586587
#[ignore = "flaky"]
588+
#[cfg(feature = "fs-store")]
587589
async fn sync_restart_node() -> Result<()> {
588590
let mut rng = test_rng(b"sync_restart_node");
589591
let (relay_map, _relay_url, _guard) = iroh::test_utils::run_relay_server().await?;
@@ -1156,6 +1158,7 @@ impl PartialEq<ExpectedEntry> for (Entry, Bytes) {
11561158

11571159
#[tokio::test]
11581160
#[traced_test]
1161+
#[cfg(feature = "fs-store")]
11591162
async fn doc_delete() -> Result<()> {
11601163
let tempdir = tempdir()?;
11611164
// TODO(Frando): iroh-blobs has gc only for fs store atm, change test to test both

tests/util.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
#![allow(dead_code)]
1+
#![allow(unused)]
2+
23
use std::{
34
net::{Ipv4Addr, Ipv6Addr, SocketAddrV4, SocketAddrV6},
45
ops::Deref,

0 commit comments

Comments
 (0)