Copilot/fix GitHub actions job#231
Open
aleks-pro wants to merge 13 commits into
Open
Conversation
Agent-Logs-Url: https://github.com/DevExpress/testcafe-browser-provider-browserstack/sessions/401193be-b017-479a-b361-92fab77525ca Co-authored-by: aleks-pro <14822473+aleks-pro@users.noreply.github.com>
…ile Write vulnerability Agent-Logs-Url: https://github.com/DevExpress/testcafe-browser-provider-browserstack/sessions/401193be-b017-479a-b361-92fab77525ca Co-authored-by: aleks-pro <14822473+aleks-pro@users.noreply.github.com>
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>
There was a problem hiding this comment.
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
testjob to install dependencies and runnpm run testdirectly (instead of using the sharedtest-npmaction). - 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@16being present in the returned list, but the browser-name validation table below only validatesiPhone SE 2022for iOS. To keep coverage aligned with the newly added expectations, consider adding the new iPhone names (and/or their capability forms with@versions) tobrowserNameResultssoisValidBrowserNameis 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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