mirror of
https://github.com/SeleniumHQ/selenium.git
synced 2026-03-29 06:30:33 +00:00
* #16612 support downloading large files from Grid I added a new Grid endpoint "/se/files/:name" which allows downloading the file directly, without encoding it to Base64 and adding to Json. This transformation kills the performance and causes OutOfMemory errors for large files (e.g. 256+ MB). NB! Be sure that `toString()` method of objects (HttpRequest, HttpResponse, Contents.Supplier) never returns too long string - it spam debug logs and can cause OOM during debugging. * #16612 extract anonymous implementations of `Contents.Supplier` to separate classes It makes debugging easier. You can easily see what instances they are and where they come from. * #16612 optimize method `RemoteWebDriver.downloadFile()` Instead of reading the whole file to a byte array, just save given InputStream directly to the file. Now it can download large files (I tried 4GB) while consuming very low memory. * #16612 just in case, return `Contents.fromStream` only when downloading files. For json responses, still return `Contents.bytes` which allows re-reading its content multiple times. Just in case. * #16612 fix flaky test: wait until the downloads folder gets deleted After stopping a Grid node, the folder is deleted asynchronously (by cache removal listener). So we need to wait for it in test. * #16612 fix flaky test: wait until the grid node is fully stopped At least on my machine, stopping the node takes some time, and any checks right after `node.stop(sessionId)` often can fail. * #16612 fix flaky test LocalNewSessionQueueTest Gr... This is extremely hard to debug test. After hours of debugging, I came to a conclusion that we just need to increase the timeout. On my machine, `latch` gets decreased after ~1.2 seconds. So 1 second was not enough. * #16612 fix flaky test JdkHttpClientTest I don't know why, but sometimes we receive `HttpTimeoutException` instead of `InterruptedException`. Seems reasonable to consider execution as interrupted in both cases. (?) * #16612 remove unneeded code None of `is.readNBytes` implementations returns -1. It always returns 0 or positive number. * #16612 upload logs in case of test failure * ignore few more IDEA files * #16612 slightly improve logging in `W3CHttpResponseCodec.decode` Don't log the entire response body - just content type and length.
203 lines
6.7 KiB
YAML
203 lines
6.7 KiB
YAML
name: Bazel
|
|
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
name:
|
|
description: Name of workflow
|
|
required: false
|
|
type: string
|
|
run:
|
|
description: Bazel command to run
|
|
required: true
|
|
type: string
|
|
os:
|
|
description: One of ubuntu, windows or macos
|
|
required: false
|
|
type: string
|
|
default: ubuntu
|
|
browser:
|
|
description: One of chrome, firefox, or edge
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
browser-version:
|
|
description: One of stable, latest, latest-beta or latest-devedition
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
caching:
|
|
description: Toggle caching of Bazel
|
|
required: false
|
|
type: boolean
|
|
default: true
|
|
cache-key:
|
|
description: Bazel disk cache key
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
dotnet-version:
|
|
description: Custom DotNet version to install
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
java-version:
|
|
description: Custom Java version to install
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
node-version:
|
|
description: Custom Node version to install
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
python-version:
|
|
description: Custom Python version to use
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
ruby-version:
|
|
description: Custom Ruby version to use
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
nightly-release-files:
|
|
description: Files to upload to the Nightly release tag
|
|
required: false
|
|
type: string
|
|
default: ''
|
|
artifact-name:
|
|
description: Name of artifact to upload
|
|
required: false
|
|
type: string
|
|
default: 'ignore-artifacts'
|
|
|
|
jobs:
|
|
bazel:
|
|
name: ${{ inputs.name }}
|
|
runs-on: ${{ contains(inputs.os, '-') && inputs.os || format('{0}-latest', inputs.os) }}
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SEL_M2_USER: ${{ secrets.SEL_M2_USER }}
|
|
SEL_M2_PASS: ${{ secrets.SEL_M2_PASS }}
|
|
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
|
|
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
|
|
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
SE_AVOID_STATS: true
|
|
steps:
|
|
- name: Checkout source tree
|
|
uses: actions/checkout@v4
|
|
- name: Pull latest changes from head ref for PRs
|
|
if: contains(github.head_ref, 'renovate/')
|
|
run: git pull origin ${{ github.head_ref }}
|
|
- name: Pull latest changes from ref for branch pushes
|
|
if: contains(github.ref, 'renovate/')
|
|
run: git pull origin ${{ github.ref }}
|
|
- name: Free space
|
|
if: inputs.os != 'windows'
|
|
run: ./scripts/github-actions/free-disk-space.sh
|
|
- name: Remove driver directories Windows
|
|
if: inputs.os == 'windows'
|
|
run: |
|
|
rm "$env:ChromeWebDriver" -r -v
|
|
rm "$env:EdgeWebDriver" -r -v
|
|
rm "$env:GeckoWebDriver" -r -v
|
|
- name: Remove driver directories Non-Windows
|
|
if: inputs.os != 'windows'
|
|
run: |
|
|
sudo rm -rf "$CHROMEWEBDRIVER" "$EDGEWEBDRIVER" "$GECKOWEBDRIVER"
|
|
- name: Set Python version
|
|
if: inputs.python-version != ''
|
|
run: echo '${{ inputs.python-version }}' > py/.python-version
|
|
- name: Set Ruby version
|
|
if: inputs.ruby-version != ''
|
|
run: echo '${{ inputs.ruby-version }}' > rb/.ruby-version
|
|
- name: Setup DotNet
|
|
if: inputs.dotnet-version != ''
|
|
uses: actions/setup-dotnet@v4
|
|
with:
|
|
dotnet-version: ${{ inputs.dotnet-version }}
|
|
- name: Setup Java
|
|
if: inputs.java-version != ''
|
|
uses: actions/setup-java@v3
|
|
with:
|
|
java-version: ${{ inputs.java-version }}
|
|
distribution: 'temurin'
|
|
- name: Setup Node
|
|
if: inputs.node-version != ''
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ inputs.node-version }}
|
|
- name: Setup Bazel with caching
|
|
if: inputs.caching
|
|
uses: bazel-contrib/setup-bazel@0.15.0
|
|
with:
|
|
bazelisk-cache: true
|
|
bazelrc: common --color=yes
|
|
# Workaround for long path issues: https://github.com/bazelbuild/bazel/pull/22532
|
|
output-base: ${{ inputs.os == 'windows' && 'D://b' || '' }}
|
|
cache-version: 2
|
|
disk-cache: ${{ inputs.cache-key }}
|
|
external-cache: |
|
|
name: ${{ inputs.cache-key }}
|
|
manifest:
|
|
crates: rust/Cargo.Bazel.lock
|
|
rules_ruby++ruby+ruby: ${{ inputs.os == 'windows' && 'false' || 'rb/.ruby-version' }}
|
|
repository-cache: true
|
|
- name: Setup Bazel without caching
|
|
if: inputs.caching == false
|
|
uses: bazel-contrib/setup-bazel@0.15.0
|
|
with:
|
|
bazelrc: common --color=yes
|
|
- name: Setup curl for Ubuntu
|
|
if: inputs.os == 'ubuntu'
|
|
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
|
|
- name: Setup Fluxbox and Xvfb
|
|
if: inputs.os == 'ubuntu' && inputs.browser != ''
|
|
run: |
|
|
sudo apt-get -y install fluxbox
|
|
Xvfb :99 &
|
|
fluxbox -display :99 &
|
|
echo "DISPLAY=:99" >> "$GITHUB_ENV"
|
|
- name: Set resolution
|
|
if: inputs.os == 'windows' && inputs.browser != ''
|
|
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
|
|
- name: Setup Safari
|
|
if: inputs.browser == 'safari'
|
|
run: sudo safaridriver --enable
|
|
- name: Run Bazel
|
|
run: ${{ inputs.run }}
|
|
- name: Start SSH session
|
|
if: failure() && runner.debug == '1'
|
|
uses: mxschmitt/action-tmate@v3
|
|
with:
|
|
limit-access-to-actor: false
|
|
- name: Release Nightly
|
|
if: inputs.nightly-release-files != ''
|
|
uses: marvinpinto/action-automatic-releases@latest
|
|
with:
|
|
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
automatic_release_tag: "nightly"
|
|
title: "Nightly"
|
|
prerelease: true
|
|
files: ${{ inputs.nightly-release-files }}
|
|
- name: Save changes
|
|
if: ${{ always() && inputs.artifact-name != 'ignore-artifacts' }}
|
|
run: |
|
|
git diff > changes.patch
|
|
- name: "Upload test logs"
|
|
if: failure()
|
|
uses: actions/upload-artifact@v5
|
|
with:
|
|
name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}
|
|
retention-days: 7
|
|
path: |
|
|
**/*.log
|
|
- name: "Upload changes"
|
|
if: ${{ always() && inputs.artifact-name != 'ignore-artifacts' }}
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ inputs.artifact-name }}
|
|
path: changes.patch
|
|
retention-days: 6
|