Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ on:
required: false
type: string
default: ''
download-artifact-name:
description: Name of an artifact to download into the workspace before running
required: false
type: string
default: ''
artifact-name:
description: Name of artifact to upload
required: false
Expand Down Expand Up @@ -146,6 +151,12 @@ jobs:
path: ${{ inputs.cache-name }}
key: ${{ inputs.cache-name }}-
restore-keys: ${{ inputs.cache-name }}-
- name: Download artifact
if: inputs.download-artifact-name != ''
uses: actions/download-artifact@v8
with:
name: ${{ inputs.download-artifact-name }}
continue-on-error: true
- name: Set Python version
if: inputs.python-version != ''
run: echo '${{ inputs.python-version }}' > py/.python-version
Expand Down
20 changes: 13 additions & 7 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: CI - Python

on:
workflow_call:
inputs:
targets:
required: true
type: string
workflow_dispatch:

permissions:
Expand Down Expand Up @@ -67,12 +63,16 @@ jobs:
name: Integration Tests Remote
needs-display: true
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-remote) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > remote-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
$(bazel query "tests(//py:test-remote) intersect set(${{ inputs.targets || '//py/...' }})" --output=label 2>/dev/null)
--target_pattern_file=remote-targets.txt

browser-tests:
name: Browser Tests
Expand All @@ -90,13 +90,17 @@ jobs:
needs-display: true
os: ${{ matrix.os }}
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
{ echo "tests(//py:test-${{ matrix.browser }}) intersect set("; cat bazel-targets-py.txt; echo ")"; } > query.txt;
bazel query --query_file=query.txt --output=label > browser-targets.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 3
--local_test_jobs 1
--skip_incompatible_explicit_targets
$(bazel query "tests(//py:test-${{ matrix.browser }}) intersect set(${{ inputs.targets || '//py/...' }})" --output=label 2>/dev/null)
--target_pattern_file=browser-targets.txt

selenium-manager-tests:
name: Selenium Manager Tests
Expand All @@ -110,12 +114,14 @@ jobs:
needs-display: true
os: ${{ matrix.os }}
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-py.txt ] || echo //py/... > bazel-targets-py.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--local_test_jobs 1
--flaky_test_attempts 3
--pin_browsers=false
--build_tests_only
--skip_incompatible_explicit_targets
--test_tag_filters=se-manager
${{ inputs.targets || '//py/...' }}
--target_pattern_file=bazel-targets-py.txt
8 changes: 3 additions & 5 deletions .github/workflows/ci-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ name: CI - Ruby

on:
workflow_call:
inputs:
targets:
required: true
type: string
workflow_dispatch:
inputs:
smoke:
Expand Down Expand Up @@ -66,7 +62,9 @@ jobs:
needs-display: true
os: ${{ matrix.os }}
rerun-with-debug: true
download-artifact-name: targets
run: >
[ -s bazel-targets-rb.txt ] || echo //rb/... > bazel-targets-rb.txt;
./scripts/github-actions/bazel-test-if-targets.sh
--keep_going
--flaky_test_attempts 2
Expand All @@ -77,7 +75,7 @@ jobs:
--test_env=SE_SKIP_DRIVER_IN_PATH=true
--test_env=SKIP_PENDING=true
--test_tag_filters=unit,os-sensitive,se-manager,skip-rbe
${{ inputs.targets || '//rb/...' }}
--target_pattern_file=bazel-targets-rb.txt

os-tests-full:
name: ${{ matrix.os }}-full
Expand Down
23 changes: 13 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ jobs:
outputs:
java: ${{ steps.read.outputs.java }}
grid: ${{ steps.read.outputs.grid }}
py_targets: ${{ steps.read.outputs.py_targets }}
rb_targets: ${{ steps.read.outputs.rb_targets }}
py: ${{ steps.read.outputs.py }}
rb: ${{ steps.read.outputs.rb }}
dotnet: ${{ steps.read.outputs.dotnet }}
rust: ${{ steps.read.outputs.rust }}
steps:
Expand All @@ -91,9 +91,10 @@ jobs:
process_binding() {
local pattern=$1 tag=$2
local lang_targets
lang_targets=$(echo "$targets" | tr ' ' '\n' | awk -v p="^${pattern}[:/]" '$0 ~ p' | tr '\n' ' ' | sed 's/ *$//')
lang_targets=$(echo "$targets" | tr ' ' '\n' | awk -v p="^${pattern}[:/]" '$0 ~ p')
if [ -n "$lang_targets" ]; then
echo "${tag}_targets=$lang_targets" >> "$GITHUB_OUTPUT"
echo "$tag=true" >> "$GITHUB_OUTPUT"
echo "$lang_targets" > "bazel-targets-${tag}.txt"
fi
}
check_binding "//java" "java"
Expand All @@ -102,6 +103,12 @@ jobs:
check_binding "//rust" "rust"
process_binding "//rb" "rb"
process_binding "//py" "py"
- name: Upload target files
uses: actions/upload-artifact@v7
with:
name: targets
path: bazel-targets-*.txt
if-no-files-found: ignore
Comment thread
titusfortner marked this conversation as resolved.
dotnet:
name: .NET
needs: read-targets
Expand All @@ -124,17 +131,13 @@ jobs:
name: Python
needs: read-targets
uses: ./.github/workflows/ci-python.yml
if: needs.read-targets.outputs.py_targets != ''
with:
targets: ${{ needs.read-targets.outputs.py_targets }}
if: needs.read-targets.outputs.py != ''

ruby:
name: Ruby
needs: read-targets
uses: ./.github/workflows/ci-ruby.yml
if: needs.read-targets.outputs.rb_targets != ''
with:
targets: ${{ needs.read-targets.outputs.rb_targets }}
if: needs.read-targets.outputs.rb != ''

rust:
name: Rust
Expand Down
10 changes: 5 additions & 5 deletions scripts/github-actions/rerun-failures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ fi
if [[ "$RUN_CMD" == *"/ci-build.sh"* ]]; then
base_cmd="bazel test --config=rbe-ci --build_tests_only --keep_going"
else
# Strip the targets (literal `//...` or a trailing `$(...)` query) to get the base command.
base_cmd=$(echo "$RUN_CMD" | sed -E 's| \$\(.*$||; s| //[^ ]*||g')
# Reduce the run command to its bazel invocation
base_cmd=$(sed -E 's/^.*;[[:space:]]*//; s/ --target_pattern_file=[^[:space:]]+//; s| //[^ ]*||g' <<<"$RUN_CMD")
fi
targets=$(tr '\n' ' ' < build/failures/_run1.txt)
echo "Rerunning tests: $base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 $targets"
rerun_cmd="$base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 --target_pattern_file=build/failures/_run1.txt"
echo "Rerunning tests: $rerun_cmd"
set +e
{
$base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 $targets
$rerun_cmd
Comment thread
titusfortner marked this conversation as resolved.
} 2>&1 | tee build/bazel-console2.log
status=$?
set -e
Expand Down