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

[BEAM-13471] [Playground] Tag existing unit-tests #16325

Merged
merged 7 commits into from
Jan 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
*/
package org.apache.beam.examples.complete;

// beam-playground:
// name: TfIdfTest
// description: Unit-test for the TfIdf example.
// multifile: false
// pipeline_options:
// categories:
// - Side Input
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - Side Input
// - Side Input
// - Flatten

// - Flatten

import java.net.URI;
import java.util.Arrays;
import org.apache.beam.sdk.coders.StringDelegateCoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
*/
package org.apache.beam.examples.complete.game;

// beam-playground:
// name: GameStatsTest
// description: Unit-test for the GameStats example.
// multifile: false
// pipeline_options:
// categories:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// categories:
// categories:
// - Testing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// - Testing
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - Testing
// - Testing
// - Filtering

// - Filtering

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
*/
package org.apache.beam.examples.cookbook;

// beam-playground:
// name: DistinctExampleTest
// description: Unit-test for the DistinctExample example.
// multifile: false
// pipeline_options:
// categories:
// - Core Transforms
// - Filtering

import java.util.Arrays;
import java.util.List;
import org.apache.beam.sdk.coders.StringUtf8Coder;
Expand Down
8 changes: 8 additions & 0 deletions sdks/go/pkg/beam/combine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

package beam_test

// beam-playground:
// name: CombineTest
// description: Unit-test for the Combine example.
// multifile: false
// pipeline_options:
// categories:
// - Combiners

import (
"reflect"
"testing"
Expand Down
8 changes: 8 additions & 0 deletions sdks/go/pkg/beam/partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

package beam_test

// beam-playground:
// name: PartitionTest
// description: Unit-test for the Partition example.
// multifile: false
// pipeline_options:
// categories:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// categories:
// categories:
// - Testing

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

// - Core Transforms

import (
"testing"

Expand Down
9 changes: 9 additions & 0 deletions sdks/go/pkg/beam/transforms/filter/distinct_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@

package filter_test

// beam-playground:
// name: DistinctTest
// description: Unit-test for the Distinct example.
// multifile: false
// pipeline_options:
// categories:
// - Filtering
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// - Filtering
// - Filtering
// - Core Transforms

// - Core Transforms

import (
"testing"

Expand Down
8 changes: 8 additions & 0 deletions sdks/go/pkg/beam/transforms/filter/filter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@

package filter_test

// beam-playground:
// name: FilterTest
// description: Unit-test for the Filter example.
// multifile: false
// pipeline_options:
// categories:
// - Filtering

import (
"testing"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@
*/
package org.apache.beam.sdk.testing;

// beam-playground:
// name: TestStreamTest
// description: Unit-test for the TestStream example.
// multifile: false
// pipeline_options:
// categories:
// - Streaming

import static org.apache.beam.sdk.transforms.windowing.Window.into;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
*/
package org.apache.beam.sdk.transforms;

// beam-playground:
// name: CombineFnsTest
// description: Unit-test for the CombineFn example.
// multifile: false
// pipeline_options:
// categories:
// - Combiners
// - Core Transforms

import static org.apache.beam.sdk.transforms.display.DisplayDataMatchers.hasDisplayItem;
import static org.apache.beam.sdk.transforms.display.DisplayDataMatchers.includesDisplayDataFor;
import static org.hamcrest.MatcherAssert.assertThat;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@
*/
package org.apache.beam.sdk.transforms;

// beam-playground:
// name: FilterTest
// description: Unit-test for the Filter example.
// multifile: false
// pipeline_options:
// categories:
// - Filtering
// - Core Transforms

import static org.apache.beam.sdk.transforms.display.DisplayDataMatchers.hasDisplayItem;
import static org.hamcrest.MatcherAssert.assertThat;

Expand Down
8 changes: 8 additions & 0 deletions sdks/python/apache_beam/examples/cookbook/combiners_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@

# pytype: skip-file

# beam-playground:
# name: CombinersTest
# description: Unit-test to showcase combiners.
# multifile: false
# pipeline_options:
# categories:
# - Combiners

import logging
import unittest

Expand Down
8 changes: 8 additions & 0 deletions sdks/python/apache_beam/examples/cookbook/filters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@

# pytype: skip-file

# beam-playground:
# name: FiltersTest
# description: Unit-test for the Filters example.
# multifile: false
# pipeline_options:
# categories:
# - Filtering

import logging
import unittest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

# pytype: skip-file

# beam-playground:
# name: StreamingWordCountITTest
# description: Unit-test for the streaming WordCount example.
# multifile: false
# pipeline_options:
# categories:
# - Streaming
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - Streaming
# - Streaming
# - IO

# - IO

import logging
import unittest
import uuid
Expand Down
9 changes: 9 additions & 0 deletions sdks/python/apache_beam/examples/wordcount_minimal_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

# pytype: skip-file

# beam-playground:
# name: WordCountMinimalTest
# description: Unit-test for the minimal WordCount example.
# multifile: false
# pipeline_options:
# categories:
# - IO
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - IO
# - IO
# - Combiners

# - Combiners

import collections
import logging
import re
Expand Down
9 changes: 9 additions & 0 deletions sdks/python/apache_beam/examples/wordcount_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,15 @@

# pytype: skip-file

# beam-playground:
# name: WordCountTest
# description: Unit-test for the WordCount example.
# multifile: false
# pipeline_options:
# categories:
# - IO
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - IO
# - IO
# - Combiners

# - Combiners

import collections
import logging
import re
Expand Down
8 changes: 8 additions & 0 deletions sdks/python/apache_beam/metrics/metric_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@

# pytype: skip-file

# beam-playground:
# name: MetricTest
# description: Unit-test for the Metric example.
# multifile: false
# pipeline_options:
# categories:
# - Metrics
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# - Metrics
# - Metrics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ditto


import unittest

import hamcrest as hc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

# pytype: skip-file

# beam-playground:
# name: DataflowExerciseStreamingMetricsTest
# description: Unit-test for the word-counting workflow.
# multifile: false
# pipeline_options:
# categories:
# - Streaming
# - Metrics

import logging
import unittest
import uuid
Expand Down
9 changes: 9 additions & 0 deletions sdks/python/apache_beam/transforms/sql_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@

# pytype: skip-file

# beam-playground:
# name: SQLTest
# description: Unit-test for the transforms that use
# the SQL Expansion service.
# multifile: false
# pipeline_options:
# categories:
# - Beam SQL
Copy link
Member

Choose a reason for hiding this comment

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

have you tested that these examples run well on the playground?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi Pablo, yes, all these examples have been tested and completed without errors


import logging
import typing
import unittest
Expand Down