You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@toree.apache.org by "poplav (JIRA)" <ji...@apache.org> on 2016/05/10 17:54:13 UTC

[jira] [Commented] (TOREE-296) Migrate System Tests To Use Jupyter Kernel Test

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

poplav commented on TOREE-296:
------------------------------

Comment in reference to https://github.com/apache/incubator-toree/pull/39

Covered vs Not Covered in reference to issue description
============================================
Covered: kernel installed, kernel info, executing hello world, an sc parallelize operation, a magic operation via showtypes.
Not Covered (due to current limitations of https://github.com/jupyter/jupyter_kernel_test) :  Truncation - due to strict equality vs ends with of https://github.com/jupyter/jupyter_kernel_test/blob/b51d9911bc7a8bfbb826d3fd3149767c319b73fe/jupyter_kernel_test/__init__.py#L212, All Comm related tests.

Note the jupyter_kernel_test project currently tests using the kernel client apis exposed through https://github.com/jupyter/jupyter_client/blob/master/jupyter_client/client.py.  We certainly can open PRs on jupyter_kernel_test to support more coverage, but I am proposing us at least merging this in to get us to where the other kernels are.  We can keep this particular issue open as there is more work that can be done.

> Migrate System Tests To Use Jupyter Kernel Test
> -----------------------------------------------
>
>                 Key: TOREE-296
>                 URL: https://issues.apache.org/jira/browse/TOREE-296
>             Project: TOREE
>          Issue Type: Test
>            Reporter: Corey A Stubbs
>            Priority: Critical
>
> Unreliable system tests were removed for the 0.1.0 release. These tests should be migrated to use the [jupyter kernel test|https://github.com/jupyter/jupyter_kernel_test] project.  I have included the pseudocode/comments from the system tests which were removed.
> {code:file=TruncationTests.scala}
> describe( "Test Truncation") {
>   it("should show or not show types based on %showtypes") {
>     // Run the code on the kernel
>     """%showtypes off
>       |1
>     """
>     // Assert the output should end with "1"
>     
>     // Run the code on the kernel
>     """%showtypes on
>       |1
>     """
>     // Assert the output should be "Int = 1"
>     
>     // Run the code on the kernel  
>     """%showtypes off
>     |1
>     """
>     // Assert the output should end with "1"
>   }
>   it("should truncate or not truncate based on %truncate") {
>     // Run the code on the kernel
>     "for ( a <-  1 to 300 ) yield a" 
>     // Assert the output should end with "..."
>     // Run the code on the kernel
>     """%Truncation off
>       |for ( a <-  1 to 300 ) yield a
>     """
>     // Assert the output should end with "300"
>       // Run the code on the kernel
>       """%Truncation on
>         |for ( a <-  1 to 300 ) yield a
>       """ 
>       // Assert the output should end with "..."
>   }
> }
> {code}
> {code:file=KernelCommSpecForSystem.scala}
> describe("Comm for Kernel System") {
>   describe("executing Comm API to open a new comm") {
>     it("should correctly send comm_open to socket") {
>       //  Send the following code to the kernel
>       """
>         |kernel.comm.open("$testTargetName")
>       """
>       // Assert CommOpen message was received
>     }
>   }
>   describe("executing Comm API to send a message") {
>     it("should correctly send comm_msg to socket") {
>       //  Send the following code to the kernel
>       s"""
>          |val commWriter = kernel.comm.open("$testTargetName")
>          |commWriter.writeMsg(
>          |   org.apache.toree.kernel.protocol.v5.MsgData("key" -> "value")
>          |)
>         """
>       // Assert CommMsg was received with msg.data.key == 'value'
>     }
>   }
>   describe("executing Comm API to close an existing comm") {
>     it("should correctly send comm_close to socket") {
>       //  Send the following code to the kernel
>       s"""
>          |val commWriter = kernel.comm.open("$testTargetName")
>          |commWriter.close()
>         """
>       //  Assert CommClose was sent
>     }
>   }
>   describe("receiving Comm API open from a client") {
>     it("should respond comm_close if the target is not found") {
>       //  Send a CommOpen for a non-existent target
>       //  Assert we receive a CommClose for that target
>     }
>   }
>   it("should not execute open callbacks if the target is not found") {
>     // Create a comm open  callback
>     // Send a comm_open (as if a client did it) with wrong target
>     // Assert the open was never called
>   }
>   it("should execute open callbacks if the target is found") {
>     // Create a callback for our comm target
>     // Send a comm_open (as if a client did it)
>     // Assert the comm callback is called
>   }
> }
>     describe("receiving Comm API message from a client") {
>       it("should not execute message callbacks if the Comm id is not found") {
>         // Create a callback for our comm target
>         // Set up the Comm id prior so we have a proper link
>         // Send a comm_msg (as if a client did it) to the incorrect id
>         // Assert the comm callback is not called
>       }
>       it("should execute message callbacks if the Comm id is found") {
>           // Create a callback for our comm target
>           // Set up the Comm id prior so we have a proper link
>           // Send a comm_msg (as if a client did it)
>           // Assert the comm callback is called
>         }
>     }
>     describe("receiving Comm API close from a client") {
>       it("should not execute close callbacks if the Comm id is not found") {
>         // Create a callback for our comm target
>         // Set up a Comm id prior so we have a proper link
>         // Send a comm_close to the incorrect Comm id
>         // Assert our callback is not called
>       }
>       it("should execute close callbacks if the Comm id is found") {
>         // Create a callback for our comm target
>         // Set up a Comm id prior so we have a proper link
>         // Send a comm_close
>         // Assert our callback is called
>       }
>       it("should unlink the Comm id from the target if the Comm id is found") {
>         // Create a callback for our comm target
>         // Set up a Comm id prior so we have a proper link
>         // Send a comm_close
>         // Assert our callback is called
>         // Send a comm_close (again) with the expectation that nothing happens
>         // Assert our callback is not called again
>       }
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)