Skip to content

added observability and session check in browserstack service#10037

Merged
christian-bromann merged 12 commits intowebdriverio:mainfrom
sriteja777:main
Apr 3, 2023
Merged

added observability and session check in browserstack service#10037
christian-bromann merged 12 commits intowebdriverio:mainfrom
sriteja777:main

Conversation

@sriteja777
Copy link
Contributor

@sriteja777 sriteja777 commented Mar 23, 2023

Proposed changes

Previously we assumed that anyone with browserstack service installed wants to run their tests on browserstack only, now we want to allow people run tests locally along with browserstack service for observability. Made necessary changes for that.

  • Added test observability user check before setting creds.
  • Added browserstack session check before adding service version

Related V7 PR: #10038

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

Reviewers: @webdriverio/project-committers

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Mar 23, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

capability['bstack:options'] = { wdioService: bstackServiceVersion }
} else if (shouldAddServiceVersion(this._config, this._options.testObservability)) {
capability['browserstack.wdioService'] = bstackServiceVersion
if (isBStackSession(this._config)) {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding another nested if here, why not just have this at the beginning of the constructor and return early if the session is not a BS session.

Copy link
Member

Choose a reason for hiding this comment

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

I created #10039 .. we could simplify the implementation by tackling that first, up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@christian-bromann the nested if condition is for checking whether we need to set wdioService version or not. After if condition there is code to set the buildIdentifier and buildName which we want to set even if it is not a browserstack session. So moving this to constructor won't help.

Copy link
Member

Choose a reason for hiding this comment

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

After if condition there is code to set the buildIdentifier and buildName which we want to set even if it is not a browserstack session.

Can you help me understand why this service wants to set these properties even if the session is not run on BS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have a product called observability, which shows insights of tests. This is independent of the platform in which the tests are run. So tests can run browserstack, local or somewhere else, we want the collect tests data. So that's why we are setting buildIdentifier and buildName even if it is not a browserstack session.

Copy link
Member

Choose a reason for hiding this comment

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

Gotcha, makes sense. Mind adding a comment for outside folks who are not familiar with this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, have added 9c0e75c

Copy link
Member

Choose a reason for hiding this comment

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

So just to understand this correctly. Users can use the BS service even though they run their tests on a local chrome browser without having BS involved at all?

Copy link
Contributor Author

@sriteja777 sriteja777 Mar 27, 2023

Choose a reason for hiding this comment

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

Yes @christian-bromann, it's used for reporting like mochawesome

@christian-bromann christian-bromann added the PR: Polish 💅 PRs that contain improvements on existing features label Mar 26, 2023
@christian-bromann
Copy link
Member

Test / linux (16.x) (pull_request) Failing after 2m

There seems to be a linting error.

@sriteja777
Copy link
Contributor Author

@christian-bromann Have fixed the linting issue

@sriteja777
Copy link
Contributor Author

@christian-bromann getting unrelated failure for windows and mac, possible to re-run the tests? Mac tests are passing when tested locally.

@christian-bromann
Copy link
Member

These errors are unrelated and need to be fixed in main.

@chetan-p-browserstack
Copy link

These errors are unrelated and need to be fixed in main.

@christian-bromann Could you please share ETA for releasing this PR and related v7 PR.

@christian-bromann
Copy link
Member

Could you please share ETA for releasing this PR and related v7 PR.

next week latest

@sourav-kundu
Copy link
Contributor

@christian-bromann thanks for sharing the ETA.

Actually, this is a bug for BrowserStack Test Observability users wherein they're not able to use the product if their tests are not running on BrowserStack infra.

Hence, I just wanted to confirm the ETA both for this PR and the v7 PR as early next week so that we can share the same with the impacted users.

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.

LGTM 👍

@christian-bromann christian-bromann merged commit 1325370 into webdriverio:main Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Polish 💅 PRs that contain improvements on existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants