-
Notifications
You must be signed in to change notification settings - Fork 346
Improve the build and test times and add Codecov.io #541
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
Changes from all commits
c5fcf7a
9074173
a26982f
4b25003
45d141d
973cb4f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,8 +250,8 @@ class CMSContraMapSpec extends WordSpec with Matchers with GeneratorDrivenProper | |
val minWidth = data1.distinct.size | ||
|
||
forAll( | ||
(Gen.choose(1, 709), "depth"), | ||
(Gen.choose(minWidth, 10000), "width"), | ||
(Gen.choose(1, 70), "depth"), | ||
(Gen.choose(minWidth, 1000), "width"), | ||
(Gen.choose(Int.MinValue, Int.MaxValue), "seed")) { (depth: Int, width: Int, seed: Int) => | ||
val cms1: TopCMS[Seq[Byte]] = TopPctCMS.monoid[Seq[Byte]](depth, width, seed, 0.01).create(data1) | ||
cms1.heavyHitters should be(Set(oneKey, twoKey, threeKey, fourKey, fiveKey)) | ||
|
@@ -373,6 +373,9 @@ abstract class CMSTest[K: CMSHasher: FromIntLike] extends WordSpec with Matchers | |
val EPS = 0.001 | ||
val SEED = 1 | ||
|
||
private[this] val maxDepth = 70 | ||
private[this] val maxWidth = 1000 | ||
|
||
// We use TopPctCMS for testing CMSCounting functionality. We argue that because TopPctCMS[K] encapsulates CMS[K] | ||
// and uses it for all its counting/querying functionality (like an adapter) we can test CMS[K] indirectly through | ||
// testing TopPctCMS[K]. | ||
|
@@ -579,8 +582,8 @@ abstract class CMSTest[K: CMSHasher: FromIntLike] extends WordSpec with Matchers | |
val minWidth = data1.distinct.size | ||
|
||
forAll( | ||
(Gen.choose(minDepth, 709), "depth"), | ||
(Gen.choose(minWidth, 10000), "width"), | ||
(Gen.choose(minDepth, maxDepth), "depth"), | ||
(Gen.choose(minWidth, maxWidth), "width"), | ||
(Gen.choose(Int.MinValue, Int.MaxValue), "seed")) { (depth: Int, width: Int, seed: Int) => | ||
val cms1 = TopPctCMS.monoid[K](depth, width, seed, 0.01).create(data1) | ||
cms1.heavyHitters should be(Set(1, 2, 3, 4, 5).toK[K]) | ||
|
@@ -600,11 +603,11 @@ abstract class CMSTest[K: CMSHasher: FromIntLike] extends WordSpec with Matchers | |
val data1 = Seq(1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5).toK[K] | ||
|
||
val minDepth = 2 // Use 2 to be on the safe side in case we happen to run into hash collisions | ||
val minWidth = data1.distinct.size | ||
val minWidth = data1.distinct.size * 4 | ||
|
||
forAll( | ||
(Gen.choose(minDepth, 709), "depth"), | ||
(Gen.choose(minWidth, 10000), "width"), | ||
(Gen.choose(minDepth, maxDepth), "depth"), | ||
(Gen.choose(minWidth, maxWidth), "width"), | ||
(Gen.choose(Int.MinValue, Int.MaxValue), "seed")) { (depth: Int, width: Int, seed: Int) => | ||
val cms1 = TopPctCMS.aggregator[K](depth, width, seed, 0.01).apply(data1) | ||
cms1.heavyHitters should be(Set(1, 2, 3, 4, 5).toK[K]) | ||
|
@@ -784,50 +787,30 @@ abstract class CMSTest[K: CMSHasher: FromIntLike] extends WordSpec with Matchers | |
val minWidth = data1.distinct.size | ||
|
||
forAll( | ||
(Gen.choose(minDepth, 709), "depth"), | ||
(Gen.choose(minWidth, 10000), "width"), | ||
(Gen.choose(minDepth, maxDepth), "depth"), | ||
(Gen.choose(minWidth, maxWidth), "width"), | ||
(Gen.choose(Int.MinValue, Int.MaxValue), "seed")) { (depth: Int, width: Int, seed: Int) => | ||
val cms1 = TopNCMS.monoid[K](depth, width, seed, 5).create(data1) | ||
cms1.heavyHitters should be(Set(1, 2, 3, 4, 5).toK[K]) | ||
|
||
val cms2 = TopNCMS.monoid[K](depth, width, seed, 4).create(data1) | ||
cms2.heavyHitters should be(Set(2, 3, 4, 5).toK[K]) | ||
|
||
val cms3 = TopNCMS.monoid[K](depth, width, seed, 3).create(data1) | ||
cms3.heavyHitters should be(Set(3, 4, 5).toK[K]) | ||
|
||
val cms4 = TopNCMS.monoid[K](depth, width, seed, 2).create(data1) | ||
cms4.heavyHitters should be(Set(4, 5).toK[K]) | ||
|
||
val cms5 = TopNCMS.monoid[K](depth, width, seed, 1).create(data1) | ||
cms5.heavyHitters should be(Set(5).toK[K]) | ||
val size = math.abs(seed % 5) + 1 // a number 1 to 5 | ||
val hh = ((6 - size) to 5).toSet | ||
val cms = TopNCMS.monoid[K](depth, width, seed, size).create(data1) | ||
cms.heavyHitters should be(hh.toK[K]) | ||
} | ||
} | ||
|
||
"work as an Aggregator when created from a single, small stream" in { | ||
val data1 = Seq(1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5).toK[K] | ||
|
||
val minDepth = 2 // Use 2 to be on the safe side in case we happen to run into hash collisions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these being removed because of redundancy? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes. They are tested by the replaced line (we only check one for each of
|
||
val minWidth = data1.distinct.size | ||
val minWidth = data1.distinct.size * 2 | ||
|
||
forAll( | ||
(Gen.choose(minDepth, 709), "depth"), | ||
(Gen.choose(minWidth, 10000), "width"), | ||
(Gen.choose(minDepth, maxDepth), "depth"), | ||
(Gen.choose(minWidth, maxWidth), "width"), | ||
(Gen.choose(Int.MinValue, Int.MaxValue), "seed")) { (depth: Int, width: Int, seed: Int) => | ||
val cms1 = TopNCMS.aggregator[K](depth, width, seed, 5).apply(data1) | ||
cms1.heavyHitters should be(Set(1, 2, 3, 4, 5).toK[K]) | ||
|
||
val cms2 = TopNCMS.aggregator[K](depth, width, seed, 4).apply(data1) | ||
cms2.heavyHitters should be(Set(2, 3, 4, 5).toK[K]) | ||
|
||
val cms3 = TopNCMS.aggregator[K](depth, width, seed, 3).apply(data1) | ||
cms3.heavyHitters should be(Set(3, 4, 5).toK[K]) | ||
|
||
val cms4 = TopNCMS.aggregator[K](depth, width, seed, 2).apply(data1) | ||
cms4.heavyHitters should be(Set(4, 5).toK[K]) | ||
|
||
val cms5 = TopNCMS.aggregator[K](depth, width, seed, 2).apply(data1) | ||
cms5.heavyHitters should be(Set(4, 5).toK[K]) | ||
val size = math.abs(seed % 5) + 1 // a number 1 to 5 | ||
val hh = ((6 - size) to 5).toSet | ||
val cms = TopNCMS.aggregator[K](depth, width, seed, size).apply(data1) | ||
cms.heavyHitters should be(hh.toK[K]) | ||
} | ||
} | ||
|
||
|
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.
Use these in the changes to the
Gen
s above?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's a different class and I didn't want to yak shave too much. Just want the minimal change to enable code coverage to work.