Skip to content

Commit

Permalink
[hotfix] [gelly] Reduce time to run integration tests
Browse files Browse the repository at this point in the history
Removes the "large" tests and increases the size of the "small" tests
from scale=7 to scale=8.
  • Loading branch information
greghogan committed Jul 26, 2017
1 parent 4a88f65 commit 94559ba
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
* Tests for {@link AdamicAdar}.
*/
@RunWith(Parameterized.class)
public class AdamicAdarITCase
extends CopyableValueDriverBaseITCase {
public class AdamicAdarITCase extends CopyableValueDriverBaseITCase {

public AdamicAdarITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand Down Expand Up @@ -61,8 +60,6 @@ public void testPrintWithRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

expectedCount(
parameters(7, "print"),
11388);
expectedCount(parameters(8, "print"), 39276);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.apache.flink.client.program.ProgramParametrizationException;
import org.apache.flink.graph.asm.dataset.ChecksumHashCode.Checksum;

import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -30,8 +29,7 @@
* Tests for {@link ClusteringCoefficient}.
*/
@RunWith(Parameterized.class)
public class ClusteringCoefficientITCase
extends CopyableValueDriverBaseITCase {
public class ClusteringCoefficientITCase extends CopyableValueDriverBaseITCase {

public ClusteringCoefficientITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -55,58 +53,24 @@ public void testLongDescription() throws Exception {
}

@Test
public void testHashWithSmallDirectedRMatGraph() throws Exception {
public void testHashWithDirectedRMatGraph() throws Exception {
String expected = "\n" +
new Checksum(117, 0x0000003621c62ca1L) + "\n\n" +
"triplet count: 29286, triangle count: 11466, global clustering coefficient: 0.39151813[0-9]+\n" +
"vertex count: 117, average clustering coefficient: 0.45125697[0-9]+\n";
new Checksum(233, 0x00000075d99a55b6L) + "\n\n" +
"triplet count: 97315, triangle count: 30705, global clustering coefficient: 0.31552175[0-9]+\n" +
"vertex count: 233, average clustering coefficient: 0.41178524[0-9]+\n";

expectedOutput(parameters(7, "directed", "directed", "hash"), expected);
expectedOutput(parameters(8, "directed", "directed", "hash"), expected);
}

@Test
public void testHashWithSmallUndirectedRMatGraph() throws Exception {
public void testHashWithUndirectedRMatGraph() throws Exception {
String expected = "\n\n" +
"triplet count: 29286, triangle count: 11466, global clustering coefficient: 0.39151813[0-9]+\n" +
"vertex count: 117, average clustering coefficient: 0.57438679[0-9]+\n";
"triplet count: 97315, triangle count: 30705, global clustering coefficient: 0.31552175[0-9]+\n" +
"vertex count: 233, average clustering coefficient: 0.50945459[0-9]+\n";

expectedOutput(parameters(7, "directed", "undirected", "hash"),
"\n" + new Checksum(117, 0x0000003875b38c43L) + expected);
expectedOutput(parameters(7, "undirected", "undirected", "hash"),
"\n" + new Checksum(117, 0x0000003c20344c75L) + expected);
}

@Test
public void testHashWithLargeDirectedRMatGraph() throws Exception {
// computation is too large for collection mode
Assume.assumeFalse(mode == TestExecutionMode.COLLECTION);

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

String expected = "\n" +
new Checksum(3349, 0x0000067a9d18e7f3L) + "\n\n" +
"triplet count: 9276207, triangle count: 1439454, global clustering coefficient: 0.15517700[0-9]+\n" +
"vertex count: 3349, average clustering coefficient: 0.24571815[0-9]+\n";

expectedOutput(parameters(12, "directed", "directed", "hash"), expected);
}

@Test
public void testHashWithLargeUndirectedRMatGraph() throws Exception {
// computation is too large for collection mode
Assume.assumeFalse(mode == TestExecutionMode.COLLECTION);

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

String expected = "\n\n" +
"triplet count: 9276207, triangle count: 1439454, global clustering coefficient: 0.15517700[0-9]+\n" +
"vertex count: 3349, average clustering coefficient: 0.33029442[0-9]+\n";

expectedOutput(parameters(12, "directed", "undirected", "hash"),
"\n" + new Checksum(3349, 0x00000681fad1587eL) + expected);
expectedOutput(parameters(12, "undirected", "undirected", "hash"),
"\n" + new Checksum(3349, 0x0000068713b3b7f1L) + expected);
expectedOutput(parameters(8, "directed", "undirected", "hash"),
"\n" + new Checksum(233, 0x00000076635e00e2L) + expected);
expectedOutput(parameters(8, "undirected", "undirected", "hash"),
"\n" + new Checksum(233, 0x000000743ef6d14bL) + expected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
* Tests for {@link ConnectedComponents}.
*/
@RunWith(Parameterized.class)
public class ConnectedComponentsITCase
extends NonTransformableDriverBaseITCase {
public class ConnectedComponentsITCase extends NonTransformableDriverBaseITCase {

public ConnectedComponentsITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -56,23 +55,12 @@ public void testLongDescription() throws Exception {
}

@Test
public void testHashWithSmallRMatGraph() throws Exception {
public void testHashWithRMatGraph() throws Exception {
expectedChecksum(parameters(7, "hash"), 106, 0x0000000000033e88L);
}

@Test
public void testHashWithLargeRMatGraph() throws Exception {
// computation is too large for collection mode
Assume.assumeFalse(mode == TestExecutionMode.COLLECTION);

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

expectedChecksum(parameters(15, "hash"), 25572, 0x00000003094ffba2L);
}

@Test
public void testPrintWithSmallRMatGraph() throws Exception {
public void testPrintWithRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
* Tests for {@link EdgeList}.
*/
@RunWith(Parameterized.class)
public class EdgeListITCase
extends NonTransformableDriverBaseITCase {
public class EdgeListITCase extends NonTransformableDriverBaseITCase {

public EdgeListITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

import org.apache.flink.client.program.ProgramParametrizationException;

import org.junit.Assume;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
Expand All @@ -29,8 +28,7 @@
* Tests for {@link GraphMetrics}.
*/
@RunWith(Parameterized.class)
public class GraphMetricsITCase
extends DriverBaseITCase {
public class GraphMetricsITCase extends DriverBaseITCase {

public GraphMetricsITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -54,7 +52,7 @@ public void testLongDescription() throws Exception {
}

@Test
public void testWithSmallDirectedRMatIntegerGraph() throws Exception {
public void testWithDirectedRMatGraph() throws Exception {
String expected = "\n" +
"Vertex metrics:\n" +
" vertex count: 117\n" +
Expand All @@ -80,39 +78,7 @@ public void testWithSmallDirectedRMatIntegerGraph() throws Exception {
}

@Test
public void testWithLargeDirectedRMatIntegerGraph() throws Exception {
// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

// skip 'string' which does not compare numerically and generates a different triangle count
Assume.assumeFalse(idType.equals("string") || idType.equals("nativeString"));

String expected = "\n" +
"Vertex metrics:\n" +
" vertex count: 3,349\n" +
" edge count: 53,368\n" +
" unidirectional edge count: 43,602\n" +
" bidirectional edge count: 4,883\n" +
" average degree: 15.936\n" +
" density: 0.00475971\n" +
" triplet count: 9,276,207\n" +
" maximum degree: 1,356\n" +
" maximum out degree: 921\n" +
" maximum in degree: 966\n" +
" maximum triplets: 918,690\n" +
"\n" +
"Edge metrics:\n" +
" triangle triplet count: 779,202\n" +
" rectangle triplet count: 2,506,371\n" +
" maximum triangle triplets: 3,160\n" +
" maximum rectangle triplets: 16,835\n";

expectedOutput(parameters(12, "directed", "hash"), expected);
expectedOutput(parameters(12, "directed", "print"), expected);
}

@Test
public void testWithSmallUndirectedRMatIntegerGraph() throws Exception {
public void testWithUndirectedRMatGraph() throws Exception {
String expected = "\n" +
"Vertex metrics:\n" +
" vertex count: 117\n" +
Expand All @@ -132,32 +98,4 @@ public void testWithSmallUndirectedRMatIntegerGraph() throws Exception {
expectedOutput(parameters(7, "undirected", "hash"), expected);
expectedOutput(parameters(7, "undirected", "print"), expected);
}

@Test
public void testWithLargelUndirectedRMatIntegerGraph() throws Exception {
// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

// skip 'string' which does not compare numerically and generates a different triangle count
Assume.assumeFalse(idType.equals("string") || idType.equals("nativeString"));

String expected = "\n" +
"Vertex metrics:\n" +
" vertex count: 3,349\n" +
" edge count: 48,485\n" +
" average degree: 28.955\n" +
" density: 0.00864842\n" +
" triplet count: 9,276,207\n" +
" maximum degree: 1,356\n" +
" maximum triplets: 918,690\n" +
"\n" +
"Edge metrics:\n" +
" triangle triplet count: 779,202\n" +
" rectangle triplet count: 2,506,371\n" +
" maximum triangle triplets: 3,160\n" +
" maximum rectangle triplets: 16,835\n";

expectedOutput(parameters(12, "undirected", "hash"), expected);
expectedOutput(parameters(12, "undirected", "print"), expected);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* Tests for {@link HITS}.
*/
@RunWith(Parameterized.class)
public class HITSITCase
extends DriverBaseITCase {
public class HITSITCase extends DriverBaseITCase {

public HITSITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -54,21 +53,10 @@ public void testLongDescription() throws Exception {
}

@Test
public void testPrintWithSmallRMatGraph() throws Exception {
public void testPrintWithRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

expectedCount(parameters(8, "print"), 233);
}

@Test
public void testPrintWithLargeRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

expectedCount(parameters(12, "print"), 3349);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
* Tests for {@link JaccardIndex}.
*/
@RunWith(Parameterized.class)
public class JaccardIndexITCase
extends CopyableValueDriverBaseITCase {
public class JaccardIndexITCase extends CopyableValueDriverBaseITCase {

public JaccardIndexITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -58,26 +57,15 @@ public void testLongDescription() throws Exception {
}

@Test
public void testHashWithSmallRMatGraph() throws Exception {
expectedChecksum(parameters(7, "hash"), 11388, 0x0000164757052eebL);
public void testHashWithRMatGraph() throws Exception {
expectedChecksum(parameters(8, "hash"), 39276, 0x00004caba2e663d5L);
}

@Test
public void testHashWithLargeRMatGraph() throws Exception {
// computation is too large for collection mode
Assume.assumeFalse(mode == TestExecutionMode.COLLECTION);

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

expectedChecksum(parameters(12, "hash"), 4432058, 0x0021ce158d811c4eL);
}

@Test
public void testPrintWithSmallRMatGraph() throws Exception {
public void testPrintWithRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

expectedOutputChecksum(parameters(7, "print"), new Checksum(11388, 0x0000163b17088256L));
expectedOutputChecksum(parameters(8, "print"), new Checksum(39276, 0x00004c5a726220c0L));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
* Tests for {@link PageRank}.
*/
@RunWith(Parameterized.class)
public class PageRankITCase
extends DriverBaseITCase {
public class PageRankITCase extends DriverBaseITCase {

public PageRankITCase(String idType, TestExecutionMode mode) {
super(idType, mode);
Expand All @@ -54,21 +53,10 @@ public void testLongDescription() throws Exception {
}

@Test
public void testPrintWithSmallRMatGraph() throws Exception {
public void testPrintWithRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

expectedCount(parameters(8, "print"), 233);
}

@Test
public void testPrintWithLargeRMatGraph() throws Exception {
// skip 'char' since it is not printed as a number
Assume.assumeFalse(idType.equals("char") || idType.equals("nativeChar"));

// skip 'byte' which cannot store vertex IDs for scale > 8
Assume.assumeFalse(idType.equals("byte") || idType.equals("nativeByte"));

expectedCount(parameters(12, "print"), 3349);
}
}
Loading

0 comments on commit 94559ba

Please sign in to comment.