Skip to content
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

Github-issue#1048 : s3-sink integration test implementation. #2624

Merged

Conversation

deepaksahu562
Copy link
Contributor

@deepaksahu562 deepaksahu562 commented May 2, 2023

Description

  • Implementation of s3-sink integration test.

Issues Resolved

GitHub-issue #1048

Check List

  • New functionality includes testing.
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

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.

Signed-off-by: Deepak Sahu <deepak.sahu562@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented May 2, 2023

Codecov Report

Merging #2624 (24dc6c9) into main (2512d1c) will increase coverage by 0.04%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #2624      +/-   ##
============================================
+ Coverage     93.56%   93.61%   +0.04%     
- Complexity     2253     2255       +2     
============================================
  Files           262      262              
  Lines          6308     6308              
  Branches        521      521              
============================================
+ Hits           5902     5905       +3     
+ Misses          268      266       -2     
+ Partials        138      137       -1     

see 2 files with indirect coverage changes

S3SinkService s3SinkService = createObjectUnderTest();
s3SinkService.output(setEventQueue());
int s3ObjectCountAfterIngest = gets3ObjectCount();
assertThat(s3ObjectCountAfterIngest, greaterThan(s3ObjectCountBeforeIngest));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.

ashoktelukuntla
ashoktelukuntla previously approved these changes May 5, 2023
Copy link
Contributor

@ashoktelukuntla ashoktelukuntla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look good

kkondaka
kkondaka previously approved these changes May 9, 2023
Copy link
Collaborator

@kkondaka kkondaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

s3ObjectCount = objects.size();
} catch (S3Exception e) {
LOG.error(e.awsErrorDetails().errorMessage());
System.exit(1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to fail the whole test suite and will prevent accurate reporting of failures.

Just let the exception be thrown here. Remove the try-catch block entirely. JUnit will handle it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the try-catch block.

s3SinkService.output(setEventQueue());
int s3ObjectCountAfterIngest = gets3ObjectCount();
assertThat(s3ObjectCountAfterIngest, equalTo(s3ObjectCountBeforeIngest + 1));
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test should actually load the S3 object and verify the data is correct.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resolved.
Added two test-cases.

  1. verify_flushed_object_count_into_s3_bucket
  2. verify_flushed_records_into_s3_bucket

@deepaksahu562
Copy link
Contributor Author

@ashoktelukuntla \ @dlvenable
Addressed the change request, would you please review and merge it.

Copy link
Collaborator

@kkondaka kkondaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Copy link
Contributor

@ashoktelukuntla ashoktelukuntla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@dlvenable dlvenable merged commit a7dce8d into opensearch-project:main May 16, 2023
26 checks passed
@dlvenable dlvenable mentioned this pull request Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants