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-13894] Unit test utilities in the ptest package #16830

Merged
merged 3 commits into from
Feb 14, 2022

Conversation

jrmccluskey
Copy link
Contributor

Updates the ptest package to unit test the utility transforms provided.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

ValidatesRunner compliance status (on master branch)

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- Build Status Build Status Build Status Build Status ---
Java Build Status Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Build Status
Python --- Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status ---
XLang Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status ---

Examples testing status on various runners

Lang ULR Dataflow Flink Samza Spark Twister2
Go --- --- --- --- --- --- ---
Java --- Build Status
Build Status
Build Status
--- --- --- --- ---
Python --- --- --- --- --- --- ---
XLang --- --- --- --- --- --- ---

Post-Commit SDK/Transform Integration Tests Status (on master branch)

Go Java Python
Build Status Build Status Build Status
Build Status
Build Status

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website Whitespace Typescript
Non-portable Build Status
Build Status
Build Status
Build Status
Build Status
Build Status Build Status Build Status Build Status
Portable --- Build Status Build Status --- --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests

See CI.md for more information about GitHub Actions CI.

@github-actions github-actions bot added the go label Feb 11, 2022
@codecov
Copy link

codecov bot commented Feb 11, 2022

Codecov Report

Merging #16830 (d1d0524) into master (7975127) will decrease coverage by 27.76%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           master   #16830       +/-   ##
===========================================
- Coverage   74.65%   46.89%   -27.77%     
===========================================
  Files         655      204      -451     
  Lines       82347    20122    -62225     
===========================================
- Hits        61477     9436    -52041     
+ Misses      19870     9686    -10184     
  Partials     1000     1000               
Impacted Files Coverage Δ
sdks/go/pkg/beam/testing/ptest/ptest.go 48.97% <ø> (ø)
sdks/python/apache_beam/io/fileio.py
...amples/snippets/transforms/elementwise/tostring.py
...hon/apache_beam/portability/api/beam_fn_api_pb2.py
...n/apache_beam/examples/cookbook/bigquery_schema.py
...eam/runners/interactive/caching/streaming_cache.py
.../python/apache_beam/io/gcp/datastore/v1new/util.py
sdks/python/apache_beam/io/aws/s3filesystem.py
...cp/internal/clients/storage/storage_v1_messages.py
.../python/apache_beam/io/gcp/bigquery_io_metadata.py
... and 444 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7975127...d1d0524. Read the comment docs.

@jrmccluskey
Copy link
Contributor Author

R: @lostluck @damccorm

Copy link
Contributor

@damccorm damccorm left a comment

Choose a reason for hiding this comment

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

Left one small style comment, but otherwise LGTM!

p, s, col := Create(inputs)
passert.EqualsList(s, col, inputs)
if err := Run(p); err != nil {
t.Errorf("create pipeline failed, got %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Style nit (treat any style comments from me with a grain of salt since I'm new to the language): prefer identifying the function in your error - https://github.com/golang/go/wiki/TestComments#identify-the-function - and probably use "got, want" style, so ("Run(p) = %q, want nil", err)

In particular here (and below) the pipeline creation isn't really what's failing, its running the pipeline which could be an issue with Create, Run, or passert.EqualsList (but hopefully not since that's not what we're 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.

Linking to golang documentation is always appreciated. I've updated the message to your format with the one tweak of specifying that we returned an error. Thank you!

Copy link
Contributor

@lostluck lostluck left a comment

Choose a reason for hiding this comment

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

LGTM Thanks! Sorry for the delay.

@lostluck lostluck merged commit dbb7b16 into apache:master Feb 14, 2022
Naireen pushed a commit to Naireen/beam that referenced this pull request Feb 18, 2022
@jrmccluskey jrmccluskey deleted the ptestTesting branch May 12, 2022 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants