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
7 changes: 4 additions & 3 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,16 @@ install:
# Lints, compiles, and tests only the packages the branch changed plus
# everything depending on them; `check --all` is the unscoped suite. BASE
# defaults to the PR base, then a main/release upstream, then origin/main.
# Rust compiles once: its test build doubles
# as the clippy gate (see `rs check-test`).
# Rust's test build doubles as the clippy gate, with a targeted default-media
# lint for cfgs hidden by the device features (see sh/rs/select.sh).

# Lint, compile, and test what the branch changed since BASE, plus its dependents.
check $BASE="":
sh/dispatch.sh check "$BASE"

# The landing worker runs this gate in one job. The test build also enforces
# default-feature clippy; the feature matrix and optimized bindings run
# clippy; a separate lint covers media tests with default features. The
# feature matrix and optimized bindings run
# nightly and on release PRs. Missing tools fail under CI_STRICT. The host
# land gate also sets CHECK_FAIL_FAST=1, so a failing batch stops at its first
# failed module.
Expand Down
1 change: 0 additions & 1 deletion quest/m0/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ The historical samples locate candidates; they are not controlled benchmarks.
- [Binary release publishers run on their tag](/quest/m0/ci/release-tag-publishers.md) - brew, Go and Swift releases stop running through `workflow_run` on main
- [The bench comparison builds moq-gst's catalog bench on its base](/quest/m0/ci/bench-base-build.md) - A paired bench comparison that selects `rust/gst/moq-gst/catalog` against `origin/main` builds the base side and reports a comparison, instead of marking it unavailable with "base build failed"
- [The workspace-hack refuses trybuild edges and spares non-media builds](/quest/m0/ci/hakari-followups.md) - `hakari.py` refuses trybuild dev-dependency edges, and non-media Linux test builds stop needing libpipewire and libclang
- [moq-audio's default-feature test build is clippy-clean and gated](/quest/m0/ci/default-feature-test-lint.md) - the dead `retains`/`fail` under default-feature `--tests` clippy is fixed, and the gate catches it next time
- [A release merge opens no stale release PR](/quest/m0/ci/release-pr-after-release.md) - `just rs release` publishes before it proposes, so a merged release isn't re-proposed
- [Dependabot leaves the workspace-hack to hakari](/quest/m0/ci/dependabot-workspace-hack.md) - cargo group PRs stop hand-editing `rs/workspace-hack/Cargo.toml`
- [mbx's free-space GC never removes a live target](/quest/m0/ci/mbx-gc.md) - the cargo shim stops deleting targets other sessions use when the host disk runs low
Expand Down
54 changes: 0 additions & 54 deletions quest/m0/ci/default-feature-test-lint.md

This file was deleted.

4 changes: 4 additions & 0 deletions rs/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ macos-test:
capture *args:
bash sh/local.sh cargo clippy --locked -p moq-video -p moq-audio --all-targets --features moq-video/capture,moq-audio/capture,moq-audio/playback "$@" -- -D warnings

# Lint media tests without the device features the gate's test build enables.
media-defaults:
bash sh/local.sh cargo clippy --locked -p moq-audio -p moq-video --tests -- -D warnings

# The capture and playback tests drive synthetic devices, so they need no hardware.

# Test the capture and playback features, which the default test pass skips.
Expand Down
4 changes: 2 additions & 2 deletions rs/moq-audio/src/encode/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ impl Producer {
}

/// Whether unencoded history is still retained.
#[cfg(any(feature = "capture", test))]
#[cfg(feature = "capture")]
pub(crate) fn retains(&self) -> bool {
!self.backlog.is_empty()
}
Expand Down Expand Up @@ -611,7 +611,7 @@ impl Producer {

/// [`finish`](Self::finish) the track with `err`, for a source that failed: subscribers keep
/// every packet published, then get `err` instead of the end of stream.
#[cfg(any(feature = "capture", test))]
#[cfg(feature = "capture")]
pub(crate) fn fail(&mut self, err: moq_net::Error) -> Result<(), Error> {
self.end(Some(err))
}
Expand Down
4 changes: 2 additions & 2 deletions sh/dispatch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ step() {
check:js) just js check-changed "$js_list" ;;
check:workers) just js workers ;;
check:moq_sh) just infra moq-sh test ;;
# The check keeps docs; the test phase enforces default-feature clippy
# without a second compile.
# The check keeps docs and the isolated default-media lint; the test
# phase enforces the other clippy checks in its existing build.
check:rs) just rs lint-changed "$rs_list" ;;
check:bench)
python3 bench/compare.test.py
Expand Down
6 changes: 6 additions & 0 deletions sh/rs/select.sh
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ case "$action" in
# Nightly runs the Send-depth proof (`just rs send-depth`) on its
# pinned toolchain.
just rs "$action" "${flags[@]}"
# The test build enables device features, which can hide unused items
# in the default-feature test cfg. Keep this compile isolated from the
# selected dependents, whose features would unify capture back in.
if [[ "$action" == lint ]] && wants '(moq-video|moq-audio)'; then
just rs media-defaults
fi
# Device code behind the off-by-default `capture` feature. check-test
# lints it through the test build, as for the default features.
if [[ "$action" != lint ]] && wants '(moq-video|moq-audio)'; then
Expand Down
19 changes: 16 additions & 3 deletions sh/rs/select.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,28 @@ def test_gate_runs_no_feature_matrix(self):
self.assertEqual(self.selected(f"sh/rs/{owner}-features.sh"), [])

def test_gate_leaves_send_depth_to_nightly(self):
# Nightly runs `rs send-depth` on the pinned toolchain; the gate's lint
# is the one cargo pass.
# Nightly runs `rs send-depth` on the pinned toolchain.
for path in ("rs/moq-net/src/lib.rs", "rs/kio/src/lib.rs", "Cargo.lock"):
with self.subTest(path=path):
calls = self.selected(path)
self.assertEqual(len(calls), 1, calls)
self.assertEqual(len(calls), 2, calls)
self.assertTrue(calls[0].startswith("rs lint "), calls)
self.assertEqual(calls[1], "rs media-defaults", calls)
self.assertEqual(self.selected("sh/rs/send-depth.sh"), [])

def test_media_defaults_are_isolated_from_device_features(self):
for path in ("rs/moq-audio/src/lib.rs", "rs/moq-video/src/lib.rs", "Cargo.lock"):
for github_actions in (False, True):
with self.subTest(path=path, github_actions=github_actions):
calls = self.selected(path, github_actions=github_actions)
self.assertEqual(calls[-1], "rs media-defaults", calls)
self.assertEqual(calls.count("rs media-defaults"), 1, calls)
# A crate with no media dependents needs no extra compile.
for action in ("lint", "test"):
self.assertNotIn("rs media-defaults", self.selected("rs/moq-auth/src/lib.rs", action=action))
# The device-feature test build stays a single build.
self.assertNotIn("rs media-defaults", self.selected("rs/moq-audio/src/lib.rs", action="test"))

def test_device_features_join_the_one_test_build(self):
for path, features in (
("rs/moq-audio/src/lib.rs", DEVICE_FEATURES),
Expand Down
Loading