Commit Graph

1 Commits

Author SHA1 Message Date
hurui200320 49f1cfcdb6 chore(tests): suppress passing scenario output by default in behave-parallel unit test runner
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 44s
CI / helm (pull_request) Successful in 50s
CI / lint (pull_request) Successful in 1m15s
CI / build (pull_request) Successful in 1m6s
CI / benchmark-regression (pull_request) Failing after 1m22s
CI / quality (pull_request) Successful in 1m47s
CI / typecheck (pull_request) Successful in 1m51s
CI / security (pull_request) Successful in 1m52s
CI / e2e_tests (pull_request) Successful in 4m19s
CI / unit_tests (pull_request) Failing after 4m50s
CI / docker (pull_request) Has been skipped
CI / coverage (pull_request) Has been skipped
CI / integration_tests (pull_request) Failing after 3m28s
CI / status-check (pull_request) Failing after 3s
Implemented PassSuppressFormatter, a custom Behave formatter that buffers
per-scenario output and only flushes it to stdout when the scenario failed
or errored. Passing scenarios produce no output, keeping an all-passing
suite at ~5-10 lines (the _print_overall_summary block only).

Key design decisions:
- PassSuppressFormatter (in scripts/behave_pass_suppress_formatter.py)
  inherits from behave's Formatter base class so it can be registered via
  behave.formatter._registry.register_as(), which enforces issubclass(cls,
  Formatter).
- _SUPPRESS_STATUSES = {'passed', 'skipped'} determines which terminal
  statuses are silently discarded; all others (failed, undefined, etc.)
  trigger a buffer flush so no failure is hidden.
- _make_runner() in run_behave_parallel.py registers the formatter and
  sets it as the default format whenever config.format is None (no
  explicit -f/--format flag). Coverage mode (BEHAVE_PARALLEL_COVERAGE=1)
  bypasses the formatter and falls back to config.default_format so
  slipcover can instrument a single process.
- The formatter lives in a separate file to keep both scripts under the
  500-line limit. _install_behave_parallel() in noxfile.py copies both
  files into the behave_parallel package. A try/except import handles
  both the direct-script path (tests via importlib) and the installed-
  package path (nox CI).
- Three new BDD scenarios in behave_parallel_log_filtering.feature cover:
  (1) passing scenario -> no output, (2) failing scenario -> full output,
  (3) mixed run -> only failing scenario visible. All 20 scenarios pass.

ISSUES CLOSED: #10987
2026-05-07 07:08:52 +00:00