Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
name: CI

on: [push, pull_request]
on:
pull_request:

jobs:
lint_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macOS-latest]
rust: [stable]
runs-on: ubuntu-latest

steps:
- name: Set up Rust toolchain
uses: hecrj/setup-rust-action@v2
with:
rust-version: ${{ matrix.rust }}
rust-version: stable

- name: Check out the code
uses: actions/checkout@v4
Expand All @@ -25,7 +22,11 @@ jobs:
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings

- name: Run tests
- name: Install cargo-nextest
run: cargo install cargo-nextest --locked

- name: Run tests with retries
env:
RUST_MIN_STACK: 8388608
run: cargo test --verbose -- --test-threads=1 --nocapture
# Timeout and retries configured in nextest.toml
run: cargo nextest run --test-threads=1 --retries=3
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Cargo.lock
# Added by cargo

/target

# Test run artifacts
test_*.log
12 changes: 10 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ edition = "2021"
[dependencies]
iroh = "0.24.0"
iroh-blobs = "0.24.0"
veilid-core = { git = "https://gitlab.com/veilid/veilid.git", tag = "v0.4.8" }
veilid-iroh-blobs = { git = "https://github.com/RangerMauve/veilid-iroh-blobs.git", tag = "v0.2.0" }
# Pin to avoid keyvaluedb-sqlite 0.1.6 + rusqlite 0.38 break (u64 FromSql not implemented)
keyvaluedb-sqlite = "=0.1.5"
rusqlite = "=0.37.0"
veilid-core = { git = "https://gitlab.com/veilid/veilid.git", tag = "v0.5.1" }
# v0.3.0 matches Veilid 0.5.1 API
veilid-iroh-blobs = { git = "https://github.com/RangerMauve/veilid-iroh-blobs", tag = "v0.3.0" }
tracing = "0.1"
xdg = "2.4"
tmpdir = "1"
Expand All @@ -27,3 +31,7 @@ url = "2.5.2"
hex = "0.4.3"
rand = "0.8.5"
base64 = "0.22.1"

# Temporary patch for Veilid fanout queue underflow bug
[patch."https://gitlab.com/veilid/veilid.git"]
veilid-core = { git = "https://gitlab.com/tripledoublev/veilid.git", branch = "fix-underflow" }
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,9 @@ The Save DWeb Backend is built using the Rust programming language, leveraging i


* Run tests with `cargo test`
* Tests can be slow (DHT/network). To run in the background and inspect later:
`RUST_MIN_STACK=8388608 cargo test -- --test-threads=1 2>&1 | tee test_output.log`
Output is written to `test_output.log`; `test_*.log` is gitignored.
* Format code with `cargo fmt`
* Lint with `cargo clippy`
* Run the backend with `cargo run`
Expand Down
12 changes: 12 additions & 0 deletions nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Nextest configuration for save-dweb-backend
# Veilid network tests can take several minutes due to DHT operations and network setup

[profile.default]
# Set timeout to 10 minutes per test (Veilid network operations can be slow)
test-timeout = "600s"

# Retry flaky tests up to 3 times
retries = 3

# Run tests serially to avoid Veilid network conflicts
test-threads = 1
Loading