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
1 change: 0 additions & 1 deletion quest/m0/ci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,5 @@ 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
- [Local test runs honor NEXTEST_NO_FAIL_FAST](/quest/m0/ci/no-fail-fast.md) - `just check` and `sh/rs/nextest.sh` pass `--no-fail-fast` through, so one host failure doesn't hide the rest
- [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`
24 changes: 0 additions & 24 deletions quest/m0/ci/no-fail-fast.md

This file was deleted.

2 changes: 2 additions & 0 deletions sh/coverage.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ def rust(self, name="workspace", fail=False):
)

def test_rust_measures_native_workspace_without_fuzz_targets(self):
self.env["NEXTEST_NO_FAIL_FAST"] = "1"
result = self.rust()
self.assertEqual(result.returncode, 0, result.stderr)
calls = self.recorded()
self.assertEqual(calls[0][2:], ["llvm-cov", "clean", "--workspace"])
build = calls[1][2:]
self.assertEqual(build[:3], ["llvm-cov", "nextest", "--no-fail-fast"])
self.assertIn("--workspace", build)
for excluded in ("moq-net-fuzz", "moq-quic-fuzz", "moq-mux-fuzz", "moq-rtmp-fuzz"):
self.assertIn(excluded, build)
Expand Down
20 changes: 20 additions & 0 deletions sh/rs/nextest.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail

# nextest has no environment binding for this flag. Explicit runner options
# take precedence; arguments after `--` are test filters instead.
if [[ -n "${NEXTEST_NO_FAIL_FAST:-}" ]]; then
case "${1:-} ${2:-} ${3:-}" in
'cargo nextest run' | 'cargo llvm-cov nextest')
no_fail_fast=1
for arg in "${@:4}"; do
case "$arg" in
--) break ;;
--fail-fast | --ff | --no-fail-fast | --nff | --max-fail | --max-fail=* | --no-run)
no_fail_fast=
break
;;
esac
done
if [[ -n "$no_fail_fast" ]]; then set -- "${@:1:3}" --no-fail-fast "${@:4}"; fi
;;
esac
fi

# Rings share the user's locked-memory accounting across processes. Hosted CI
# can raise its hard limit; local shells use the hard limit the host grants.
if [[ "$(uname -s)" == Linux ]]; then
Expand Down
78 changes: 77 additions & 1 deletion sh/rs/test-lints.test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""A test build must reject Clippy findings without a separate lint compile."""
"""Rust test runs enforce lints and preserve runner options."""

import os
import shutil
Expand All @@ -11,6 +11,82 @@


class TestLints(unittest.TestCase):
def test_fail_fast_environment_reaches_nextest(self):
temporary = ROOT / ".tmp"
temporary.mkdir(exist_ok=True)
with tempfile.TemporaryDirectory(dir=temporary) as directory:
root = Path(directory)
(root / "rs").mkdir()
(root / "sh" / "rs").mkdir(parents=True)
(root / "src").mkdir()
shutil.copy(ROOT / "sh" / "local.sh", root / "sh" / "local.sh")
shutil.copy(ROOT / "sh" / "local.ts", root / "sh" / "local.ts")
(root / "justfile").write_text("mod rs\n")
shutil.copy(ROOT / "rs" / "justfile", root / "rs" / "justfile")
shutil.copy(ROOT / "sh" / "rs" / "nextest.sh", root / "sh" / "rs" / "nextest.sh")
(root / "Cargo.toml").write_text(
'[package]\nname = "fail-fast-probe"\nversion = "0.0.0"\nedition = "2024"\n\n[workspace]\n'
)
(root / "src" / "lib.rs").write_text(
'#[test]\nfn first() { panic!("first failure"); }\n#[test]\nfn second() { panic!("second failure"); }\n'
)
toolchain = Path(shutil.which("clippy-driver")).parent
env = dict(
os.environ,
CARGO_TARGET_DIR=str(root / "target"),
NEXTEST_PROFILE="default",
PATH=f"{toolchain}:{os.environ['PATH']}",
)
env.pop("NEXTEST_NO_FAIL_FAST", None)
subprocess.run(
["cargo", "generate-lockfile", "--offline"], cwd=root, env=env, check=True, capture_output=True
)
for command in (["just", "rs", "test"], ["bash", "sh/rs/nextest.sh", "cargo", "nextest", "run"]):
for value, options, count in (
(None, [], 1),
("", [], 1),
("1", [], 2),
("1", ["--no-fail-fast"], 2),
("1", ["--nff"], 2),
("1", ["--fail-fast"], 1),
("1", ["--ff"], 1),
("1", ["--max-fail", "1"], 1),
("1", ["--max-fail=1"], 1),
):
with self.subTest(command=command, value=value, options=options):
run_env = env.copy()
if value is not None:
run_env["NEXTEST_NO_FAIL_FAST"] = value
result = subprocess.run(
[
*command,
*options,
"--test-threads",
"1",
"--retries",
"0",
"--",
"--exact",
"first",
"second",
],
cwd=root,
env=run_env,
text=True,
capture_output=True,
)
self.assertNotEqual(result.returncode, 0, result.stdout + result.stderr)
self.assertIn(f"{count} failed", result.stderr)
self.assertEqual("tests were not run due to test failure" in result.stderr, count == 1)
result = subprocess.run(
[*command, "--no-run"],
cwd=root,
env=dict(env, NEXTEST_NO_FAIL_FAST="1"),
text=True,
capture_output=True,
)
self.assertEqual(result.returncode, 0, result.stdout + result.stderr)

def test_clippy_warning_fails_test_build(self):
temporary = ROOT / ".tmp"
temporary.mkdir(exist_ok=True)
Expand Down
Loading