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-9951] Adding integration tests for synthetic pipelines in Go #11870

Merged
merged 3 commits into from
Jun 11, 2020

Conversation

youngoli
Copy link
Contributor

@youngoli youngoli commented May 30, 2020

This adds integration tests for synthetic pipelines.


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.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go 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
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- Build Status

Pre-Commit Tests Status (on master branch)

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

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

Still in progress. This adds integration tests for synthetic pipelines.
@youngoli
Copy link
Contributor Author

As a note for what still needs to be done:

  • Unit tests for this code
  • I'd like to separate the CountElms aggregation into Beam, alongside the existing Count (which works per-key).
  • The count PAssert needs to be changed to have its own error message, instead of using passert.Equals. From personal experience, using the passert.Equals error message is really unclear when there's an error.

CC: @lostluck Take a look if you want, but don't worry about reviewing yet.

col = beam.DropKey(s, col)
}
counted := beam.Combine(s, &elmCountCombineFn{}, col)
Equals(s, counted, count)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can the Sum transform be re-used instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it could, and I considered it, but the error message isn't too helpful either (better than equals though). I added a ParDo0 with a custom error message which I think ends up being the most user-friendly.

Copy link
Contributor

@lostluck lostluck Jun 10, 2020

Choose a reason for hiding this comment

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

I meant passert.Sum. Sorry that should have been clearer.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought so, that's what I was referring to. The error message in passert.Sum (while better than passert.Equals) is still a bit unclear, just because it specifically mentions passert.Sum instead of passert.Count.

Adding testing, and adjusting the error message for the count transform.
@youngoli youngoli changed the title [BEAM-9951] Adding integration tests for synthetic pipelines in Go (IN-PROGRESS) [BEAM-9951] Adding integration tests for synthetic pipelines in Go Jun 10, 2020
@youngoli
Copy link
Contributor Author

I added unit tests and changed the error message.

I spent a bunch of time moving the Count code to Beam (specifically the stats package), but ended up having to scrap it because having it there caused a circular dependency. Testing relied on stats which relied on testing for passerts. I'll add an independent version to the stats package because I already have the code written and it seems valuable, but it's not going to be used for the passerts.

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.

This is great! Thanks :D

@lostluck
Copy link
Contributor

Run Go PostCommit

@lostluck lostluck merged commit 5e31d3a into apache:master Jun 11, 2020
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

2 participants