Skip to content

Commit

Permalink
Remove extraneous/incorrect ValidatesRunner classification from examp…
Browse files Browse the repository at this point in the history
…les unit tests
  • Loading branch information
kennknowles committed Oct 23, 2024
1 parent 8d22fc2 commit 5ad0057
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,13 @@
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -66,7 +64,6 @@ public void testExtractWordsFn() throws Exception {

/** Example test that tests a PTransform by using an in-memory input and inspecting the output. */
@Test
@Category(ValidatesRunner.class)
public void testCountWords() throws Exception {
PCollection<String> input = p.apply(Create.of(WORDS).withCoder(StringUtf8Coder.of()));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
import java.util.Arrays;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand All @@ -37,7 +35,6 @@ public class TopWikipediaSessionsTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testComputeTopUsers() {

PCollection<String> output =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -69,7 +67,6 @@ public class GameStatsTest implements Serializable {

/** Test the calculation of 'spammy users'. */
@Test
@Category(ValidatesRunner.class)
public void testCalculateSpammyUsers() throws Exception {
PCollection<KV<String, Integer>> input = p.apply(Create.of(USER_SCORES));
PCollection<KV<String, Integer>> output = input.apply(new CalculateSpammyUsers());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.beam.sdk.options.PipelineOptionsFactory;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.Filter;
import org.apache.beam.sdk.transforms.MapElements;
Expand All @@ -37,7 +36,6 @@
import org.joda.time.Instant;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -90,7 +88,6 @@ public class HourlyTeamScoreTest implements Serializable {

/** Test the filtering. */
@Test
@Category(ValidatesRunner.class)
public void testUserScoresFilter() throws Exception {

final Instant startMinTimestamp = new Instant(1447965680000L);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.MapElements;
import org.apache.beam.sdk.transforms.ParDo;
Expand All @@ -36,7 +35,6 @@
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.Lists;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -114,7 +112,6 @@ public void testParseEventFn() throws Exception {

/** Tests ExtractAndSumScore("user"). */
@Test
@Category(ValidatesRunner.class)
public void testUserScoreSums() throws Exception {

PCollection<String> input = p.apply(Create.of(GAME_EVENTS));
Expand All @@ -133,7 +130,6 @@ public void testUserScoreSums() throws Exception {

/** Tests ExtractAndSumScore("team"). */
@Test
@Category(ValidatesRunner.class)
public void testTeamScoreSums() throws Exception {

PCollection<String> input = p.apply(Create.of(GAME_EVENTS));
Expand All @@ -152,7 +148,6 @@ public void testTeamScoreSums() throws Exception {

/** Test that bad input data is dropped appropriately. */
@Test
@Category(ValidatesRunner.class)
public void testUserScoresBadInput() throws Exception {

PCollection<String> input = p.apply(Create.of(GAME_EVENTS2).withCoder(StringUtf8Coder.of()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.beam.examples.cookbook.BigQueryTornadoes.FormatCountsFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.KV;
Expand All @@ -31,7 +30,6 @@
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand All @@ -41,7 +39,6 @@ public class BigQueryTornadoesTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testExtractTornadoes() {
TableRow row = new TableRow().set("month", "6").set("tornado", true);
PCollection<TableRow> input = p.apply(Create.of(ImmutableList.of(row)));
Expand All @@ -51,7 +48,6 @@ public void testExtractTornadoes() {
}

@Test
@Category(ValidatesRunner.class)
public void testNoTornadoes() {
TableRow row = new TableRow().set("month", 6).set("tornado", false);
PCollection<TableRow> inputs = p.apply(Create.of(ImmutableList.of(row)));
Expand All @@ -61,7 +57,6 @@ public void testNoTornadoes() {
}

@Test
@Category(ValidatesRunner.class)
public void testEmpty() {
PCollection<KV<Integer, Long>> inputs =
p.apply(Create.empty(new TypeDescriptor<KV<Integer, Long>>() {}));
Expand All @@ -71,7 +66,6 @@ public void testEmpty() {
}

@Test
@Category(ValidatesRunner.class)
public void testFormatCounts() {
PCollection<KV<Integer, Long>> inputs =
p.apply(Create.of(KV.of(3, 0L), KV.of(4, Long.MAX_VALUE), KV.of(5, Long.MIN_VALUE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.Distinct;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand All @@ -39,7 +37,6 @@ public class DistinctExampleTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testDistinct() {
List<String> strings = Arrays.asList("k1", "k5", "k5", "k2", "k1", "k2", "k3");

Expand All @@ -52,7 +49,6 @@ public void testDistinct() {
}

@Test
@Category(ValidatesRunner.class)
public void testDistinctEmpty() {
List<String> strings = Arrays.asList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
import org.apache.beam.examples.cookbook.FilterExamples.ProjectionFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -68,7 +66,6 @@ public class FilterExamplesTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testProjectionFn() {
PCollection<TableRow> input = p.apply(Create.of(row1, row2, row3));

Expand All @@ -79,7 +76,6 @@ public void testProjectionFn() {
}

@Test
@Category(ValidatesRunner.class)
public void testFilterSingleMonthDataFn() {
PCollection<TableRow> input = p.apply(Create.of(outRow1, outRow2, outRow3));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@
import org.apache.beam.examples.cookbook.JoinExamples.ExtractEventDataFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -107,7 +105,6 @@ public void testExtractCountryInfoFn() throws Exception {
}

@Test
@Category(ValidatesRunner.class)
public void testJoin() throws java.lang.Exception {
PCollection<TableRow> input1 = p.apply("CreateEvent", Create.of(EVENT_ARRAY));
PCollection<TableRow> input2 = p.apply("CreateCC", Create.of(CC_ARRAY));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,13 @@
import org.apache.beam.examples.cookbook.MaxPerKeyExamples.FormatMaxesFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.KV;
import org.apache.beam.sdk.values.PCollection;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -78,7 +76,6 @@ public class MaxPerKeyExamplesTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testExtractTempFn() {
PCollection<KV<Integer, Double>> results =
p.apply(Create.of(TEST_ROWS)).apply(ParDo.of(new ExtractTempFn()));
Expand All @@ -87,7 +84,6 @@ public void testExtractTempFn() {
}

@Test
@Category(ValidatesRunner.class)
public void testFormatMaxesFn() {
PCollection<TableRow> results =
p.apply(Create.of(TEST_KVS)).apply(ParDo.of(new FormatMaxesFn()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.beam.examples.cookbook.MinimalBigQueryTornadoes.FormatCountsFn;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.ParDo;
import org.apache.beam.sdk.values.KV;
Expand All @@ -31,7 +30,6 @@
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.collect.ImmutableList;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand All @@ -41,7 +39,6 @@ public class MinimalBigQueryTornadoesTest {
@Rule public TestPipeline p = TestPipeline.create();

@Test
@Category(ValidatesRunner.class)
public void testExtractTornadoes() {
TableRow row = new TableRow().set("month", "6").set("tornado", true);
PCollection<TableRow> input = p.apply(Create.of(ImmutableList.of(row)));
Expand All @@ -51,7 +48,6 @@ public void testExtractTornadoes() {
}

@Test
@Category(ValidatesRunner.class)
public void testNoTornadoes() {
TableRow row = new TableRow().set("month", 6).set("tornado", false);
PCollection<TableRow> inputs = p.apply(Create.of(ImmutableList.of(row)));
Expand All @@ -61,7 +57,6 @@ public void testNoTornadoes() {
}

@Test
@Category(ValidatesRunner.class)
public void testEmpty() {
PCollection<KV<Integer, Long>> inputs =
p.apply(Create.empty(new TypeDescriptor<KV<Integer, Long>>() {}));
Expand All @@ -71,7 +66,6 @@ public void testEmpty() {
}

@Test
@Category(ValidatesRunner.class)
public void testFormatCounts() {
PCollection<KV<Integer, Long>> inputs =
p.apply(Create.of(KV.of(3, 0L), KV.of(4, Long.MAX_VALUE), KV.of(5, Long.MIN_VALUE)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.beam.sdk.coders.StringUtf8Coder;
import org.apache.beam.sdk.testing.PAssert;
import org.apache.beam.sdk.testing.TestPipeline;
import org.apache.beam.sdk.testing.ValidatesRunner;
import org.apache.beam.sdk.transforms.Create;
import org.apache.beam.sdk.transforms.DoFn;
import org.apache.beam.sdk.transforms.ParDo;
Expand All @@ -42,7 +41,6 @@
import org.joda.time.Instant;
import org.junit.Rule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

Expand Down Expand Up @@ -118,7 +116,6 @@ public void testExtractTotalFlow() {
}

@Test
@Category(ValidatesRunner.class)
public void testTotalFlow() {
PCollection<KV<String, Integer>> flow =
pipeline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class DistinctExampleTest {
fun pipeline(): TestPipeline = pipeline

@Test
@Category(ValidatesRunner::class)
fun testDistinct() {
val strings = listOf("k1", "k5", "k5", "k2", "k1", "k2", "k3")
val input = pipeline.apply(Create.of(strings).withCoder(StringUtf8Coder.of()))
Expand All @@ -49,7 +48,6 @@ class DistinctExampleTest {
}

@Test
@Category(ValidatesRunner::class)
fun testDistinctEmpty() {
val strings = listOf<String>()
val input = pipeline.apply(Create.of(strings).withCoder(StringUtf8Coder.of()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class FilterExamplesTest {
fun pipeline(): TestPipeline = pipeline

@Test
@Category(ValidatesRunner::class)
fun testProjectionFn() {
val input = pipeline.apply(Create.of(row1, row2, row3))
val results = input.apply(ParDo.of(ProjectionFn()))
Expand All @@ -73,7 +72,6 @@ class FilterExamplesTest {
}

@Test
@Category(ValidatesRunner::class)
fun testFilterSingleMonthDataFn() {
val input = pipeline.apply(Create.of(outRow1, outRow2, outRow3))
val results = input.apply(ParDo.of(FilterSingleMonthDataFn(7)))
Expand Down
Loading

0 comments on commit 5ad0057

Please sign in to comment.