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

Second part of the fix for issue 17 #21

Merged
merged 13 commits into from
Nov 19, 2018
Merged

Second part of the fix for issue 17 #21

merged 13 commits into from
Nov 19, 2018

Conversation

AnanaMJ
Copy link
Contributor

@AnanaMJ AnanaMJ commented Nov 15, 2018

This PR is to cleanup the code after the previous PR (#18)
It also addresses one of the unresolved comments from that PR: #18 (comment)

Fixes #17

@AnanaMJ AnanaMJ requested a review from a team November 15, 2018 15:08
@coveralls
Copy link

coveralls commented Nov 15, 2018

Pull Request Test Coverage Report for Build 338

  • 31 of 33 (93.94%) changed or added relevant lines in 9 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+1.4%) to 76.313%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/main/java/com/hotels/bdp/circustrain/bigquery/partition/HivePartitionGenerator.java 7 8 87.5%
src/main/java/com/hotels/bdp/circustrain/bigquery/table/service/TableServiceFactory.java 2 3 66.67%
Files with Coverage Reduction New Missed Lines %
src/main/java/com/hotels/bdp/circustrain/bigquery/table/service/TableServiceFactory.java 1 92.59%
Totals Coverage Status
Change from base Build 326: 1.4%
Covered Lines: 654
Relevant Lines: 857

💛 - Coveralls

Copy link
Contributor

@massdosage massdosage left a comment

Choose a reason for hiding this comment

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

Looks mostly good, nice tidy up. Need a CHANGELOG line as some behaviour has changed - if an error occurs deleting an intermediate table during cleanup this will no longer fail the replication but will just log an error. I think that's the only user facing change?

@@ -41,13 +55,21 @@
private @Mock DataCleaner cleaner;
private @Mock Table table;
private @Mock ExtractionContainer container;
private @Mock PostExtractionAction postExtractionAction;
private @Mock DeleteTableAction deleteTableAction;
Copy link

Choose a reason for hiding this comment

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

remove the dependency on concrete classes just mock the interface.

}

@Test
public void runActionsWithTableDeletionError() {
Copy link

Choose a reason for hiding this comment

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

Remove these tests, make one that deals with a mocked interface that throws an exception

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why? If the DeleteTableAction has an internal failure, I need to test that it still runs, but if the other two classes that implement PostExtractionAction have an internal failure, then I need to check that other things won't run either.

I could remove them from here completely, but to keep that behaviour tested, I would move each test to the test class it belongs.

Copy link

Choose a reason for hiding this comment

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

that should be tested in the DeleteTableActionTest not here. The code doesn't know anything about DeleteTableAction neither does the test it should be decoupled.

@AnanaMJ AnanaMJ merged commit eac4595 into master Nov 19, 2018
@AnanaMJ AnanaMJ deleted the issue-17-refactoring branch November 19, 2018 11:16
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.

Wrongly parsed column values by Circus Train
4 participants