NRLMMD-GEOIPS / NRLMMD-GEOIPS/pluginify
`test_get_yaml_plugin` fails in isolation when registry JSON is missing or stale
Open
@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_pluginand the newly-introduced ( #17 )test_get_yaml_plugin_raises_plugin_validation_error_on_bad_yamlfail withKeyError: 'configs'when run in isolation, becausePluginRegistryValidatordoes not reliably populateregistered_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
TestPluginRegistryat import time. Itsregistry_fileslist is computed during that instantiation. - If the on-disk
registered_plugins.jsonis missing or contains an emptyyaml_basedsection 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 withyaml_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-failedordering) 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
TestPluginRegistryshould be self-contained (set up its own registry state) or whether shared setup via a fixture is acceptable. - Make
test_get_yaml_pluginand similar tests pass when run in isolation. - Confirm fix does not require contributors to manually run
pluginify createbefore running the test suite.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.