Skip to content

fix(@wdio/runner): Respect excludes in capabilities in multiremote case.#13878

Merged
christian-bromann merged 4 commits intowebdriverio:mainfrom
damencho:filter-caps
Nov 14, 2024
Merged

fix(@wdio/runner): Respect excludes in capabilities in multiremote case.#13878
christian-bromann merged 4 commits intowebdriverio:mainfrom
damencho:filter-caps

Conversation

@damencho
Copy link
Contributor

@damencho damencho commented Nov 12, 2024

Fixes #13875.

When a spec is excluded from some capability there is no point of starting the browser session for it.

Proposed changes

When spec is excluded in multiremote the browser sessions are still created for it.

specs: [
        'test/example.spec.ts'
    ],

    capabilities: {
        participant1: {
            capabilities: {
                browserName: 'chrome'
            }
        },
        participant2: {
            capabilities: {
                browserName: 'chrome',
                'wdio:exclude': [
                    'test/example.spec.ts'
                ]
            }
        }
    },

This will create two browser sessions for the test and the PR will change that to be only one.

Types of changes

  • Polish (an improvement for an existing feature)
  • [ X ] 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 (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

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

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • [ X ] This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

It was discussed in #13875

Reviewers: @webdriverio/project-committers

Fixes webdriverio#13875.

When a spec is excluded from some capability there is no point of starting the browser session for it.
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 12, 2024

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: christian-bromann / name: Christian Bromann (da7986f)
  • ✅ login: damencho / name: Дамян Минков (5c9915f, b69c17c, cab6156)

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 12, 2024

Open in Stackblitz

eslint-plugin-wdio

pnpm add https://pkg.pr.new/webdriverio/webdriverio/eslint-plugin-wdio@13878

@wdio/allure-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/allure-reporter@13878

@wdio/browser-runner

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/browser-runner@13878

@wdio/browserstack-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/browserstack-service@13878

@wdio/appium-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/appium-service@13878

@wdio/cli

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/cli@13878

@wdio/concise-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/concise-reporter@13878

@wdio/config

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/config@13878

@wdio/cucumber-framework

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/cucumber-framework@13878

@wdio/dot-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/dot-reporter@13878

@wdio/firefox-profile-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/firefox-profile-service@13878

@wdio/globals

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/globals@13878

@wdio/jasmine-framework

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/jasmine-framework@13878

@wdio/json-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/json-reporter@13878

@wdio/junit-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/junit-reporter@13878

@wdio/lighthouse-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/lighthouse-service@13878

@wdio/local-runner

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/local-runner@13878

@wdio/logger

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/logger@13878

@wdio/mocha-framework

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/mocha-framework@13878

@wdio/protocols

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/protocols@13878

@wdio/repl

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/repl@13878

@wdio/reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/reporter@13878

@wdio/runner

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/runner@13878

@wdio/sauce-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/sauce-service@13878

@wdio/shared-store-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/shared-store-service@13878

@wdio/smoke-test-cjs-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-cjs-service@13878

@wdio/smoke-test-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-reporter@13878

@wdio/smoke-test-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/smoke-test-service@13878

@wdio/spec-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/spec-reporter@13878

@wdio/static-server-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/static-server-service@13878

@wdio/sumologic-reporter

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/sumologic-reporter@13878

@wdio/testingbot-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/testingbot-service@13878

@wdio/types

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/types@13878

@wdio/utils

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/utils@13878

@wdio/webdriver-mock-service

pnpm add https://pkg.pr.new/webdriverio/webdriverio/@wdio/webdriver-mock-service@13878

webdriver

pnpm add https://pkg.pr.new/webdriverio/webdriverio/webdriver@13878

webdriverio

pnpm add https://pkg.pr.new/webdriverio/webdriverio@13878

commit: da7986f

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.

Can we add some unit tests for this as well?

_automationProtocol: this._config.automationProtocol,
automationProtocol: './protocol-stub.js'
}, caps)
}, filteredCaps)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
}, filteredCaps)
}, this._caps)

@damencho
Copy link
Contributor Author

Can we add some unit tests for this as well?

Is it ok to add them in smoke tests?

@christian-bromann
Copy link
Member

Is it ok to add them in smoke tests?

Yes, you should be able to verify that on x of x session were created.

@damencho
Copy link
Contributor Author

Is it ok to add them in smoke tests?

Yes, you should be able to verify that on x of x session were created.

Yep, I have added the tests.

@christian-bromann
Copy link
Member

Mind signing the CLA?

@damencho
Copy link
Contributor Author

Mind signing the CLA?

Yes, I'm working on that with our legal team, sorry for the delay.

@damencho
Copy link
Contributor Author

Mind signing the CLA?

Yes, I'm working on that with our legal team, sorry for the delay.

Signed.

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.

Just adding a little comment for understanding.

LGTM 👍

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Nov 14, 2024
@christian-bromann christian-bromann merged commit 6d146cd into webdriverio:main Nov 14, 2024
@wdio-bot
Copy link
Contributor

Hey damencho 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution.

We've sent you an email with further instructions on how to claim your expenses from our development fund.
Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

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

Labels

Expensable $35 💸 PR: Polish 💅 PRs that contain improvements on existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Skips creating multiremote session when that session is excluded

3 participants