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
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1205,7 +1205,7 @@ jobs:
setup.cfg

- name: Install dependencies
run: uv pip install --system -e ".[voice,desktop]" --group dev
run: uv pip install --system -e ".[voice,desktop,otlp]" --group dev

# Setup/install stays under the runner identity. Select test scope also
# stays there because it writes the runner-owned GITHUB_OUTPUT file.
Expand Down Expand Up @@ -1504,7 +1504,7 @@ jobs:
setup.cfg

- name: Install dependencies
run: uv pip install --system -e ".[voice,desktop]" --group dev
run: uv pip install --system -e ".[voice,desktop,otlp]" --group dev

- name: Verify Windows test prerequisites
if: runner.environment == 'self-hosted'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/platform-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
enable-cache: false

- name: Install dependencies
run: uv pip install --system -e ".[voice,desktop]" --group dev
run: uv pip install --system -e ".[voice,desktop,otlp]" --group dev

# The macOS peer-identity check is admission-gating: gatewayd refuses any
# connection that is not MATCH, so this canary -- a real transport.serve /
Expand Down
2 changes: 1 addition & 1 deletion docs/ci/ci-and-reviews.md
Original file line number Diff line number Diff line change
Expand Up @@ -709,7 +709,7 @@ yet decided: install from a committed constraints file, or set
| `lint-gate` | "Lint Gate". Aggregates `backend-lint` and `frontend-lint` for the heavy jobs (see [Lint first](#lint-first)). Runs when both ended `success` or `skipped`; SKIPPED when either failed or was cancelled, so the lint job is the one red and the heavy jobs skip behind it |
| `cancel-superseded-run` | "Cancel Superseded Run". Runs only on a push to `main` (and not on a queue-landed push, like the barrier), beside `await-fast-gate` rather than behind it. It runs the barrier's script as a probe and, only when that proves this commit's Fast Gate run was evicted before it started, makes the workflow's one write: `POST /actions/runs/{run_id}/cancel` on its own run, so the run concludes `cancelled` instead of `failure`. Any other outcome cancels nothing and exits 0, leaving the verdict to the barrier. It is the only job in `ci.yml` with `actions: write`; pull requests and merge groups never start it. Nothing needs it, so it cannot release the matrix, and a cancelled run is never a green one |
| `backend-lint` | `isort --check-only`, `flake8`, `mypy` on Python 3.12, plus `scripts/check_black_formatting.py` — black enforced on every file outside `.github/black-baseline.txt`, which can only shrink; on a PR it runs only on the changed `src/` and `test/` Python files (a baseline edit that only deletes entries adds those paths), and an edit to `pyproject.toml` or an added baseline entry forces the whole tree, as does `main-ratchet-audit.yml`. Black here and the four scope-resolving gates in `backend-ratchets` read their diff scope from the one shared resolver in `scripts/ratchet_scope.py`, so they cannot disagree about which lines a change added; the env-base gates (`check_brand_name.py`, `check_harness_parity.py`, `check_focus_cue.py`) share the same diff parsing through its explicit-base entry points while keeping their `*_BASE_REF` base semantics |
| `backend-test` | 8 whole-file shards on Python 3.12, assigned before import, an explicit xdist worker count within each (`-n "$WORKERS"`: one per 2 GiB after 2 GiB for the host, capped at the core count, so 6 on the 15 GiB fleet runner; the memory budget behind `-n auto` reserves 5 GiB a worker for a full-suite collection (it granted a file shard 4 when it reserved 3); the job logs its peak memory); 60-minute job budget on CodeBuild, 70 off the fleet where the shards run four-wide, both including coverage upload, with the 120-second per-test timeout retained. A test still running 30 seconds past its own pytest-timeout has every thread's stack dumped to the log (`scripts/ci_faulthandler_budget.py`, `--faulthandler-grace=30`), so a hang that timeout's `SIGALRM` could not end names its frame. The dump never fires inside a test's budget: faulthandler walks threads without the GIL, and a walk of a thread still running Python can segfault the worker. Large CodeBuild compute with the non-root boundary for eligible actors; hosted fallback |
| `backend-test` | 8 whole-file shards on Python 3.12, assigned before import, an explicit xdist worker count within each (`-n "$WORKERS"`: one per 2 GiB after 2 GiB for the host, capped at the core count, so 6 on the 15 GiB fleet runner; the memory budget behind `-n auto` reserves 5 GiB a worker for a full-suite collection (it granted a file shard 4 when it reserved 3); the job logs its peak memory); 60-minute job budget on CodeBuild, 70 off the fleet where the shards run four-wide, both including coverage upload, with the 120-second per-test timeout retained. A test still running 30 seconds past its own pytest-timeout has every thread's stack dumped to the log (`scripts/ci_faulthandler_budget.py`, `--faulthandler-grace=30`), so a hang that timeout's `SIGALRM` could not end names its frame. The dump never fires inside a test's budget: faulthandler walks threads without the GIL, and a walk of a thread still running Python can segfault the worker. Large CodeBuild compute with the non-root boundary for eligible actors; hosted fallback. Installs the `voice`, `desktop` and `otlp` extras, as `backend-test-windows` and `platform-tests.yml` do, so the `requires_otlp` wire tests run instead of skipping |
| `backend-test-windows` | All 8 whole-file shards use large CodeBuild compute for eligible actors, windows-latest otherwise; `--no-cov`, 180s per-test timeout. On a fork pull request it runs only when the `changes` job finds a Windows path (including `.github/actions/setup-windows-tests/**`, `**/*.ps1`, `**/conftest.py` and the platform shims), an added or removed `*.py` line that branches on Windows, the `ci:windows` label or `ci-full-run` (the label takes effect on the next push); main's own CI always runs it. See the migration contract below |
| `backend-test-ipv6` | Five native IPv6 cases on hosted Linux and Windows; fail-closed report check, Linux full-run coverage merged with the ordinary shards |
| `backend-test-kernel-lock-owner` | Runs the two strict live-holder/orphan flock cases on an uncontainerized hosted VM (the `kirocrew-runners` group here, `ubuntu-latest` in a fork) with `KIROCREW_LOCK_OWNER_STRICT=1`; full-scope coverage is merged with the shard and IPv6 artifacts. **Skipped on a frontend-only diff** (`only_frontend`); Coverage Gate accepts `skipped` in that case |
Expand Down
1 change: 1 addition & 0 deletions test/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ def bundled_python_with_user_site(monkeypatch: pytest.MonkeyPatch) -> None:
_forget_legacy_auth_sweep_clean_roots,
_forget_mount_source_sweep_pacing,
_forget_sandbox_launch_mark,
_forget_tracing_switch,
_fresh_aws_bin_dir_trust,
_fresh_hardlink_spec_warnings,
_fresh_reexec_environment,
Expand Down
22 changes: 22 additions & 0 deletions test/conftest_resets.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,28 @@ def _drop_live_config_snapshot():
live.reset_for_tests()


@pytest.fixture(autouse=True)
def _forget_tracing_switch():
"""Give every test an unread tracing switch.

``kiro_crew.tracing.provider`` resolves the switch once and serves the cached
answer until ``reset_for_testing()``. A test that boots the gateway services
(``service_boot`` calls ``watch_config``, which resolves it) leaves "off" cached,
so a later test on the same worker that writes its own config is told tracing
is off and exports nothing, with no log line. Measured: ``test_slack_gateway.py``'s
``test_init_services_creates_all`` followed by ``test_tracing_otlp.py``'s
``test_a_traced_turn_reaches_a_loopback_receiver_with_its_vault_header``.

Reset at setup, not teardown, so ``_no_leaked_telemetry_exporter`` still sees
(and reports) an exporter thread a test left running. A test that never
imported the module pays one dict lookup.
"""
provider = sys.modules.get("kiro_crew.tracing.provider")
if provider is not None:
provider.reset_for_testing()
yield


@pytest.fixture(autouse=True)
def _reset_env_boot_record_and_ownership():
"""Give every test an empty boot ``.env`` record and ``.env`` ownership set.
Expand Down
5 changes: 3 additions & 2 deletions test/metrics/test_otlp_session.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
"""``metrics.otlp_session`` without the optional ``otlp`` extra.

The loopback tests in ``test_otlp_no_redirect.py`` drive the real exporter and
skip when the extra is absent, as it is in CI. These cover every branch of the
session choice with the SDK module stubbed, so they always run.
skip when the extra is absent, as it is in a default dev install (CI's backend
test lanes install it). These cover every branch of the session choice with the
SDK module stubbed, so they run either way.
"""

from __future__ import annotations
Expand Down
4 changes: 2 additions & 2 deletions test/metrics/test_otlp_wire_e2e.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
what an exporter actually received.

Two tiers, because the OTLP exporter is an optional extra
(``pip install "kirocrew[otlp]"``) that a default dev/CI environment does not
have:
(``pip install "kirocrew[otlp]"``) that a default dev environment does not have
(CI's backend test lanes install it):

* **Tier 1 — serialization (always runs).** The live build's own JSONL exporter
writes real records to disk. Asserts the full instrument roster arrives, that
Expand Down
Loading