Re: [akka-user] [akka-stream] Stages unit testing

2015-01-20 Thread Endre Varga
Hi,


On Mon, Jan 19, 2015 at 5:54 PM, Alexey Romanchuk 
alexey.romanc...@gmail.com wrote:

 Hey hakkers!

 I am currently updating old application built on akka-streams 0.4 to
 1.0-MX API. I used Transformers and now migrate it to PullPushStages. In
 general migration is pretty easy, but I can not figure out how should I
 rewrite unit test for custom stages?

 In 0.4 transformers had simple external API and I use unit test to test
 them. There is context in 1.0 stages API and unit testing is not so
 straightforward. I found that most of prebuild stages test by building
 simple streams, but looks like it is too much testing environment for stage
 testing.


I think simple streams are usually all you need for testing PushPullStages
(but not enough for DetachedStages, we need better testing support for them
than the very low level testing stuff we have now). Now there is a hidden
class, that is INTERNAL API for now, but we might open it up. It is called
IteratorInterpreter, and it allows to execute a series of PushPullStages on
top of an Iterator, providing a new Iterator in turn, which basically
drives the Stages. No materialization, no actors, no threads, no
actorsystem, just a plain iterator. I guess it is useful for lot of testing
tasks. Btw, all of the interpreters are very lightweight, they are
basically allocation free even for the hot path, only completion and error
handling uses some allocations.

-Endre


 Could you advise right approach to test streams and custom stages
 especially?

 Thanks!

 --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [akka-stream] Stages unit testing

2015-01-20 Thread Alexey Romanchuk
Hi,

looks very interesting and very useful especially for stages testing.

Thanks!

On Tue, Jan 20, 2015 at 5:26 PM, Endre Varga endre.va...@typesafe.com
wrote:

 Hi,


 On Mon, Jan 19, 2015 at 5:54 PM, Alexey Romanchuk 
 alexey.romanc...@gmail.com wrote:

 Hey hakkers!

 I am currently updating old application built on akka-streams 0.4 to
 1.0-MX API. I used Transformers and now migrate it to PullPushStages. In
 general migration is pretty easy, but I can not figure out how should I
 rewrite unit test for custom stages?

 In 0.4 transformers had simple external API and I use unit test to test
 them. There is context in 1.0 stages API and unit testing is not so
 straightforward. I found that most of prebuild stages test by building
 simple streams, but looks like it is too much testing environment for stage
 testing.


 I think simple streams are usually all you need for testing PushPullStages
 (but not enough for DetachedStages, we need better testing support for them
 than the very low level testing stuff we have now). Now there is a hidden
 class, that is INTERNAL API for now, but we might open it up. It is called
 IteratorInterpreter, and it allows to execute a series of PushPullStages on
 top of an Iterator, providing a new Iterator in turn, which basically
 drives the Stages. No materialization, no actors, no threads, no
 actorsystem, just a plain iterator. I guess it is useful for lot of testing
 tasks. Btw, all of the interpreters are very lightweight, they are
 basically allocation free even for the hot path, only completion and error
 handling uses some allocations.

 -Endre


 Could you advise right approach to test streams and custom stages
 especially?

 Thanks!

 --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to the Google Groups
 Akka User List group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


  --
  Read the docs: http://akka.io/docs/
  Check the FAQ:
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
 ---
 You received this message because you are subscribed to a topic in the
 Google Groups Akka User List group.
 To unsubscribe from this topic, visit
 https://groups.google.com/d/topic/akka-user/lopuSiMfXMw/unsubscribe.
 To unsubscribe from this group and all its topics, send an email to
 akka-user+unsubscr...@googlegroups.com.
 To post to this group, send email to akka-user@googlegroups.com.
 Visit this group at http://groups.google.com/group/akka-user.
 For more options, visit https://groups.google.com/d/optout.


-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


Re: [akka-user] [akka-stream] Stages unit testing

2015-01-19 Thread Konrad Malawski
Hi Alexey!
This sounds like it should be thought of and perhaps shipped together with the 
Streams Testkit once we get to implementing it.
Feel free to add your ideas to this ticket: 
https://github.com/akka/akka/issues/15748 in which we’re tracking ideas on what 
a Streams TestKit should look like.

Thanks for the feedback / interest and ideas :-)

-- 
Konrad 'ktoso’ Malawski
Akka @ Typesafe

On 19 January 2015 at 17:54:05, Alexey Romanchuk (alexey.romanc...@gmail.com) 
wrote:

Hey hakkers!

I am currently updating old application built on akka-streams 0.4 to 1.0-MX 
API. I used Transformers and now migrate it to PullPushStages. In general 
migration is pretty easy, but I can not figure out how should I rewrite unit 
test for custom stages? 

In 0.4 transformers had simple external API and I use unit test to test them. 
There is context in 1.0 stages API and unit testing is not so straightforward. 
I found that most of prebuild stages test by building simple streams, but looks 
like it is too much testing environment for stage testing. Could you advise 
right approach to test streams and custom stages especially? 

Thanks!
--
 Read the docs: http://akka.io/docs/
 Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
 Search the archives: https://groups.google.com/group/akka-user
---
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.


[akka-user] [akka-stream] Stages unit testing

2015-01-19 Thread Alexey Romanchuk
Hey hakkers!

I am currently updating old application built on akka-streams 0.4 to 1.0-MX 
API. I used Transformers and now migrate it to PullPushStages. In general 
migration is pretty easy, but I can not figure out how should I rewrite 
unit test for custom stages? 

In 0.4 transformers had simple external API and I use unit test to test 
them. There is context in 1.0 stages API and unit testing is not so 
straightforward. I found that most of prebuild stages test by building 
simple streams, but looks like it is too much testing environment for stage 
testing. Could you advise right approach to test streams and custom stages 
especially? 

Thanks!

-- 
  Read the docs: http://akka.io/docs/
  Check the FAQ: 
 http://doc.akka.io/docs/akka/current/additional/faq.html
  Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups Akka 
User List group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to akka-user+unsubscr...@googlegroups.com.
To post to this group, send email to akka-user@googlegroups.com.
Visit this group at http://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.