NRLMMD-GEOIPS / NRLMMD-GEOIPS/pluginify

`test_get_yaml_plugin` fails in isolation when registry JSON is missing or stale

Open
#19 0 comments 0 reactions 1 assignee View on GitHub

@coleman-m is already working on this.

Since May 22, 2026.

Dominant language
Python
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Requested Update

Description
  • test_get_yaml_plugin and the newly-introduced ( #17 ) test_get_yaml_plugin_raises_plugin_validation_error_on_bad_yaml fail with KeyError: 'configs' when run in isolation, because PluginRegistryValidator does not reliably populate registered_plugins["yaml_based"] if the on-disk registry JSON is missing or empty at module-import time.
Background and Motivation
  • The validator is instantiated as a class attribute on TestPluginRegistry at import time. Its registry_files list is computed during that instantiation.
  • If the on-disk registered_plugins.json is missing or contains an empty yaml_based section at that moment, later calls to _set_class_properties(force_reset=True, rebuild_registries_override=True) do not always recover -- the in-memory dict ends up with yaml_based: {}.
  • Running tests in their default order works because earlier tests warm up the registry. Running an individual test in isolation (or with pytest's --last-failed ordering) breaks. This was discovered while working on PR #17.
Code to demonstrate issue
  • From a clean state, delete the on-disk registry JSON and run a single test:
rm /home/<user>/.cache/geoips/pluginify.plugin_packages/pluginify/registered_plugins.json
pytest tests/unit_tests/plugin_registries/test_plugin_registries.py::TestPluginRegistry::test_get_yaml_plugin -v

Expected: test passes after auto-rebuild. Actual: KeyError: 'configs'.

Checklist for Completion
  • Decide whether each test in TestPluginRegistry should be self-contained (set up its own registry state) or whether shared setup via a fixture is acceptable.
  • Make test_get_yaml_plugin and similar tests pass when run in isolation.
  • Confirm fix does not require contributors to manually run pluginify create before running the test suite.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.