syahra712 opened a new pull request, #124:
URL: https://github.com/apache/solr-orbit/pull/124

   ### Description
   `builder.stop()` and the builder actor's `receiveMsg_StartEngine` both call 
`metrics.metrics_store_class(cfg)`, but `metrics.py` no longer has that 
function. Its logic moved into `metrics_store()`, where the class is picked 
inline. As a result, `solr-orbit stop` fails with `module 'solrorbit.metrics' 
has no attribute 'metrics_store_class'`.
   
   This PR adds `metrics_store_class(cfg)` back. It returns 
`FilesystemMetricsStore` when `reporting.datastore.type` is `filesystem` and 
`InMemoryMetricsStore` otherwise. `metrics_store()` now calls it too, so both 
code paths always choose the same store.
   
   ### Issues Resolved
   Fixes #123
   
   ### Testing
   - [x] New functionality includes testing
   
   - 
`tests/builder/mechanic_test.py::BuilderTests::test_stop_persists_system_metrics_of_the_test_run`
 runs `builder.stop(cfg)` with the node file, launcher and stores mocked. It 
checks that the launcher gets an opened metrics store for the test run, that 
the system results are stored, and that the install is cleaned up. On `main` it 
fails with the `AttributeError` from the issue.
   - `tests/metrics_test.py::MetricsStoreClassTests` covers the default and the 
`in-memory`/`filesystem` choices.
   - The full `tests/` suite passes locally on Python 3.13 (1172 passed, 5 
skipped), and `ruff check` passes on the changed files. I haven't run the 
integration suite (`it/`).
   
   ---
   By submitting this pull request, I confirm that my contribution is made 
under the terms of the Apache 2.0 license.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to