test_contributed_discovery ========================== .. py:module:: test_contributed_discovery .. autoapi-nested-parse:: A contributing package's tiles compose without anyone naming them. Two things had to be true for contribution to work and neither was: * the tiles must ARRIVE. ``base.yaml`` selects one option from the group ``dau-core``, so a package shipping ``dau-core/.yaml`` adds an option that is never composed — no error, no warning. Hydra refuses the additive form for a single-select group, and ``override`` would replace our palette with theirs. * the tiles must be FOUND once composed, which is :mod:`dau_core.registry`'s half (see ``test_contributed_cores.py``). This covers the first. Contributions live in their own group, and its options are selected together AS A LIST — the form that admits more than one. A bare ``+group=option`` selects exactly one, so two installed vendors would silently mean one vendor, which is the same class of failure as vanishing entirely. Attributes ---------- .. autoapisummary:: test_contributed_discovery._TILE Functions --------- .. autoapisummary:: test_contributed_discovery.contrib_dir test_contributed_discovery.test_options_are_discovered_not_named test_contributed_discovery.test_no_contributions_installed_is_silent test_contributed_discovery.test_every_contributor_composes_not_just_the_first test_contributed_discovery.test_our_own_palette_survives_contribution test_contributed_discovery.test_an_explicit_selection_is_not_overridden test_contributed_discovery.test_contributed_tiles_reach_the_registry test_contributed_discovery.test_discovery_inside_an_existing_initialization_leaves_it_standing test_contributed_discovery.test_discovery_never_registers_anything test_contributed_discovery.test_an_unreadable_searchpath_does_not_take_down_composition Module Contents --------------- .. py:data:: _TILE :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """{name}: _target_: dau_core.cores.CoreDefinition name: {name} kind: operator module: {module} source: {module}.sv source_package: {package}.hdl description: a contributed tile contract_kind: row-stream record_words: 1 ingest: _target_: dau_core.cores.IngestRate rows: 1 per_cycles: 1 """ .. raw:: html
.. py:function:: contrib_dir(tmp_path) A searchpath directory holding contributed tile options. .. py:function:: test_options_are_discovered_not_named(contrib_dir) -> None .. py:function:: test_no_contributions_installed_is_silent(tmp_path) -> None The common case must cost nothing and say nothing. .. py:function:: test_every_contributor_composes_not_just_the_first(contrib_dir) -> None The list form is the whole point: selecting one option per group would make a second installed vendor silently disappear. .. py:function:: test_our_own_palette_survives_contribution(contrib_dir) -> None .. py:function:: test_an_explicit_selection_is_not_overridden(contrib_dir) -> None A caller who named the contributions it wants means it. .. py:function:: test_contributed_tiles_reach_the_registry(contrib_dir) -> None The two halves together: composed AND findable, with the seam intact. .. py:function:: test_discovery_inside_an_existing_initialization_leaves_it_standing(contrib_dir) -> None The regression that broke two downstream suites. Hydra's global state is process-wide. A first version of discovery initialized its own instance and cleared it in a `finally`, which tore down whatever the CALLER was inside -- dau-sim and dau-polars then asserted `is_initialized()` against nothing. Discovery must reuse an initialization it did not create, and must leave it exactly as found. .. py:function:: test_discovery_never_registers_anything(contrib_dir) -> None Initializing hydra runs the searchpath plugin, which LOADS provider configs into the root registry. Asking what is installed must not change what is installed, or the composition that follows fails adding `dau-core` a second time. .. py:function:: test_an_unreadable_searchpath_does_not_take_down_composition(tmp_path) -> None Discovery is best-effort. A directory hydra cannot read must cost the contributions, not the compose that would otherwise have worked.