pabot icon indicating copy to clipboard operation
pabot copied to clipboard

`DependencyLibrary` integration?

Open mentalisttraceur opened this issue 2 years ago • 11 comments

Figured I'd bring this up here to get wider discussion going.

A user of my DependencyLibrary opened this issue which got me thinking about how pabot and DependencyLibrary could combine great together.

I wrote a bunch of my thoughts in that issue, but the TL;DR of my current thoughts is:

  1. Seems to me like with some significant work inside DependencyLibrary, you could run your tests with pabot test-level parallelism and have it Just Work if only some of the tests need to be ordered sequentially.

  2. If it is possible for pabot to provide an exception that a test keyword can raise to say "please run/resume me after you've finished running {{specific test or suite}}", then it seems that DependencyLibrary can combine with pabot such that users get the most parallelism possible while keeping any test sequencing that they really need.

mentalisttraceur avatar Mar 16 '22 08:03 mentalisttraceur

I noticed pabot.SharedLibrary, and that seems like it will simplify work on the DependencyLibrary end.

But it looks like if the shared library is a Robot event listener, there's no event proxying. Unless I missed where that's implemented?

I'd like to get that implemented within pabot shared library, and I'm happy to do the work and open the PR myself if you'd like. I can also open another issue to discuss that specifically if you'd like.

mentalisttraceur avatar Mar 18 '22 21:03 mentalisttraceur

Hi @mentalisttraceur , Thanks for interesting ideas. I'll need to spend a bit of time to understand the whole scope of your library and how to best approach this.

mkorpela avatar Mar 19 '22 15:03 mkorpela

Hi @mkorpela I am also interested on this feature. And I already took a look at the code and starting working on something. My suggestion will be, to use the .pabotsuite generated file, adding an extra keyword (for example: "#DEPENDS"), and this can be translated to "#WAIT" keyword afterwards. If you want I can make a draft pull request and work together on it. - right now is only a little bit of refactoring, in order to isolate the scope of the changes - Shall I make a fork and push the changes to my local copy or just pushing the new branch here?

nestoracunablanco avatar May 08 '22 17:05 nestoracunablanco

Hi @mkorpela here is the first draft regarding the proposal from 20 days ago. It is still somewhat far related to the last goal, which would involve some more related task scheduling. The trick for now is organizing the dependencies in different groups under the hood. Hope you like it.

nestoracunablanco avatar May 28 '22 16:05 nestoracunablanco

I haven't had much time to review this idea since I opened this issue in March, but I still think that the best (and very viable!) solution to this problem is:

  1. enrich pabot.SharedLibrary to also be a Robot event listener, and pass events to the library it wraps. Then:
    1. the entire ecosystem benefits: all libraries using Robot's event listener API start working with pabot.SharedLibrary, and incidentally
    2. users of both pabot and DependencyLibrary can just compose them by importing DependencyLibrary through pabot.SharedLibrary and the dependency tracking in DependencyLibrary works as normal.
  2. ideally, add a special exception subclass or API function to pabot, which tests can raise/call to tell pabot to rerun/resume that test when another some condition is true (this part might be hard - I haven't had time to look at the implementation, which is also why I haven't done anything on this issue). Then all sorts of libraries can be written or enhanced to dynamically provide ordering information to pabot, at runtime, such as DependencyLibrary.

I haven't looked at what @nestoracunablanco is doing in #479 besides the PR description, but maybe it is helpful along the way to achieving the second point, because once we have logic for dependencies, the next step is letting tests dynamically tell pabot dependency information at runtime, and having pabot react.

mentalisttraceur avatar May 28 '22 23:05 mentalisttraceur