Skip to content

Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.

ci: handle observation contention and stage installed console assets (#171)

澄潭330d2587df96
diff --git a/.github/workflows/gateway-core.yml b/.github/workflows/gateway-core.yml
index f5844198..92e30e27 100644
--- a/.github/workflows/gateway-core.yml
+++ b/.github/workflows/gateway-core.yml
@@ -72,7 +72,7 @@ jobs:
fetch-depth: 0
- uses: ./.github/actions/ci-setup
- name: Use the candidate console in installed-product tests
- if: matrix.shard == 'integration-daemon'
+ if: matrix.shard == 'integration-daemon' || (matrix.shard == 'affected' && needs.selection.outputs.frontend == 'true')
uses: actions/download-artifact@v4
with:
name: desktop-console-${{ github.run_id }}-${{ github.run_attempt }}
diff --git a/crates/daemon/tests/support/quickstart_analysis.py b/crates/daemon/tests/support/quickstart_analysis.py
index 83a68839..00b23885 100644
--- a/crates/daemon/tests/support/quickstart_analysis.py
+++ b/crates/daemon/tests/support/quickstart_analysis.py
@@ -1,6 +1,7 @@
"""Installed public management: real captured content, price edits and opt-in estimate."""
import json
import time
+from functools import partial
from pathlib import Path
@@ -9,15 +10,16 @@ def query(view, payload):
def run(product, plan):
- snapshots = product.cli('sessions', 'list', '--include-unlinked', '--limit', '50')['data']['sessions']
+ read = partial(product.cli, retry_reader_busy=True)
+ snapshots = read('sessions', 'list', '--include-unlinked', '--limit', '50')['data']['sessions']
assert snapshots
selected = None
for session in snapshots:
- detail = product.cli('sessions', 'show', session['session_id'], '--content', 'messages-and-tools')['data']
+ detail = read('sessions', 'show', session['session_id'], '--content', 'messages-and-tools')['data']
assert detail['content_access'] != 'not_requested', detail
for turn in detail['turns']:
for rid in turn['receipt_ids']:
- receipt = product.cli('sessions', 'receipt', rid)['data']
+ receipt = read('sessions', 'receipt', rid)['data']
route_decisions = [e['fact'] for e in receipt['ordered_facts']
if e['fact']['kind'] == 'route_decision'
and e['fact'].get('complexity', {}).get('decision_source') == 'external_classifier']
@@ -35,16 +37,16 @@ def run(product, plan):
request = receipt['request_id']
assert any(e['fact']['kind'] == 'usage_and_cache' and e['fact']['cost_class'] != 'free'
for e in receipt['ordered_facts']), 'Custom/paid/unknown access must not be called free'
- facts = product.cli('sessions', 'receipt', '--request-stdin', payload=query('facts', {
+ facts = read('sessions', 'receipt', '--request-stdin', payload=query('facts', {
'request_id': request, 'limit': 200, 'cursor': None}))['data']
# V1 receipts own full decision evidence; V2 facts retain their existing safe summary.
assert any(f['event_kind'] == 'route_decision' for f in facts['facts']), facts
- catalog = product.cli('sessions', 'show', '--request-stdin', payload=query('catalog', {
+ catalog = read('sessions', 'show', '--request-stdin', payload=query('catalog', {
'request_id': request, 'limit': 1, 'cursor': None}))['data']
entries = list(catalog['contents'])
pages = 1
while catalog.get('next_cursor'):
- catalog = product.cli('sessions', 'show', '--request-stdin', payload=query('catalog', {
+ catalog = read('sessions', 'show', '--request-stdin', payload=query('catalog', {
'request_id': request, 'limit': 1, 'cursor': catalog['next_cursor']}))['data']
entries.extend(catalog['contents'])
pages += 1
@@ -52,7 +54,7 @@ def run(product, plan):
assert entries
text = ''
for entry in entries:
- content = product.cli('sessions', 'show', '--request-stdin', payload=query('content', {
+ content = read('sessions', 'show', '--request-stdin', payload=query('content', {
'request_id': request, 'content_id': entry['content_id'], 'cursor': None}))['data']
text += ''.join(c['text'] for c in content['chunks'])
assert 'controlled' in text or 'native product answer' in text, text
@@ -60,14 +62,14 @@ def run(product, plan):
# Search is explicitly selected and uses the same current visibility as body reads.
deadline = time.monotonic() + 20
while True:
- search = product.cli('sessions', 'list', '--request-stdin', payload=query('search', {
+ search = read('sessions', 'list', '--request-stdin', payload=query('search', {
'from_ms': now - 3600000, 'to_ms': now, 'session_id': session['session_id'],
'keyword': 'controlled', 'limit': 10, 'cursor': None}))['data']
if search['hits'] or time.monotonic() >= deadline:
break
time.sleep(.2)
assert search['hits'] and 'next_cursor' in search, search
- quality = product.cli('observation', 'plan-quality', 'samples', '--plan-id', plan)['data']
+ quality = read('observation', 'plan-quality', 'samples', '--plan-id', plan)['data']
assert 'samples' in quality
current = product.cli('routing', 'show', plan)['data']
binding = current['desired']['strategy']['primary'][0]['binding_id']
@@ -77,11 +79,11 @@ def run(product, plan):
prior = product.cli('prices', 'effective', '--request-stdin', payload=price_request)['data']
edit = prior['items'][0]['edit_context']
assert edit
- missing = product.cli('value', 'show', '--routing', plan, '--basis', 'api-equivalent',
+ missing = read('value', 'show', '--routing', plan, '--basis', 'api-equivalent',
'--reference-binding', binding, '--currency', 'CNY')['data']
assert missing['estimated_savings_micros'] is None and missing['actual_cash_micros'] is None
assert missing['missing_request_count'] > 0
- historical = product.cli('value', 'show', '--routing', plan)['data']
+ historical = read('value', 'show', '--routing', plan)['data']
operation_ids = []
previous_setting = None
frozen_summary = frozen_scope = None
@@ -103,50 +105,50 @@ def run(product, plan):
assert applied['state'] == 'succeeded', applied
operation_ids.append(applied['operation_id'])
if setting['kind'] == 'set':
- estimate = product.cli('value', 'show', '--routing', plan, '--basis', 'api-equivalent',
+ estimate = read('value', 'show', '--routing', plan, '--basis', 'api-equivalent',
'--reference-binding', binding, '--currency', 'CNY')['data']
assert estimate['coverage'] == 'complete' and estimate['compared_request_count'] > 0, estimate
assert estimate['routed_estimate_micros'] > 0 and estimate['estimated_savings_micros'] == 0, estimate
assert estimate['actual_cash_micros'] is None
- recent = product.cli('value', 'show', '--view', 'summary', '--routing', plan,
+ recent = read('value', 'show', '--view', 'summary', '--routing', plan,
'--currency', 'CNY')['data']
assert recent['time']['clipped_for_retention'] and 'retention_prefix_clipped' in recent['gaps'], recent
- summary = product.cli('value', 'show', '--view', 'summary', '--routing', plan,
+ summary = read('value', 'show', '--view', 'summary', '--routing', plan,
'--period', 'today', '--currency', 'CNY')['data']
assert summary['schema'] == 'hiroute.observation.analysis/v1', summary
assert summary['status'] in ('ready', 'partial') and summary['savings'], summary
assert summary['savings']['coverage'] == 'complete', summary
assert summary['savings']['estimated_savings_micros'] == 0, summary
frozen_summary, frozen_scope = summary['savings'], summary['analysis_scope']
- ranking = product.cli('value', 'show', '--group-by', 'session', '--order-by', 'cost-desc',
+ ranking = read('value', 'show', '--group-by', 'session', '--order-by', 'cost-desc',
'--analysis-scope', frozen_scope, '--limit', '1')['data']
ranked = list(ranking['costs'])
while ranking.get('next_cursor'):
- ranking = product.cli('value', 'show', '--group-by', 'session', '--order-by', 'cost-desc',
+ ranking = read('value', 'show', '--group-by', 'session', '--order-by', 'cost-desc',
'--cursor', ranking['next_cursor'], '--limit', '1')['data']
ranked.extend(ranking['costs'])
assert len(ranked) < 100
assert sum(r['known_sum_micros'] for r in ranked) == frozen_summary['compared_routed_subtotal_micros'], ranked
assert all(r['coverage'] == 'complete' for r in ranked), ranked
assert [r['known_sum_micros'] for r in ranked] == sorted([r['known_sum_micros'] for r in ranked], reverse=True)
- conversations = product.cli('sessions', 'list', '--view', 'conversations',
+ conversations = read('sessions', 'list', '--view', 'conversations',
'--analysis-scope', frozen_scope)['data']
assert sum(c['request_count'] for c in conversations['conversations']) == frozen_summary['request_count'], conversations
matching = next(c for c in conversations['conversations']
if any(m['session_id'] == session['session_id'] for m in c['members']))
anchor = matching['analysis_session_id']
- routing = product.cli('sessions', 'show', anchor, '--view', 'routing',
+ routing = read('sessions', 'show', anchor, '--view', 'routing',
'--analysis-scope', frozen_scope)['data']
assert routing['transitions'], routing
assert any(t['reason'] and t['reason']['selection'] for t in routing['transitions']), routing
- detail = product.cli('sessions', 'show', anchor, '--view', 'conversation', '--request', request,
+ detail = read('sessions', 'show', anchor, '--view', 'conversation', '--request', request,
'--analysis-scope', frozen_scope)['data']
assert len(detail['requests']) == 1 and detail['requests'][0]['request']['request_id'] == request, detail
assert detail['requests'][0]['content'], detail
assert all(c['kind'] not in ('provider_state', 'reasoning_delta', 'reasoning_finished')
for c in detail['requests'][0]['content']), detail
- scoped_request = product.cli('value', 'show', '--group-by', 'request', '--order-by', 'cost-desc',
+ scoped_request = read('value', 'show', '--group-by', 'request', '--order-by', 'cost-desc',
'--request', request, '--analysis-scope', frozen_scope)['data']
assert len(scoped_request['costs']) == 1, scoped_request
assert scoped_request['costs'][0]['request_id'] == request, scoped_request
@@ -154,7 +156,7 @@ def run(product, plan):
replay = product.cli('prices', 'override', 'apply', '--request-stdin', payload=apply)['data']
assert replay['operation_id'] == applied['operation_id']
previous_setting = setting
- pinned = product.cli('value', 'show', '--view', 'summary', '--analysis-scope', frozen_scope)['data']
+ pinned = read('value', 'show', '--view', 'summary', '--analysis-scope', frozen_scope)['data']
assert pinned['savings'] == frozen_summary, (pinned, frozen_summary)
restored = product.cli('prices', 'effective', '--request-stdin', payload=price_request)['data']
# Follow-catalog removes manual pricing. The missing-price reason can become more precise
@@ -162,7 +164,7 @@ def run(product, plan):
assert restored['items'][0]['quote']['origin'] == prior['items'][0]['quote']['origin'] == 'unknown'
assert all(rate['state'] == 'unknown' for rate in restored['items'][0]['quote']['rates'].values())
# Time bounds change, frozen monetary amounts and usage do not.
- after = product.cli('value', 'show', '--routing', plan)['data']
+ after = read('value', 'show', '--routing', plan)['data']
assert after['summary']['amounts'] == historical['summary']['amounts']
assert after['summary']['usage'] == historical['summary']['usage']
print(json.dumps({'scenario': 'installed-management-analysis', 'state': 'green',
diff --git a/crates/daemon/tests/support/standalone_headless_product.py b/crates/daemon/tests/support/standalone_headless_product.py
index 29ddee0a..08da4455 100644
--- a/crates/daemon/tests/support/standalone_headless_product.py
+++ b/crates/daemon/tests/support/standalone_headless_product.py
@@ -429,20 +429,46 @@ for line in sys.stdin:
gateway = self.cli('gateway', 'show')
assert gateway['data']['ready'] and gateway['data']['connect_address'], gateway
- def cli(self, *arguments, payload=None, expected=0, pass_fds=()):
+ def cli(self, *arguments, payload=None, expected=0, pass_fds=(), retry_reader_busy=False):
+ # Observation reads may report temporary contention. Opt in explicitly;
+ # mutations and their idempotency assertions must still run exactly once.
+ if retry_reader_busy:
+ assert expected == 0 and not pass_fds and (
+ arguments[:2] in (('sessions', 'list'), ('sessions', 'show'),
+ ('sessions', 'receipt'), ('value', 'show'))
+ or arguments[:3] == ('observation', 'plan-quality', 'samples')
+ ), 'reader_busy retry requires an observation read'
command = [str(self.cli_path), *arguments]
if '--output' not in command:
command.extend(['--output', 'json'])
- result = subprocess.run(
- command, cwd=self.project, env=self.env,
- input=(None if payload is None else
- payload.encode() if isinstance(payload, str) else wire(payload)),
- pass_fds=pass_fds, capture_output=True, timeout=90)
- self.outputs.extend((result.stdout, result.stderr))
- try:
- envelope = json.loads(result.stdout)
- except json.JSONDecodeError as error:
- raise AssertionError((command, result.returncode, result.stdout, result.stderr)) from error
+ body = (None if payload is None else
+ payload.encode() if isinstance(payload, str) else wire(payload))
+ deadline = time.monotonic() + 5
+ while True:
+ result = subprocess.run(
+ command, cwd=self.project, env=self.env, input=body,
+ pass_fds=pass_fds, capture_output=True,
+ timeout=max(.001, deadline - time.monotonic()) if retry_reader_busy else 90)
+ self.outputs.extend((result.stdout, result.stderr))
+ try:
+ envelope = json.loads(result.stdout)
+ except json.JSONDecodeError as error:
+ raise AssertionError((command, result.returncode, result.stdout, result.stderr)) from error
+ error = envelope.get('error') or {}
+ failure = error.get('observation_read') or {}
+ delay_ms = failure.get('retry_after_ms')
+ if (retry_reader_busy and result.returncode == 6
+ and envelope.get('status') == 'unavailable'
+ and error.get('code') == 'OBSERVATION_UNAVAILABLE'
+ and error.get('retryable') is True
+ and error.get('details_schema') == 'hiroute.observation.read-failure/v1'
+ and failure.get('reason') == 'reader_busy'
+ and failure.get('action') == 'retry_read'
+ and type(delay_ms) is int and delay_ms > 0
+ and time.monotonic() + delay_ms / 1000 < deadline):
+ time.sleep(delay_ms / 1000)
+ continue
+ break
daemon_failure = None
if (result.returncode != expected and self.daemon is not None
and self.daemon.poll() is not None):
diff --git a/docs/github-actions-validation.md b/docs/github-actions-validation.md
index 69157ba4..fac46dfe 100644
--- a/docs/github-actions-validation.md
+++ b/docs/github-actions-validation.md
@@ -58,7 +58,8 @@ package and all-features context. `ci-shards.py check` compares every non-Deskto
integration target with the explicit shard inventory; a missing, duplicate or same-name
cross-shard target fails selection instead of being silently omitted. The frontend job
exports its exact candidate console build; the daemon integration shard downloads those
-bytes for the installed Linux package scenario. Backend shards keep their configured
+bytes for the installed Linux package scenario. Affected PR plans that run the daemon
+package suite also build and download that candidate console. Backend shards keep their configured
Rust runners and depend on the frontend result without rebuilding it there. The required
`backend` status is a small aggregate job, so the public branch-protection contract remains
stable while individual shard jobs can run concurrently.
diff --git a/docs/test-selection.md b/docs/test-selection.md
index 2242a150..1949c883 100644
--- a/docs/test-selection.md
+++ b/docs/test-selection.md
@@ -27,7 +27,7 @@ semantics, explicit focused/final run associations and the required agent feedba
| Integrations | Integrations, application, CPA bridge, storage, release-facts, daemon and CLI tests, plus smoke. |
| Storage | Storage, observation, application, daemon, client core and CLI tests, plus smoke. |
| Observation | Observation, daemon, client core and CLI tests, plus smoke. |
-| Daemon | Daemon and CLI tests, plus smoke. |
+| Daemon | Daemon and CLI tests, plus smoke. Plans running the daemon package suite also build the candidate console required by installed management tests. |
| CPA bridge | CPA bridge, daemon, integrations and CLI tests, plus smoke. |
| Gateway/core | Both Gateway packages, protocol E2E, integrations, CPA bridge, storage, release-facts, daemon, CLI and smoke; retain the distinct no-default-features loopback. |
| Native Desktop | Frontend, CLI/client core/daemon and core smoke, plus the configured-Mac `desktop.compile` gate and affected native behavior checks; do not automatically expand to all backend packages. Hosted success does not prove native behavior. |
diff --git a/scripts/test-agent-product-support.py b/scripts/test-agent-product-support.py
index 1525965c..5856b17c 100644
--- a/scripts/test-agent-product-support.py
+++ b/scripts/test-agent-product-support.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
"""Shared native product-fixture mechanics; no native Agent or product acceptance claim."""
import os
+import json
import shutil
from pathlib import Path
import subprocess
@@ -8,10 +9,122 @@ import sys
import tempfile
from types import SimpleNamespace
import unittest
+from unittest.mock import patch
sys.dont_write_bytecode = True
sys.path.insert(0, str(Path(__file__).resolve().parents[1] / 'crates/daemon/tests/support'))
from agent_product_support import apply_settings, run_native_command, expose_native_installation
+import standalone_headless_product as headless
+
+
+class ObservationReadRetryTests(unittest.TestCase):
+ def setUp(self):
+ self.product = headless.InstalledProduct.__new__(headless.InstalledProduct)
+ self.product.cli_path = Path('/fixture/bin/hiroute')
+ self.product.project = Path('/fixture/project')
+ self.product.env = {}
+ self.product.outputs = []
+ self.product.daemon = None
+ self.now = 0
+ self.calls = []
+ for target, replacement in (
+ ('monotonic', lambda: self.now), ('sleep', self.sleep),
+ ):
+ mock = patch.object(headless.time, target, replacement)
+ mock.start()
+ self.addCleanup(mock.stop)
+
+ def sleep(self, seconds):
+ self.now += seconds
+
+ def response(self, envelope, code=0):
+ return subprocess.CompletedProcess([], code, json.dumps(envelope).encode(), b'')
+
+ def busy(self):
+ return {'status': 'unavailable', 'error': {
+ 'code': 'OBSERVATION_UNAVAILABLE', 'retryable': True,
+ 'details_schema': 'hiroute.observation.read-failure/v1',
+ 'observation_read': {'reason': 'reader_busy', 'retry_after_ms': 100, 'action': 'retry_read'},
+ }}
+
+ def test_busy_then_success_reuses_exact_scope_cursor_and_body(self):
+ busy = self.response(self.busy(), 6)
+ success = self.response({'status': 'succeeded', 'data': {'costs': [7]}})
+ payload = {'analysis_scope': 'frozen-scope', 'cursor': 'same-page', 'limit': 1}
+ with patch.object(headless.subprocess, 'run', side_effect=[busy, success]) as execute:
+ observed = self.product.cli('value', 'show', '--request-stdin', payload=payload,
+ retry_reader_busy=True)
+ self.assertEqual(observed['data'], {'costs': [7]})
+ first, second = execute.call_args_list
+ self.assertEqual(first.args, second.args)
+ self.assertEqual(first.kwargs['input'], second.kwargs['input'])
+ self.assertEqual(json.loads(second.kwargs['input']), payload)
+ self.assertAlmostEqual(self.now, .1)
+ self.assertLessEqual(second.kwargs['timeout'], first.kwargs['timeout'])
+ self.assertEqual(self.product.outputs, [busy.stdout, b'', success.stdout, b''])
+
+ def test_persistent_busy_fails_with_last_envelope_within_retry_budget(self):
+ envelope = self.busy()
+ with patch.object(headless.subprocess, 'run', return_value=self.response(envelope, 6)) as execute:
+ with self.assertRaises(AssertionError) as failure:
+ self.product.cli('value', 'show', retry_reader_busy=True)
+ self.assertEqual(failure.exception.args[0][3], envelope)
+ self.assertGreater(execute.call_count, 1)
+ self.assertLessEqual(execute.call_count, 51)
+ self.assertLessEqual(self.now, 5)
+
+ def test_other_failures_are_not_retried(self):
+ cases = []
+ for key, value in (('retryable', False), ('code', 'CAPABILITY_DENIED'),
+ ('details_schema', 'unknown')):
+ envelope = self.busy()
+ envelope['error'][key] = value
+ cases.append((6, envelope))
+ for key, value in (('reason', 'timeout'), ('reason', 'index_unavailable'),
+ ('action', 'refresh_scope'), ('retry_after_ms', 0),
+ ('retry_after_ms', True), ('retry_after_ms', 6000)):
+ envelope = self.busy()
+ envelope['error']['observation_read'][key] = value
+ cases.append((6, envelope))
+ cases.append((2, self.busy()))
+ for code, envelope in cases:
+ with self.subTest(code=code, envelope=envelope):
+ with patch.object(headless.subprocess, 'run', return_value=self.response(envelope, code)) as execute:
+ with self.assertRaises(AssertionError):
+ self.product.cli('value', 'show', retry_reader_busy=True)
+ self.assertEqual(execute.call_count, 1)
+ self.assertEqual(self.now, 0)
+
+ def test_mutations_and_negative_assertions_cannot_opt_in(self):
+ for arguments, options in (
+ (('prices', 'override', 'apply'), {}),
+ (('sessions', 'delete'), {}),
+ (('value', 'show'), {'expected': 6}),
+ (('value', 'show'), {'pass_fds': (3,)}),
+ ):
+ with self.subTest(arguments=arguments, options=options):
+ with patch.object(headless.subprocess, 'run') as execute:
+ with self.assertRaisesRegex(AssertionError, 'requires an observation read'):
+ self.product.cli(*arguments, **options, retry_reader_busy=True)
+ execute.assert_not_called()
+
+ def test_default_and_expected_error_calls_still_run_once(self):
+ for arguments, expected in ((('value', 'show'), 0), (('prices', 'override', 'apply'), 6)):
+ with self.subTest(arguments=arguments):
+ with patch.object(headless.subprocess, 'run', return_value=self.response(self.busy(), 6)) as execute:
+ if expected == 0:
+ with self.assertRaises(AssertionError):
+ self.product.cli(*arguments)
+ else:
+ self.assertEqual(self.product.cli(*arguments, expected=6), self.busy())
+ self.assertEqual(execute.call_count, 1)
+
+ def test_invalid_json_is_not_retried(self):
+ response = subprocess.CompletedProcess([], 6, b'not-json', b'')
+ with patch.object(headless.subprocess, 'run', return_value=response) as execute:
+ with self.assertRaises(AssertionError):
+ self.product.cli('value', 'show', retry_reader_busy=True)
+ execute.assert_called_once()
class NativeInstallationTests(unittest.TestCase):
diff --git a/scripts/test-plan.py b/scripts/test-plan.py
index 1df5800a..b3cb7937 100644
--- a/scripts/test-plan.py
+++ b/scripts/test-plan.py
@@ -449,12 +449,15 @@ def select(paths, full=False):
else:
full = True
reasons.append("shared tooling, contract, dependency or unknown path: " + path)
- if full:
+ packages = sorted({p for group in groups for p in GROUPS[group]})
+ # The daemon package suite includes installed management, whose package must
+ # contain the actual candidate console even when only backend code changed.
+ if (full or 'hiroute-daemon' in packages
+ or ('hiroute-daemon', 'publication_process') in targets):
frontend = True
commands = []
if full or groups:
commands.append(["cargo", "fmt", "--check"])
- packages = sorted({p for group in groups for p in GROUPS[group]})
flags = ["--workspace", "--exclude", "hiroute-desktop"] if full else [x for p in packages for x in ("-p", p)]
commands.append(["cargo", "clippy", "--locked", *flags, "--all-targets", "--all-features", "--", "-D", "warnings"])
commands.append(["cargo", "test", "--locked", *flags, "--all-features"])
diff --git a/scripts/test-test-plan.py b/scripts/test-test-plan.py
index e512b9fe..4af533f5 100644
--- a/scripts/test-test-plan.py
+++ b/scripts/test-test-plan.py
@@ -20,6 +20,21 @@ runner_spec.loader.exec_module(runner)
class SelectionTests(unittest.TestCase):
+ def test_installed_daemon_consumers_require_the_candidate_console(self):
+ for path in ('crates/daemon/tests/support/quickstart_analysis.py',
+ 'crates/daemon/tests/support/standalone_headless_product.py',
+ 'crates/daemon/src/lib.rs', 'crates/cli/src/lib.rs',
+ 'crates/observation/src/lib.rs', 'crates/integrations/src/lib.rs'):
+ with self.subTest(path=path):
+ result = plan.select([path])
+ self.assertEqual(result['mode'], 'affected')
+ self.assertTrue(result['frontend'])
+ self.assertFalse(result['native_required'])
+ self.assertTrue(any(command[:2] == ['cargo', 'test']
+ and 'hiroute-daemon' in command
+ and '--test' not in command
+ for command in result['commands']))
+
def test_local_gc_selects_shared_cleanup_and_wrapper_without_product_builds(self):
for path in sorted(plan.LOCAL_GC_TOOLING):
with self.subTest(path=path):
@@ -364,7 +379,7 @@ class SelectionTests(unittest.TestCase):
result = plan.select(paths)
self.assertEqual(result["mode"], "affected")
self.assertTrue(result["rust"])
- self.assertFalse(result["frontend"])
+ self.assertEqual(result["frontend"], "crates/daemon/src/lib.rs" in paths)
self.assertFalse(result["native_required"])
self.assertEqual(result["commands"].count(reader), 1)
self.assertIn(["cargo", "clippy", "--locked", "-p", "hiroute-host-runtime",