opensearch-project / opensearch-migrations

Migrate, upgrade, compare, and replicate OpenSearch clusters with ease.
https://aws.amazon.com/solutions/implementations/migration-assistant-for-amazon-opensearch-service/
Apache License 2.0
39 stars 28 forks source link

DataGenerator readability improvements #1103

Closed gregschohn closed 4 weeks ago

gregschohn commented 4 weeks ago

Description

Rewrite the workload classes to use a fluent style w/ mixins so that the structure of what's being cons'ed together is much more immediately clear. Case in point, making the conversion took hours because 1) there weren't unit tests on the generator itself and 2) the one test that was there didn't have suitable logging - requests weren't printed out (which is probably why there what looked to be a bug in the docIds).

This also maintains the previous status-quo of the codebase in how to eschew static imports and shows how to favor mixins and for DSL-like (DSL-lite) applications.

Issues Resolved

Same sonar cleanup as this PR, which was merged before this one was opened for review.

Testing

gradle testing

Check List

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

codecov[bot] commented 4 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 80.67%. Comparing base (d90a448) to head (c5b7b0f). Report is 4 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1103 +/- ## ============================================ + Coverage 80.66% 80.67% +0.01% - Complexity 2892 2906 +14 ============================================ Files 383 384 +1 Lines 14359 14358 -1 Branches 989 989 ============================================ + Hits 11582 11584 +2 + Misses 2183 2181 -2 + Partials 594 593 -1 ``` | [Flag](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1103/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | Coverage Δ | | |---|---|---| | [gradle-test](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1103/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `78.77% <100.00%> (+0.02%)` | :arrow_up: | | [python-test](https://app.codecov.io/gh/opensearch-project/opensearch-migrations/pull/1103/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project) | `90.33% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=opensearch-project#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.