How to specify the file order when using --dist loadfile? #1316
MatthewRack
started this conversation in
General
Replies: 2 comments
-
|
Made a typo. I meant gw0 or gw1, not pw. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Currently there's no built-in mechanism for that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using pytest with playwright to run UI tests, and passing in the options -n 4 --dist loadfile. This is working out fine. But I'd really like to be able to tell it the order in which to get the files. Right now it seems like it is what ever the order is that is feed to it via the pytest collection.
I'm not the greatest coders, especially when it comes to adding in hooks in pytest, so I was using AI to help me figure this out.
I was able to pass in a list of files which is the order I want to run to be in and then in a pytest hook, it created a scheduler to use and fed it the files. However, the best AI could come up with (after many tries) was to use the first 4 files in my list, and then after that it lost the ability to control the next files to use. So let me explain that a little more simply...
If I use -n 2 --dist loadfile, and I also pass in a list of files, like --fileorder 'file4, file3, file7, file1, etc..' I want file4 to run on pw0 and file3 to run on pw1 to start. Then when one of those pw is done, it grabs the next file, which is file7. Unfortunately, it would not grab file7... it would grab whatever... maybe file9 or file5, or possibly file7 too.
I think the AI said the issue was that the code to schedule the next file was just ignoring the schedule it made.
Any thoughts on how this can be achieved? Maybe I can tell AI what to do to fix this?
And if possible, could you add this as a feature to the plug-in?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions