robotcodedev / robotcode

RobotFramework support for Visual Studio Code
https://robotcode.io
Apache License 2.0
168 stars 13 forks source link

[ENHANCEMENT] How to run tests in parallel (possibly with pabot) using robotcode extension #252

Open digoo opened 2 months ago

digoo commented 2 months ago

Hello, I would like to first say that I'm loving the tool, debugging with it is an awesome feature.

Now to the business,

I've been trying to make tests to run in parallel, with pabot in such case, but I can't find how to configure robotcode/VSCode to replace "robot" with "pabot", therefore I came here, with shame by not finding the solution myself, to ask if:

Does someone knows how to configure pabot with robotcode?

Thank you in advance for replies.

Desktop (please complete the following information):

gohierf commented 2 months ago

Hello, this is a good question, and I hope it will be logged here too. Yet, you might be interested to ask this on Robot Framework slack or forum.

d-biehl commented 2 months ago

sorry, a direct integration of pabot is not possible at the moment, so you have nothing to be ashamed of ;-)

To be honest I thougth sometimes about such things like running tests in parallel, I don't think that I want to use pabot as a runner, because it "hacks" robot framework and it is old code and supports very old robot and python versions.

But there are some new features in Robot Framework, like saving a test suite or test run to json format and in python the concurrent libraries and something like ProcessPoolExecutor, that should make it easy to implement such things. But the main problem is, how can I handle such things like seeing the status of execution in vscode or how can I attach the RobotCode debugger to several processes.

But I will leave this Question open, make it to an enhancement, to not forget this.

In the mean time, maybe you can create a vscode launch config of type python module with pabot as module and all the command line parameters you need, then it should be possible to start tests with pabot within vscode, but debugging the robot part is not possible with that.

digoo commented 1 month ago

Hello @d-biehl Thank you for replying and adding it as enhancement 🥇.

Not very much related, but still related to changing how we call robot with the robotcode, here at the company we have been doing a POC with percy and the tool require us to start robot with npx percy -- exec robot ...

<If you don't see the relation here I can sure open a new ticket to discuss that.>

Of course, as workaround, the vs code launch config of type python module should also help in such situation.

GerwinLaagland commented 19 hours ago

@digoo Have you tried running pabot with the --command / --end-command flags? I think that might work, I've tried this out today on a very basic setup. And it doesn't seem to crash and uses toml profile information. A very simplistic example:

pabot --command robotcode -p tst robot --end-command .