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

Various unit tests, minor fixes, and dead code removal #1148

Closed
wants to merge 8 commits into from

Conversation

himanshug
Copy link
Contributor

this patch contains

  • Unit Tests for various java classes in druid
  • couple of very minor fixes
  • removal ot some code that does not get used anywhere

@xvrl
Copy link
Member

xvrl commented Feb 23, 2015

Can we make the description of this pull-request more specific and give a general indication of the types of tests we are adding?

@@ -44,30 +40,19 @@
{
private static final ObjectMapper jsonMapper = new DefaultObjectMapper();

public static <K, V> Map<K, V> zipMap(Iterable<K> keys, Iterable<V> values)
Copy link
Member

Choose a reason for hiding this comment

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

any reason we are removing this? This doesn't seem to be part of tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, updated the description.

and, this code does not seem to get used anywhere. I can put it back if there is a reason to keep it around.
what do you think?

Copy link
Member

Choose a reason for hiding this comment

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

I'm fine removing the code if it is not used anywhere.

@fjy
Copy link
Contributor

fjy commented Feb 25, 2015

I didn't closely look at every test, but I believe the following is true:

  1. No existing tests were changed and the removals are only for dead code
  2. The tests run in a reasonable time
  3. The tests are increasing code coverage for Druid, which is very important
  4. The code follows the style guide

I am in favor of this PR if the above is true.

@@ -112,7 +112,7 @@ public IntBuffer getBaseList(int index)
final IntBuffer retVal = IntBuffer.wrap(array);

if (index + 1 == baseListCount()) {
retVal.limit(maxIndex - (index * allocateSize));
retVal.limit(maxIndex - (index * allocateSize) + 1);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why +1?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a fix to a problem found with a unit test. Check out the branch, remove the +1 and run the tests...

@drcrallen
Copy link
Contributor

There seem to be a few non unit test changes in this PR, can those be separated more clearly somehow?

{
testingIterator.remove();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

can we add newlines at the end of files?

@drcrallen
Copy link
Contributor

I'm in agreement with @fjy , but I would really like to see the non-unit tests items in at least a separate commit so its more obvious they are changing.

@cheddar
Copy link
Contributor

cheddar commented Feb 25, 2015

The non-unit test changes are all fixing bugs that exist in the current code found by the unit tests. If we remove them, the tests won't pass and then travis will be upset and then what do we do?

@himanshug
Copy link
Contributor Author

@fjy all of what you said is true.

@drcrallen
Copy link
Contributor

@cheddar : Put them in the same PR as per #1044

@xvrl xvrl changed the title bunch of unit tests for druid code Various unit tests + minor fixes and dead code removal Feb 25, 2015
@xvrl xvrl changed the title Various unit tests + minor fixes and dead code removal Various unit tests, minor fixes, and dead code removal Feb 25, 2015
@xvrl
Copy link
Member

xvrl commented Feb 25, 2015

I'm on board with all those fixes + changes, I updated the PR title to include the fact that we fixed things.
Once you update the license header and squash into either a single commit, or one commit per sub-module I can merge.

@xvrl
Copy link
Member

xvrl commented Feb 25, 2015

I'm happy do the squashing and header update for you if that makes it easier.

xvrl added a commit that referenced this pull request Feb 25, 2015
Also updated license header as part of the squash.
@xvrl
Copy link
Member

xvrl commented Feb 25, 2015

Merged as part of af807c6

@xvrl xvrl closed this Feb 25, 2015
@himanshug himanshug deleted the unit-tests branch March 2, 2015 21:43
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.

5 participants