-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modify Jenkins Full E2E Integ Test to perform Transformations #1182
base: main
Are you sure you want to change the base?
Modify Jenkins Full E2E Integ Test to perform Transformations #1182
Conversation
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
...shotMigration/src/test/java/org/opensearch/migrations/bulkload/CustomTransformationTest.java
Fixed
Show fixed
Hide fixed
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1182 +/- ##
=========================================
Coverage 80.64% 80.64%
Complexity 3076 3076
=========================================
Files 421 421
Lines 15610 15610
Branches 1053 1053
=========================================
Hits 12588 12588
Misses 2381 2381
Partials 641 641
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
|
||
var sourceClusterOperations = new ClusterOperations(esSourceContainer.getUrl()); | ||
|
||
var shards = 2; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking: why define this shard count again? Maybe you can use a class-level member instead of redefining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be removed now, I've done a good amount of refactoring to remove extra logic for this test class that isn't needed
} | ||
} | ||
|
||
private static String createIndexNameTransformation(String existingIndexName, String newIndexName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a comment explaining what this transform is supposed to accomplish? The method name is a good start, but, frankly, Jolt is inscrutable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
} | ||
|
||
@SneakyThrows | ||
private static int runProcessAgainstTarget( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was basically copied from the ProcessLifecycleTest. Can you please find a way to share/re-use rather than copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done a good amount of refactoring so this should be different, with some shared code move into parent class
|
||
|
||
@NotNull | ||
private static ProcessBuilder setupProcess( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this was basically copied from the ProcessLifecycleTest. Can you please find a way to share/re-use rather than copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
expected_target_docs[transformed_index_name] = {"count": 1} | ||
check_doc_counts_match(cluster=target_cluster, expected_index_details=expected_target_docs, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must be missing something here, as I'd expect this check to fail. It appears the index name in the snapshot is the original, and we're passing in a transformation to the backfill process. As a result, I'd expect that the backfill process would create a new index on the target with default settings and the original index name, and put its doc into that.
Can you fill me in on how this check is passing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The backfill process has a transformation to change the index name to the transformed index name, that is specified in the deployment CDK context
expected_docs[index_name] = {"count": 3} | ||
check_doc_counts_match(cluster=source_cluster, expected_index_details=expected_docs, | ||
expected_source_docs[index_name] = {"count": 3} | ||
# TODO Replayer transformation needed to only have docs in the transformed index |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please make a follow-up Jira for this work and link it here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: Tanner Lewis <[email protected]>
# Conflicts: # DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/LeaseExpirationTest.java # DocumentsFromSnapshotMigration/src/test/java/org/opensearch/migrations/bulkload/SourceTestBase.java
Signed-off-by: Tanner Lewis <[email protected]>
Signed-off-by: Tanner Lewis <[email protected]>
Description
Modifies integ test to add transformation to RFS and Metadata migration to rename an index and modify given RFS documents to go to a new index
After facing a lot of difficulty with crafting a transformation and passing as a command argument, added E2E test for DocumentMigration based off a structure recently introduced by Andre to make top level transformation testing in DocumentMigration much easier to test locally.
Issues Resolved
https://opensearch.atlassian.net/browse/MIGRATIONS-2150
Is this a backport? If so, please add backport PR # and/or commits #
Testing
Jenkins and local 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.