Skip to content

Use BrowserStack to run macOS CI tests#7836

Merged
robwalch merged 3 commits intomasterfrom
task/browser-stack-functional-testing
May 8, 2026
Merged

Use BrowserStack to run macOS CI tests#7836
robwalch merged 3 commits intomasterfrom
task/browser-stack-functional-testing

Conversation

@robwalch
Copy link
Copy Markdown
Collaborator

@robwalch robwalch commented May 4, 2026

This PR will...

Use BrowserStack to run macOS CI tests

Why is this Pull Request needed?

Saucelabs tests running on macOS have been struggling to complete because of connectivity issues (request status 0).

@robwalch robwalch force-pushed the task/browser-stack-functional-testing branch 2 times, most recently from 4e9d84e to bd85af1 Compare May 4, 2026 23:59
@robwalch robwalch force-pushed the task/browser-stack-functional-testing branch from bd85af1 to 1d1ad99 Compare May 5, 2026 00:28
@robwalch robwalch added the skip-change-log Do not include the PR in the change log in the release label May 5, 2026
@robwalch robwalch force-pushed the task/browser-stack-functional-testing branch from 55a2a89 to 93e3773 Compare May 5, 2026 17:21
Copy link
Copy Markdown
Member

@tjenkinson tjenkinson left a comment

Choose a reason for hiding this comment

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

Nice

Comment thread .github/workflows/build.yml Outdated
- name: start SauceConnect tunnel
uses: saucelabs/sauce-connect-action@0ca0e6ce3a5513d6bec2a54044a536c3da3a53fb # v2
- name: setup BrowserStack env
uses: browserstack/github-actions/setup-env@master
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Would be good to pin to the current commit hash in case the browser stack repo gets compromised later

Comment thread .github/workflows/build.yml Outdated
access-key: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}

- name: start BrowserStack Local
uses: browserstack/github-actions/setup-local@master
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

done

@robwalch robwalch enabled auto-merge (squash) May 6, 2026 00:42
@robwalch robwalch requested a review from tjenkinson May 6, 2026 17:32
@robwalch robwalch force-pushed the task/browser-stack-functional-testing branch from 5ca63a1 to c7f3433 Compare May 6, 2026 17:35
Copy link
Copy Markdown
Member

@tjenkinson tjenkinson left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit:


test_functional_optional:
needs: test_functional_required
needs: [config, test_functional_required]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This won't run if there's no sauce access. But if there's always neither or both this should be fine

@robwalch robwalch merged commit 209d3a0 into master May 8, 2026
16 checks passed
@robwalch robwalch deleted the task/browser-stack-functional-testing branch May 8, 2026 20:05
@tjenkinson tjenkinson requested a review from Copilot May 8, 2026 20:05
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR switches the “optional” macOS functional CI coverage from Sauce Labs to BrowserStack to mitigate Sauce connectivity issues impacting macOS runs.

Changes:

  • Add BrowserStack support (including BrowserStack Local) to the functional test runner.
  • Update CI workflow to run the optional macOS functional matrix on BrowserStack instead of Sauce Labs.
  • Add BrowserStack test scripts/dependency and skip a couple of known-problematic streams on Safari.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test-streams.js Skip specific streams on Safari in functional runs.
tests/functional/auto/setup.js Add BrowserStack + BrowserStack Local support and unify “remote” handling.
package.json Add BrowserStack functional test scripts and browserstack-local dev dependency.
package-lock.json Lockfile updates for browserstack-local and transitive deps.
.github/workflows/build.yml Gate optional functional runs on BrowserStack credentials and switch macOS matrix to BrowserStack Local.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +819 to +839
if (failed && useBrowserStack) {
browser.executeScript(
'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status": "failed", "reason": "Test failed"}}'
);
} else if (failed && useSauce) {
browser.executeScript('sauce:job-result=failed');
}
}
});

after(async function () {
if (useSauce && this.currentTest && this.currentTest.parent) {
if (this.currentTest && this.currentTest.parent) {
const tests = this.currentTest.parent.tests;
if (tests && tests.length && tests.every((test) => test.isPassed())) {
browser.executeScript('sauce:job-result=passed');
if (useBrowserStack) {
browser.executeScript(
'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status": "passed"}}'
);
} else if (useSauce) {
browser.executeScript('sauce:job-result=passed');
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ah yes we should await actually

test_functional_optional:
needs: test_functional_required
needs: [config, test_functional_required]
if: needs.config.outputs.canUseBrowserStack == 'true'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-change-log Do not include the PR in the change log in the release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants