Skip to content

Multiple Multiremote sessions in parallel#5458

Closed
ghost wants to merge 1 commit intomasterfrom
unknown repository
Closed

Multiple Multiremote sessions in parallel#5458
ghost wants to merge 1 commit intomasterfrom
unknown repository

Conversation

@ghost
Copy link

@ghost ghost commented Jun 3, 2020

Proposed changes

Allow running Multiremote in parallel by passing an array of multiremote capabilities - #5445
So that something like this is possible:

capabilities: [
        {
            browser1: { capabilities: { browserName: 'chrome' } },
            browser2: { capabilities: { browserName: 'chrome' } }
        },
        {
            browser1: { capabilities: { browserName: 'firefox' } },
            browser2: { capabilities: { browserName: 'firefox' } }
        },
        {
            browser1: { capabilities: { browserName: 'chrome' } },
            browser2: { capabilities: { browserName: 'firefox' } }
        }
    ],

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Further comments

As I see it, there is no problem for runner to execute multiple Multiremote sessions in parallel. It can be accomplished by simply pushing multiple tests into @wdio/cli/launcher.js's schedule array. The main problem is getting capabilities there in correct format, which is a little problematic because all of services are made to only support array as singleremote and object as multiremote.

Here in these changes I have modified @wdio/selenium-standalone-service to also handle multiremote array, which has to be done everywhere if this change makes sense.

To use parallel multiremote, capabilities can be passed like this:

parallelMultiremote: true,
capabilities: [
    {
        browser1: { capabilities: { browserName: 'chrome' } },
        browser2: { capabilities: { browserName: 'chrome' } }
    },
    {
        browser1: { capabilities: { browserName: 'firefox' } },
        browser2: { capabilities: { browserName: 'firefox' } }
    }
],

Here you can see a new test runner option parallelMultiremote. When it's absent/false, capabilities will be treated just like before but when it's true, it will use new logic. This is the way which resulted in least changes needed for it to work.

I have only tested in one simple case and it worked very well, but there is something probably broken by this.

Reviewers: @webdriverio/project-committers

@jsf-clabot
Copy link

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided not to use multiremoteCapabilities as it was complicating things more than my current solution.

Can you elaborate why using multiremoteCapabilities makes it more complicated?

? this.capabilities
: Object.values(this.capabilities)
).forEach((cap) => Object.assign(cap, DEFAULT_CONNECTION, { ...cap }))
if (config.parallelMultiremote) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change should be made in other services too where we modify the capabilities.

@christian-bromann
Copy link
Member

ping @arnisgustins

@ghost
Copy link
Author

ghost commented Jun 22, 2020

Sorry, I don't really have time to work on this, I just hope that it becomes a real feature somewhere in the future.
My goal was to see if this can work and it does. Only problem is that everything around is created with "only one multi-remote session" in mind.

@christian-bromann
Copy link
Member

@arnisgustins is your intend to not continue working on this?

@ghost
Copy link
Author

ghost commented Jun 25, 2020

@arnisgustins is your intend to not continue working on this?

Yes, at least for a long time.

@christian-bromann
Copy link
Member

Yes, at least for a long time.

@arnisgustins great let me know if I can help with anything. Maybe you can schedule an Office Hours appointment and we can sync.

@dizhar
Copy link

dizhar commented Dec 20, 2020

I hope you guys will continue working on this feature.

@dizhar
Copy link

dizhar commented Dec 20, 2020

When will this feature be implemented?

@christian-bromann
Copy link
Member

When will this feature be implemented?

This is an open source project. If you like to see something implemented take the initiative and provide a pull request 😉

@christian-bromann
Copy link
Member

Given the amount of changes happening since opening the PR I recommend to create a new PR with updated codebase.

@cruzdense
Copy link

@christian-bromann Do we already have a fix/enhancement for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants