aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/federation-check
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/federation-check')
-rwxr-xr-xscripts/federation-check19
1 files changed, 15 insertions, 4 deletions
diff --git a/scripts/federation-check b/scripts/federation-check
index e31e002..5327c38 100755
--- a/scripts/federation-check
+++ b/scripts/federation-check
@@ -11,8 +11,9 @@
# TAG is the latest federation-<F>.<R> unless given. The histories: of each
# revision and kind, generated from CONTINUUM_TEST_SEED on (a random one, said, unless
# given), CONTINUUM_TEST_CASES times as many as `write_histories` writes; and those the
-# attack tests offer. CONTINUUM_FEATURES are the features both are built with, a
-# transport among them (federation,mycelium unless given); the tag's build is kept in
+# attack tests offer. Both are built with CONTINUUM_FEATURES (a transport among them),
+# unless given: this tree with `most`, as development builds, the tag with it too where
+# it has it, else with the features it stands for; the tag's build is kept in
# CONTINUUM_CHECK_TARGET (~/.cache/continuum/federation-check unless given) for the
# next run.
@@ -25,7 +26,17 @@ if [ -z "$tag" ]; then
echo "federation-check: no federation-<F>.<R> tag to check against" >&2
exit 2
fi
-features=${CONTINUUM_FEATURES:-federation,mycelium}
+# The features tag $1 builds with: `most` where it has that feature, else the ones `most`
+# stands for, which a tag before it has.
+features_of() {
+ if git show "$1:Cargo.toml" 2>/dev/null | grep -q "^most = "; then
+ echo most
+ else
+ echo dashboard,federation,libp2p,mycelium,tor
+ fi
+}
+features=${CONTINUUM_FEATURES:-most}
+tag_features=${CONTINUUM_FEATURES:-$(features_of "$tag")}
seed=${CONTINUUM_TEST_SEED:-$(od -An -N4 -tu4 /dev/urandom | tr -d ' ')}
cache=${XDG_CACHE_HOME:-$HOME/.cache}
target=${CONTINUUM_CHECK_TARGET:-$cache/continuum/federation-check}
@@ -48,7 +59,7 @@ cargo run -q --features "$features" --bin continuum-party -- judge \
git worktree add -q --detach "$work/tagged" "$tag"
(cd "$work/tagged" && CARGO_TARGET_DIR=$target \
- cargo run -q --features "$features" --bin continuum-party -- judge) \
+ cargo run -q --features "$tag_features" --bin continuum-party -- judge) \
<"$work/histories" >"$work/there"
# Histories whose root the tag's continuum reads as none, of a revision after it, it