You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "Kenneth Knowles (JIRA)" <ji...@apache.org> on 2016/12/17 22:26:59 UTC
[jira] [Resolved] (BEAM-85) PAssert needs sanity check that it's
used correctly
[ https://issues.apache.org/jira/browse/BEAM-85?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kenneth Knowles resolved BEAM-85.
---------------------------------
Resolution: Fixed
Fix Version/s: 0.5.0-incubating
When used as a `@Rule` this is now the case. Now we need to port the tests, which I'd say fits more into BEAM0-298 or potentially a new ticket.
> PAssert needs sanity check that it's used correctly
> ---------------------------------------------------
>
> Key: BEAM-85
> URL: https://issues.apache.org/jira/browse/BEAM-85
> Project: Beam
> Issue Type: New Feature
> Components: sdk-java-core
> Reporter: Daniel Halperin
> Assignee: Stas Levin
> Fix For: 0.5.0-incubating
>
>
> We should validate two things:
> # DataflowAssert is not added to a pipeline that has already been run.
> # The pipeline is run after the DataflowAssert is added.
> If either of these are not validated, then it is possible that the test doesn't actually verify anything.
> This code should throw an assertion error or fail in some other way.
> {code}
> Pipeline p = TestPipeline.create();
> PCollection<Boolean> value = p.apply(Create.of(Boolean.FALSE));
> p.run();
> DataflowAssert.thatSingleton(value).isEqualTo(true);
> {code}
> but it would pass silently.
> similarly, this code wills pass silently:
> {code}
> Pipeline p = TestPipeline.create();
> PCollection<Boolean> value = p.apply(Create.of(Boolean.FALSE));
> DataflowAssert.thatSingleton(value).isEqualTo(true);
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)