-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Migrate TestDerbyConnector to a JUnit @Rule #1672
Conversation
First run is green. Firing off again to see if it holds. |
Fire 2 is green, going for a trifecta |
3 for 3 greens. Looking good |
|
||
public DerbyConnectorRule() | ||
{ | ||
this(Suppliers.ofInstance(MetadataStorageTablesConfig.fromBase("druidTest" + dbSafeUUID()))); |
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.
is it necessary to create unique table IDs, if we already create a unique database per test?
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.
Necessary? no. I put it in as a safeguard in case someone re-uses either this code or this class for other stuff later.
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 think it's good to be able to test table creation both with default names and with a specified prefix, so let's remove it if it's not necessary. Each test method already gets it's unique database, so that should be enough. It will make the test code simpler and less confusing.
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.
Removed
65c6605
to
959465f
Compare
@@ -201,6 +118,20 @@ public void tearDown() | |||
@Before | |||
public void setUp() throws Exception | |||
{ | |||
final MetadataStorageUpdaterJobSpec metadataStorageUpdaterJobSpc = new MetadataStorageUpdaterJobSpec() |
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.
typo in Spec
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.
Fixed
Woohoo! |
👍 when travis completes |
|
||
public class TestDerbyConnector extends DerbyConnector | ||
{ | ||
public static class DerbyConnectorRule extends ExternalResource |
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.
Minor Nit: Usually internal classes are defined in the end rather than the first thing.
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 was unfamiliar with that convention. Fixed
aside from minor nit comment (can be ignored if you want) LGTM |
👍 after travis |
travis bounce |
@gianm What test failed? nvmnd, found it https://travis-ci.org/druid-io/druid/jobs/77442454
|
@drcrallen, it was this job: https://travis-ci.org/druid-io/druid/jobs/77442454 Tests in error: |
Migrate TestDerbyConnector to a JUnit @rule
Hopefully this reduces the irregular test failures.