Skip to content

Commit

Permalink
Fix Wisckey and monoio
Browse files Browse the repository at this point in the history
  • Loading branch information
kaimast committed Jan 18, 2025
1 parent 319cc5d commit 2d0c394
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ jobs:
timeout-minutes: 10
- name: "Tests: Sync Wisckey"
run: just wisckey-sync-tests
- name: "Test: Wisckey and Tokio-Uring"
run: just tokio-uring-wisckey-tests
- name: "Test: Wisckey and Monoio"
run: just monoio-wisckey-tests
timeout-minutes: 10
- name: "Lint Checks: Tokio (with sync FS)"
run: just async-lint
Expand All @@ -58,6 +62,8 @@ jobs:
run: just wisckey-lint
- name: "Lint Checks: Wisckey and Tokio-Uring"
run: just tokio-uring-wisckey-lint
- name: "Lint Checks: Wisckey and Monoio"
run: just monoio-wisckey-lint
- name: "Formatting Checks"
run: just check-formatting
# Does not work well as some dependencies only used by certain features
Expand Down
15 changes: 13 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ LOG_LEVEL := "debug"

all: tests lint

tests: sync-tests async-tests no-compression-tests tokio-uring-tests wisckey-tests wisckey-no-compression-tests wisckey-sync-tests
tests: sync-tests async-tests no-compression-tests \
tokio-uring-tests wisckey-tests \
wisckey-no-compression-tests wisckey-sync-tests \
monoio-tests monoio-wisckey-tests

sync-tests:
cd sync && just default-tests
Expand All @@ -16,6 +19,9 @@ tokio-uring-tests:
monoio-tests:
env RUST_BACKTRACE=1 RUST_LOG={{LOG_LEVEL}} cargo test --no-default-features --features=monoio,bloom-filters -- --test-threads=1

monoio-wisckey-tests:
env RUST_BACKTRACE=1 RUST_LOG={{LOG_LEVEL}} cargo test --no-default-features --features=monoio,wisckey,bloom-filters -- --test-threads=1

tokio-uring-wisckey-tests:
env RUST_BACKTRACE=1 RUST_LOG={{LOG_LEVEL}} cargo test --no-default-features --features=tokio-uring,wisckey,bloom-filters -- --test-threads=1

Expand All @@ -31,7 +37,9 @@ wisckey-no-compression-tests:
wisckey-sync-tests:
cd sync && just wisckey-tests

lint: sync-lint async-lint wisckey-lint wisckey-no-compression-lint tokio-uring-lint tokio-uring-wisckey-lint monoio-lint
lint: sync-lint async-lint wisckey-lint \
wisckey-no-compression-lint tokio-uring-lint \
tokio-uring-wisckey-lint monoio-lint monoio-wisckey-lint

fix-formatting:
cargo fmt
Expand Down Expand Up @@ -64,6 +72,9 @@ tokio-uring-lint:
monoio-lint:
cargo clippy --no-default-features --features=monoio,bloom-filters -- -D warnings

monoio-wisckey-lint:
cargo clippy --no-default-features --features=monoio,wisckey,bloom-filters -- -D warnings

wisckey-lint:
cargo clippy --no-default-features --features=snappy-compression,wisckey -- -D warnings

Expand Down
8 changes: 6 additions & 2 deletions src/values/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ use crate::Error;

use lru::LruCache;

#[cfg(feature = "_async-io")]
#[cfg(feature = "monoio")]
use monoio::fs::OpenOptions;
#[cfg(feature = "monoio")]
use std::fs::remove_file;
#[cfg(feature = "tokio-uring")]
use tokio_uring::fs::{OpenOptions, remove_file};

#[cfg(not(feature = "_async-io"))]
Expand Down Expand Up @@ -292,7 +296,7 @@ impl ValueLog {
self.manifest.set_value_log_offset(vlog_offset + 1).await;

cfg_if! {
if #[ cfg(feature="_async-io") ] {
if #[ cfg(feature="tokio-uring") ] {
remove_file(&fpath).await?;
} else {
remove_file(&fpath)?;
Expand Down
9 changes: 6 additions & 3 deletions src/values/tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#[cfg(feature = "async-io")]
use tokio_uring::test as async_test;
#[cfg(feature = "tokio-uring")]
use tokio_uring_executor::test as async_test;

#[cfg(not(feature = "async-io"))]
#[cfg(feature = "monoio")]
use monoio::test as async_test;

#[cfg(not(feature = "_async-io"))]
use tokio::test as async_test;

use super::*;
Expand Down

0 comments on commit 2d0c394

Please sign in to comment.