Skip to content

Copilot/fix GitHub actions job#231

Open
aleks-pro wants to merge 13 commits into
masterfrom
copilot/fix-github-actions-job
Open

Copilot/fix GitHub actions job#231
aleks-pro wants to merge 13 commits into
masterfrom
copilot/fix-github-actions-job

Conversation

@aleks-pro
Copy link
Copy Markdown
Contributor

@aleks-pro aleks-pro commented May 13, 2026

There are fixes in test.yml workflow. To pass tests you need to dispatch the worlflow againts copilot/fix-github-actions-job branch. You can check passed tests in this run https://github.com/DevExpress/testcafe-browser-provider-browserstack/actions/runs/25912877379

Copilot AI and others added 13 commits May 12, 2026 13:49
The build@main action already uploads the artifact as 'npm'.
The explicit upload-artifact step found no .builds/*.tgz files so no
artifact was created, causing the download in the test job to fail with
'Artifact not found for name: npm-package'.

- Remove redundant upload-artifact step from build job
- Download artifact as 'npm' (matching what build@main uploads)
- Bump download-artifact to v4 (latest major)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The test-npm@main action internally calls load-artifacts-npm@main which
already downloads the 'npm' artifact. The explicit download step was
causing a path conflict: it placed files at .builds/.builds/{name}.tgz
instead of .builds/{name}.tgz, breaking the extraction step inside
load-artifacts-npm@main.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
actions/github-script@v3 in detect-package-metadata@main relies on the
deprecated ::set-output:: workflow command which GitHub has disabled on
runners. This causes pack-name and version outputs to be silently empty,
making the tar extraction attempt '.builds/-.tgz' and fail with exit
code 2.

Replace test-npm@main with equivalent inline steps that use a bash
node one-liner with GITHUB_OUTPUT to safely read package metadata.
Also pins download-artifact to v4 (addresses the original CVE intent)
and moves env vars to the specific run step.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Instead of constructing the filename from pack-name/version outputs,
glob for the first .tgz in .builds/. This is more robust and avoids any
potential issues with output variable resolution.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…st to build

npm run test (gulp test) already runs the build step first, so there is
no need to download and extract the packed artifact from the build job.
The test job now simply checks out, installs deps, and runs tests.

This also eliminates the broken detect-package-metadata/load-artifacts-npm
dependency chain from testcafe-build-system which fails due to
actions/github-script@v3 using the deprecated ::set-output:: command.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace iPhone SE 2020@13 (iOS 13 no longer available in BrowserStack
JS Testing API) with iPhone SE 2022@15 in REST_BROWSER_NAMES and
browserNameResults validation.

Also proactively replace iPhone 7@10 (iOS 10, 2016) with iPhone 14@16
in AUTOMATE_BROWSER_NAMES to prevent the same issue in Automate mode
tests.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace .filter() arrow callback (4 nesting levels) with a for-of loop
to stay within the max-nested-callbacks limit of 3.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
iPhone XR@15 is no longer available in BrowserStack JS Testing API.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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

Updates CI and associated tests to accommodate changes in the BrowserStack browser/device catalog and to fix the GitHub Actions test job execution.

Changes:

  • Updated expected iOS device entries in the BrowserStack browser list mocha tests and improved the assertion output to report missing items explicitly.
  • Adjusted the GitHub Actions test job to install dependencies and run npm run test directly (instead of using the shared test-npm action).
  • Updated browser-name validation expectations to reflect the renamed iPhone SE model.

Reviewed changes

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

File Description
test/mocha/browser-names-test.js Updates expected device names/versions and improves diagnostics when expected entries are missing from the BrowserStack list.
.github/workflows/test.yml Reworks the test job to run npm ci and execute the repo’s test script directly.
Comments suppressed due to low confidence (1)

test/mocha/browser-names-test.js:75

  • The first test now depends on iPhone 12@14 / iPhone 14@16 being present in the returned list, but the browser-name validation table below only validates iPhone SE 2022 for iOS. To keep coverage aligned with the newly added expectations, consider adding the new iPhone names (and/or their capability forms with @ versions) to browserNameResults so isValidBrowserName is exercised for them too.
            'edge':               true,
            'ie@9.0:Windows 7':   true,
            'ie@10.0:Windows 8':  true,
            'ie@11.0:Windows 10': true,
            'iPhone SE 2022':     true,
            'Google Pixel 7':     true,
            'ie@5.0':             false,

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

Comment on lines 22 to 32
const REST_BROWSER_NAMES = [
'chrome@51.0:OS X Mavericks',
'firefox@45.0:OS X Yosemite',
'safari@9.1:OS X El Capitan',
'ie@9.0:Windows 7',
'ie@10.0:Windows 8',
'ie@11.0:Windows 8.1',
'edge@15.0:Windows 10',
'iPhone SE 2020@13',
'iPhone XR@15',
'iPhone SE 2022@15',
'iPhone 12@14',
'Google Pixel 7@13.0'

- name: Install dependencies
shell: bash
run: npm ci --legacy-peer-deps
Comment on lines +28 to +33
- name: Run tests
shell: bash
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
with:
task: test
run: npm run test
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.

3 participants