Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ci] Test multiple OS with latest Node version #1878

Open
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Open

Conversation

VietND96
Copy link
Member

@VietND96 VietND96 commented Dec 9, 2024

User description

Thanks for contributing to the Selenium IDE!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (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 change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

tests, enhancement


Description

  • Enhanced the CI workflow to test the Selenium IDE on multiple operating systems: Ubuntu, Windows, and macOS.
  • Updated the Node.js version to 'latest' to ensure tests run on the most recent version.
  • Added workflow_dispatch to allow manual triggering of the workflow.
  • Improved the setup process by conditionally installing dependencies on Ubuntu.

Changes walkthrough 📝

Relevant files
Tests
test.yml
Enhance CI to test on multiple OS with latest Node.js       

.github/workflows/test.yml

  • Added support for running tests on multiple operating systems: Ubuntu,
    Windows, and macOS.
  • Updated Node.js version to 'latest' for testing.
  • Included workflow_dispatch to manually trigger the workflow.
  • Improved test setup by conditionally installing dependencies on
    Ubuntu.
  • +16/-7   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    qodo-merge-pro bot commented Dec 9, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Version Control
    Using 'latest' version for both Node.js and pnpm could lead to inconsistent builds. Consider pinning to specific versions for better reproducibility.

    Platform Compatibility
    The xvfb setup is only configured for Ubuntu, but GUI tests may also require special handling on Windows and macOS. Verify test compatibility across all platforms.

    Copy link

    qodo-merge-pro bot commented Dec 9, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    Handle display server requirements differently across operating systems to prevent test failures

    The xvfb setup is only configured for Ubuntu but the job runs on Windows and macOS
    too. Add appropriate display server setup for each OS or skip tests requiring a
    display server on unsupported platforms.

    .github/workflows/test.yml [44-52]

     - name: Install xvfb
    -  if: runner.os == 'ubuntu-latest'
    +  if: runner.os == 'Linux'
       run: |
         sudo apt-get update -y && sudo apt-get install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb
         Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
         echo "DISPLAY=:99" >> $GITHUB_ENV
     - name: Run all tests
    -  run: |
    -    npm run test:ci
    +  if: runner.os == 'Linux'
    +  run: npm run test:ci
    +- name: Run tests (non-Linux)
    +  if: runner.os != 'Linux'
    +  run: npm run test:ci:no-display
    • Apply this suggestion
    Suggestion importance[1-10]: 10

    Why: Critical suggestion that addresses potential test failures on Windows and macOS by properly handling display server requirements across different operating systems and providing a fallback test command.

    10
    General
    Using specific version ranges instead of 'latest' ensures consistent and predictable CI builds

    Using 'latest' for Node.js version can lead to unexpected failures when new versions
    are released. Specify a stable LTS version range instead, like '20.x'.

    .github/workflows/test.yml [36-39]

     - uses: actions/setup-node@v3
       with:
    -    node-version: 'latest'
    +    node-version: '20.x'
         cache: 'pnpm'
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Using 'latest' for Node.js version can lead to breaking changes and inconsistent builds. Specifying a stable LTS version like '20.x' is crucial for CI/CD reliability.

    9
    Using fixed package manager versions ensures build reproducibility across different environments

    Similarly to Node.js, using 'latest' for pnpm version can cause unexpected issues.
    Specify a fixed version for reproducible builds.

    .github/workflows/test.yml [33-35]

     - uses: pnpm/action-setup@v2
       with:
    -    version: 'latest'
    +    version: '8.11.0'
    • Apply this suggestion
    Suggestion importance[1-10]: 9

    Why: Using 'latest' for pnpm version can cause unexpected build failures. Reverting to a fixed version (8.11.0) ensures consistent dependency management across environments.

    9

    💡 Need additional feedback ? start a PR chat

    Copy link

    qodo-merge-pro bot commented Dec 9, 2024

    CI Failure Feedback 🧐

    (Checks updated until commit a078dd9)

    Action: test (windows-latest)

    Failed stage: [❌]

    Failure summary:

    The action failed due to multiple issues:

  • There were several warnings indicating that the system failed to create binaries at specified paths.
    This was due to missing files, as indicated by the ENOENT: no such file or directory error.
  • There were critical dependency warnings during the Webpack build process, indicating that some
    dependencies could not be resolved statically.
  • A deprecation warning was issued for the punycode module, suggesting the use of a userland
    alternative.
  • The operation was ultimately canceled, as indicated by the error message The operation was canceled.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Microsoft Windows Server 2022
    ...
    
    187:  .../node_modules/@bazel/typescript postinstall$ node npm_version_check.js
    188:  .../node_modules/@bazel/hide-bazel-files postinstall$ node ./index.js
    189:  .../node_modules/electron postinstall$ node install.js
    190:  .../node_modules/@bazel/hide-bazel-files postinstall: Done
    191:  .../node_modules/@bazel/typescript postinstall: Done
    192:  .../node_modules/electron-chromedriver install: Done
    193:  .../node_modules/electron postinstall: Done
    194:  .../node_modules/electron postinstall: Done
    195:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-commons\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    196:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-nunit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    197:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-xunit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    198:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-java-junit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    199:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-javascript-mocha\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    200:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-ruby-rspec\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    201:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-python-pytest\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    202:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\selenium-ide\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    203:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\side-example-suite\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-code-export\dist\bin.js.EXE'
    204:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\node_modules\.bin\selenium-side-runner. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\node_modules\selenium-side-runner\dist\bin.js.EXE'
    205:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-commons\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-commons\node_modules\side-code-export\dist\bin.js.EXE'
    206:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-nunit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-nunit\node_modules\side-code-export\dist\bin.js.EXE'
    207:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-xunit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-csharp-xunit\node_modules\side-code-export\dist\bin.js.EXE'
    208:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-java-junit\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-java-junit\node_modules\side-code-export\dist\bin.js.EXE'
    209:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-javascript-mocha\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-javascript-mocha\node_modules\side-code-export\dist\bin.js.EXE'
    210:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-python-pytest\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-python-pytest\node_modules\side-code-export\dist\bin.js.EXE'
    211:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\code-export-ruby-rspec\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\code-export-ruby-rspec\node_modules\side-code-export\dist\bin.js.EXE'
    212:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\selenium-ide\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\selenium-ide\node_modules\side-code-export\dist\bin.js.EXE'
    213:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\packages\side-example-suite\node_modules\.bin\side-code-export. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\packages\side-example-suite\node_modules\side-code-export\dist\bin.js.EXE'
    214:  WARN  Failed to create bin at D:\a\selenium-ide\selenium-ide\node_modules\.bin\selenium-side-runner. ENOENT: no such file or directory, stat 'D:\a\selenium-ide\selenium-ide\node_modules\selenium-side-runner\dist\bin.js.EXE'
    ...
    
    312:  packages/selenium-ide build:webpack:  @ ./src/browser/windows/Splash/renderer.tsx 39:31-59
    313:  packages/selenium-ide build:webpack: �[1m�[33mWARNING�[39m�[22m in �[1m../side-model/dist/I18N/index.js�[39m�[22m �[1m�[32m36:82-92�[39m�[22m
    314:  packages/selenium-ide build:webpack: �[1mCritical dependency: the request of a dependency is an expression�[39m�[22m
    315:  packages/selenium-ide build:webpack:  @ ../side-model/dist/index.js 38:13-30
    316:  packages/selenium-ide build:webpack:  @ ./src/browser/I18N/en/index.ts 4:21-54
    317:  packages/selenium-ide build:webpack:  @ ./src/browser/I18N/keys.ts 6:29-44
    318:  packages/selenium-ide build:webpack:  @ ./src/browser/windows/Splash/renderer.tsx 39:31-59
    319:  packages/selenium-ide build:webpack: 2 warnings have detailed information that is not shown.
    320:  packages/selenium-ide build:webpack: Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
    ...
    
    352:  packages/selenium-ide build:webpack: �[1mCritical dependency: the request of a dependency is an expression�[39m�[22m
    353:  packages/selenium-ide build:webpack:  @ ../side-model/dist/index.js 38:13-30
    354:  packages/selenium-ide build:webpack:  @ ../side-api/dist/models/state/index.js 18:21-54
    355:  packages/selenium-ide build:webpack:  @ ../side-api/dist/models/index.js 18:13-31
    356:  packages/selenium-ide build:webpack:  @ ../side-api/dist/index.js 49:13-32
    357:  packages/selenium-ide build:webpack:  @ ./src/browser/api/index.ts 7:19-50 19:17-48
    358:  packages/selenium-ide build:webpack:  @ ./src/browser/windows/PlaybackWindow/preload.ts 6:30-52
    359:  packages/selenium-ide build:webpack: 2 warnings have detailed information that is not shown.
    360:  packages/selenium-ide build:webpack: Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
    ...
    
    387:  packages/selenium-ide build:webpack: �[1mCritical dependency: the request of a dependency is an expression�[39m�[22m
    388:  packages/selenium-ide build:webpack:  @ ../side-model/dist/index.js 38:13-30
    389:  packages/selenium-ide build:webpack:  @ ../side-api/dist/models/state/index.js 18:21-54
    390:  packages/selenium-ide build:webpack:  @ ../side-api/dist/models/index.js 18:13-31
    391:  packages/selenium-ide build:webpack:  @ ../side-api/dist/index.js 49:13-32
    392:  packages/selenium-ide build:webpack:  @ ./src/browser/api/bidi.ts 7:19-50 19:17-48
    393:  packages/selenium-ide build:webpack:  @ ./src/browser/windows/PlaybackWindowBidi/preload.ts 6:31-58
    394:  packages/selenium-ide build:webpack: 2 warnings have detailed information that is not shown.
    395:  packages/selenium-ide build:webpack: Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
    ...
    
    457:  packages/selenium-ide build:webpack: �[1m�[33mWARNING�[39m�[22m in �[1m./src/main/session/controllers/System/index.ts�[39m�[22m �[1m�[32m77:114-124�[39m�[22m
    458:  packages/selenium-ide build:webpack: �[1mCritical dependency: the request of a dependency is an expression�[39m�[22m
    459:  packages/selenium-ide build:webpack:  @ ./src/main/session/index.ts 20:33-64
    460:  packages/selenium-ide build:webpack:  @ ./src/main/index.ts 11:34-54
    461:  packages/selenium-ide build:webpack: �[1m�[33mWARNING�[39m�[22m in �[1m../../node_modules/.pnpm/[email protected]/node_modules/v8-compile-cache/v8-compile-cache.js�[39m�[22m �[1m�[32m153:42-49�[39m�[22m
    462:  packages/selenium-ide build:webpack: �[1mCritical dependency: require function is used in a way in which dependencies cannot be statically extracted�[39m�[22m
    463:  packages/selenium-ide build:webpack:  @ ./src/main/index.ts 6:0-27
    464:  packages/selenium-ide build:webpack: 6 warnings have detailed information that is not shown.
    465:  packages/selenium-ide build:webpack: Use 'stats.errorDetails: true' resp. '--stats-error-details' to show it.
    ...
    
    478:  Command 'http-server -p 8080 ./packages/side-testkit/fixtures/static' output success message 'Available on'
    479:  Running main command npm run pretest && npm run test:jest:core && npm run test:side-runner:ci
    480:  > pretest
    481:  > cd packages/webdriver-testkit && npm run download-drivers
    482:  > @seleniumhq/[email protected] download-drivers
    483:  > node ./scripts/download-drivers.js
    484:  (node:6132) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    485:  (Use `node --trace-deprecation ...` to show where the warning was created)
    486:  ##[error]The operation was canceled.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    @VietND96 VietND96 force-pushed the test-ci branch 2 times, most recently from c506aab to 7038e68 Compare December 9, 2024 16:56
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant