diff options
| -rw-r--r-- | .cargo/config.toml | 6 | ||||
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rw-r--r-- | Cargo.toml | 3 | ||||
| -rw-r--r-- | docs/development.md | 22 | ||||
| -rw-r--r-- | src/api/dashboard/check.js | 2 | ||||
| -rw-r--r-- | src/api/dashboard/mod.rs | 2 | ||||
| -rw-r--r-- | src/transport/mycelium/real_daemons.rs | 2 |
7 files changed, 25 insertions, 16 deletions
diff --git a/.cargo/config.toml b/.cargo/config.toml index 36c105c..2230736 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,9 @@ # Shortcuts for the development loop (docs/development.md). [alias] # Everything but the simulations: a few seconds. -quick = "test --features mycelium,libp2p,tor,dashboard,federation -- --skip simtest" +quick = "test --features most -- --skip simtest" # The simulations: whole swarms in one process, in real time. -sim = "test --features mycelium,libp2p,tor,dashboard,federation simtest" +sim = "test --features most simtest" # The benchmarks: ignored tests named bench_*, in release builds, one at a time, with # what they print (`cargo bench` itself takes no aliases). -benchmarks = "test --release --features mycelium,libp2p,tor,dashboard,federation bench_ -- --ignored --nocapture --test-threads=1" +benchmarks = "test --release --features most bench_ -- --ignored --nocapture --test-threads=1" diff --git a/CHANGELOG.md b/CHANGELOG.md index b70d7bd..ed31404 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ it from the release before ([`docs/operations.md`](docs/operations.md), ## Unreleased +* The feature `most` builds every transport, the dashboard and the federation at once, + as development does throughout ([`docs/development.md`](docs/development.md); + [`Cargo.toml`](Cargo.toml)). + * A node that stopped cleanly writes on as the writer of before (`--keep-actor`, on by default; `keep-actor = false` in a configuration file turns it off), holding its writes until it synced once with a ready neighbour, or 10 seconds passed, so that a @@ -36,6 +36,9 @@ tor = [ "dep:tor-rtcompat", "dep:safelog", ] +# Every feature above but tokio-console, for development: builds, checks and tests with +# one set of features don't rebuild what another set built. Not a default. +most = ["dashboard", "federation", "libp2p", "mycelium", "tor"] [dependencies] anyhow = "1.0" diff --git a/docs/development.md b/docs/development.md index f921d22..2ad5bd6 100644 --- a/docs/development.md +++ b/docs/development.md @@ -3,18 +3,20 @@ ## The loop ```sh -cargo check --features mycelium,libp2p,tor,dashboard,federation # does it compile: seconds -cargo quick # every test but the simulations: seconds -cargo sim # the simulations (src/simtest/): under a minute -cargo test --features mycelium,libp2p,tor,dashboard,federation # both -cargo benchmarks # the benchmarks, in release builds +cargo check --features most # does it compile: seconds +cargo quick # every test but the simulations: seconds +cargo sim # the simulations (src/simtest/): under a minute +cargo test --features most # both +cargo benchmarks # the benchmarks, in release builds ``` `cargo quick`, `cargo sim` and `cargo benchmarks` are aliases ([`.cargo/config.toml`](../.cargo/config.toml)), -with every transport, the dashboard (`dashboard`, `GET /admin/dashboard`; +with the feature `most`: every transport, the dashboard (`dashboard`, `GET /admin/dashboard`; [`docs/dashboard.md`](dashboard.md)) and the federation (`federation`, built stage by stage and -not yet run by a node: [`docs/federation.md`](federation.md), [`docs/store.md`](store.md)); a -build without `federation` runs the tests continuum has without it. Each transport is a feature, +not yet run by a node: [`docs/federation.md`](federation.md), [`docs/store.md`](store.md)). +Development builds with `most` throughout, checks and single tests too: with one set of +features, none rebuilds what another built. A build without `federation` runs the tests +continuum has without it. Each transport is a feature, none of them default, and a build needs at least one: a transport left out takes its tests and dependencies with it (`--features libp2p` builds neither `reqwest` and the daemon supervision of Mycelium, nor arti; among Mycelium's tests is a swarm simulated on its @@ -50,7 +52,7 @@ MiB/s and 500 ms unless `BENCH_BRIDGE_FAST_RATE`, `BENCH_BRIDGE_SLOW_RATE` (MiB/ the same estimated on the member list's graph alone for up to 2000 members, with some links down, as now and along the writer's tree (`swarm/topology/tests.rs`, `bench_writer_trees`). One of -them alone: `cargo test --release --features mycelium,libp2p,tor,dashboard +them alone: `cargo test --release --features most bench_propagation -- --ignored --nocapture`. The dashboard's page has browser checks (`src/api/dashboard/check.js`): it loads @@ -61,7 +63,7 @@ from nixpkgs (Playwright's library and browsers of one version, nothing from npm ``` nix-shell src/api/dashboard/check.nix --run \ - 'cargo test --features dashboard dashboard_in_a_browser -- --ignored' + 'cargo test --features most dashboard_in_a_browser -- --ignored' ``` The simulations send the wire encoding alone, as libp2p and Tor do; a simulated net diff --git a/src/api/dashboard/check.js b/src/api/dashboard/check.js index ee37aa6..3325f21 100644 --- a/src/api/dashboard/check.js +++ b/src/api/dashboard/check.js @@ -1,4 +1,4 @@ -// Browser checks of the dashboard page (`cargo test --features dashboard +// Browser checks of the dashboard page (`cargo test --features most // dashboard_in_a_browser -- --ignored`, which serves this the page as the node does): the // page loads without errors; the peers table has a row per peer, and an update changes // cells without making the rows anew (`morphChildren`); the map draws a node per member; diff --git a/src/api/dashboard/mod.rs b/src/api/dashboard/mod.rs index c0de169..f5a91ac 100644 --- a/src/api/dashboard/mod.rs +++ b/src/api/dashboard/mod.rs @@ -908,7 +908,7 @@ mod tests { /// the map draw what the state says, a large map doesn't hold the page up, and the /// federation shows who writes where, what a proposal changes, and the votes. /// Needs Node.js with Playwright's library and its Chromium (`check.nix` gives them), - /// so only when asked: `cargo test --features dashboard dashboard_in_a_browser -- + /// so only when asked: `cargo test --features most dashboard_in_a_browser -- /// --ignored`. #[test] #[ignore] diff --git a/src/transport/mycelium/real_daemons.rs b/src/transport/mycelium/real_daemons.rs index 890002f..93095f8 100644 --- a/src/transport/mycelium/real_daemons.rs +++ b/src/transport/mycelium/real_daemons.rs @@ -2,7 +2,7 @@ //! (`MyceliumSetup::bootstrap`): two on loopback, one peering with the other, which carry //! a message each way after idling, again and again. Ignored: it needs `mycelium` on the //! `PATH` (Linux, as supervising does), and IPv6, which the daemons listen on for peers: -//! `cargo test --features mycelium -- --ignored two_supervised_daemons`. +//! `cargo test --features most -- --ignored two_supervised_daemons`. use std::sync::Arc; use std::time::Duration; |
