Files
gps-denied-onboard/tests/e2e/replay/test_operator_pre_flight_integration.py
Oleksandr Bezdieniezhnykh bfcac2cb9f [AZ-839] [AZ-835] operator_pre_flight_setup real fixture (E-AZ-835 C3)
Replace the placeholder operator_pre_flight_setup pytest fixture (the
mkdir stub at tests/e2e/replay/conftest.py:293-310) with a real driver
that wires C1 (AZ-836 RouteSpec) + C2 (AZ-838 SatelliteProviderRoute
Client) + C11 (AZ-316 HttpTileDownloader) + C10 (AZ-322 Descriptor
Batcher) end-to-end and yields a typed PopulatedC6Cache. AZ-306 FAISS
sidecar triple-consistency is verified post-rebuild via a caller-
supplied descriptor_index_factory; partial sidecars are cleaned up on
failure (AC-7) while pre-existing warm-cache files are preserved.
Algorithm lives in tests/e2e/replay/_operator_pre_flight.py with
pure dependency injection so the AC-8 unit suite (11 tests covering
happy / transient-retry / terminal-failure / validation-error /
tamper-detection / cleanup-on-failure) runs against stubs and the
AC-9 Tier-2 integration test runs the same algorithm against the
real Jetson harness. The conftest fixture skip-gates on RUN_REPLAY
_E2E + SATELLITE_PROVIDER_URL/API_KEY + BUILD_FAISS_INDEX +
GPS_DENIED_OPERATOR_CONFIG_PATH and wires deps through the existing
runtime_root factories. Supersedes AZ-777 Phase 3.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 15:08:34 +03:00

41 lines
1.4 KiB
Python

"""AZ-839 AC-9 — integration test: fixture produces a real :class:`PopulatedC6Cache`.
Gated by ``RUN_REPLAY_E2E=1`` AND ``@pytest.mark.tier2`` per the
AZ-839 task spec. The work the test asserts is the fixture's
contract; the fixture wiring itself lives in
``tests/e2e/replay/conftest.py::operator_pre_flight_setup`` and the
algorithmic correctness is covered by
``test_operator_pre_flight_driver.py`` against stubs (AC-8).
This test exists so AC-9 has a concrete pytest entry point. Other
end-to-end consumers (AZ-840 e2e orchestrator test; AZ-841 un-xfail
of the AZ-777 Tier-2 tests) chain off the same fixture.
"""
from __future__ import annotations
import pytest
from tests.e2e.replay._operator_pre_flight import PopulatedC6Cache
@pytest.mark.tier2
def test_operator_pre_flight_setup_produces_populated_cache(
operator_pre_flight_setup: PopulatedC6Cache,
) -> None:
# Arrange
populated = operator_pre_flight_setup
# Assert
assert isinstance(populated, PopulatedC6Cache)
assert populated.cache_root.is_dir()
assert populated.tile_store_path.is_dir()
assert populated.faiss_index_path.is_file()
assert populated.faiss_sidecar_sha256_path.is_file()
assert populated.faiss_sidecar_meta_path.is_file()
assert populated.tile_count > 0
assert populated.elapsed_seconds >= 0.0
assert populated.route_spec.waypoints, (
"RouteSpec must carry at least one waypoint extracted from the tlog"
)