From 256dc9bc12c717dea84f6a41371c67acc47edb62 Mon Sep 17 00:00:00 2001 From: rustdesk Date: Wed, 14 Oct 2026 16:39:57 +0800 Subject: [PATCH] docs: scope the -p rule to macOS and Windows Linux CI runs cargo test --workspace, so a Linux-gated test in another crate already runs there. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WS1HTjp6UQuG43KEcQPq1R --- AGENTS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AGENTS.md b/AGENTS.md index f56876fbe..1f41b7517 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -187,7 +187,7 @@ A refactor added to cover a corner case rarely converges. Each new counter, time * If the test diff is more than twice the fix, cut it back to the tests that pin the reported behavior. A state that needs long setup to reach is usually too rare to fix. * When the number of tests needed to describe the behavior keeps growing, the implementation is too complex: simplify it instead of adding tests. * Dart tests go in `flutter/test/*_test.dart`, nowhere else: CI runs `flutter test` over that directory and nothing outside it. It runs on the VM, so a `@TestOn('browser')` suite runs in no CI job. -* Rust unit tests go in a `#[cfg(test)]` module beside the code. CI runs `cargo test --workspace` with the default features on x86_64 Linux, `cargo test --lib` on the root package with the release feature set on macOS and Windows plus `-p clipboard` there, and on Linux the `drm` test modules by name plus the `clipboard` package with `unix-file-copy-paste`. A platform-gated test in another workspace crate runs on that platform only if a job names the crate with `-p`. Gate a test module on a feature or `target_os` only when the code under test is gated; a pure helper that only a gated path calls gets `#[cfg(any(feature = "...", test))]`, so its tests run everywhere. +* Rust unit tests go in a `#[cfg(test)]` module beside the code. CI runs `cargo test --workspace` with the default features on x86_64 Linux, `cargo test --lib` on the root package with the release feature set on macOS and Windows plus `-p clipboard` there, and on Linux the `drm` test modules by name plus the `clipboard` package with `unix-file-copy-paste`. On macOS and Windows, a platform-gated test in another workspace crate runs only if that platform's job names the crate with `-p`. Gate a test module on a feature or `target_os` only when the code under test is gated; a pure helper that only a gated path calls gets `#[cfg(any(feature = "...", test))]`, so its tests run everywhere. * A test behind a feature that no CI build enables needs a `cargo test` line in `.github/workflows/flutter-build.yml` that names it. In the Linux drm job, wrap it in `run_drm_tests` so a filter that matches nothing fails instead of passing. * Web core tests are `flutter/web/js/src/*.test.ts`, run by jest in that repository's own CI.