-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathjustfile
More file actions
78 lines (61 loc) · 3.01 KB
/
Copy pathjustfile
File metadata and controls
78 lines (61 loc) · 3.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# List available commands
default:
@just --list
# Sync git submodules
sync:
git submodule update --init --recursive
# Build the s2 CLI binary (includes lite subcommand)
build *args: sync
cargo build --locked --release -p s2-cli {{args}}
# Run clippy linter
clippy *args: sync
cargo clippy --locked --workspace --all-features --all-targets {{args}} -- -D warnings --allow deprecated
# Run clippy on the simulator (separate workspace)
sim-clippy *args:
RUSTFLAGS="--cfg tokio_unstable" cargo clippy --manifest-path sim/Cargo.toml --all-targets {{args}} -- -D warnings --allow deprecated
# Ensure cargo-deny is installed
_ensure-deny:
@cargo deny --version > /dev/null 2>&1 || (echo "cargo-deny is required; run: brew install cargo-deny" && exit 1)
# Run cargo-deny checks
deny *args: _ensure-deny
cargo deny check {{args}}
# Ensure nightly toolchain is installed
_ensure-nightly:
@rustup toolchain list | grep -q nightly || (echo "❌ Nightly toolchain required. Run: rustup toolchain install nightly" && exit 1)
# Format code with rustfmt
fmt: _ensure-nightly
cargo +nightly fmt
cargo +nightly fmt --manifest-path sim/Cargo.toml
# Ensure cargo-nextest is installed
_ensure-nextest:
@cargo nextest --version > /dev/null 2>&1 || (echo "cargo-nextest is required; run: brew install cargo-nextest" && exit 1)
# Run tests with nextest (excludes Docker-backed and live integration tests)
test *args: sync _ensure-nextest
cargo nextest run --locked --workspace --all-features --exclude s2-testcontainers -E 'not ((package(s2-cli) & binary(integration)) or (package(s2-sdk) & (binary(account_ops) or binary(basin_ops) or binary(metrics_ops) or binary(stream_ops))))' {{args}}
# Run CLI integration tests (requires s2 lite server running)
test-cli-integration: sync _ensure-nextest
S2_ACCESS_TOKEN=test S2_ACCOUNT_ENDPOINT=http://localhost S2_BASIN_ENDPOINT=http://localhost \
cargo nextest run --locked -p s2-cli --test integration
# Run SDK integration tests (requires S2_ACCESS_TOKEN and optional custom endpoints)
test-sdk-integration: sync _ensure-nextest
cargo nextest run --locked -p s2-sdk --test account_ops --test basin_ops --test metrics_ops --test stream_ops
# Verify Cargo.lock is up-to-date
check-locked:
cargo metadata --locked --format-version 1 >/dev/null
# Install git hooks from hooks/
install-hooks:
ln -sf `pwd`/hooks/pre-commit .git/hooks/pre-commit
@echo "Git hooks installed"
# Clean build artifacts
clean:
cargo clean
# Run s2-lite
lite *args:
cargo run --locked --release -p s2-cli -- lite {{args}}
# Run the s2-lite deterministic simulation (e.g. `just sim smoke --seed 42`,
# `just sim linearizable --seed 42 --clients 3 --ops-per-client 100`)
# The simulator lives in its own workspace (sim/) to isolate its patched
# dependencies (getrandom fork, etc.) from the main workspace.
# tokio_unstable is required so turmoil can seed tokio's internal RNG.
sim *args:
RUSTFLAGS="--cfg tokio_unstable" cargo run --manifest-path sim/Cargo.toml --profile sim -- {{args}}