[ 
https://issues.apache.org/jira/browse/FLINK-7554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16508141#comment-16508141
 ] 

ASF GitHub Bot commented on FLINK-7554:
---------------------------------------

GitHub user buptljy opened a pull request:

    https://github.com/apache/flink/pull/6148

    [FLINK-7554][Tests] Add a testing RuntimeContext to test utilities

    ## What is the purpose of the change
    This pull request adds a TestingRuntimeContext to help developers test 
their own user-defined functions like CoprocessFunction instead of testing the 
whole pipeline.
    
    ## Brief change log
     - TestingRuntimeContext can be directly used in unit testing of both 
dataset functions and datastream functions, including the support of 
broadcastVariable, state, accumulator and so on.
     - Documents are written in udf_test, including examples of Java and Scala.
    
    ## Verifying this change
    
     - This change has already been verified in new unit testing files in test 
directory, 
org.apache.flink.streaming.api.functions.test.TestingRuntimeContextTest and 
org.apache.flink.streaming.api.functions.test.TestingRuntimeContextTest.
    
    ## Documentation
    
      - This pull request is a new feature.
      - Related documents are written in docs directory.


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/buptljy/flink 7554

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/6148.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #6148
    
----
commit 8535b22a7cf1545381bcd7b5febc0d4763f925aa
Author: wind <bupt_ljy@...>
Date:   2018-06-11T12:40:19Z

    add TestingRuntimeContext

----


> Add a testing RuntimeContext to test utilities
> ----------------------------------------------
>
>                 Key: FLINK-7554
>                 URL: https://issues.apache.org/jira/browse/FLINK-7554
>             Project: Flink
>          Issue Type: New Feature
>          Components: Tests
>            Reporter: Timo Walther
>            Assignee: buptljy
>            Priority: Major
>              Labels: starter
>
> When unit testing user-defined functions it would be useful to have an 
> official testing {{RuntimeContext}} that uses Java collections for storing 
> state, metrics, etc.
> After executing the business logic, the user could then verify how the state 
> of the UDF changed or which metrics have been collected.
> This issue includes documentation for the "Testing" section.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to