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
38 changes: 28 additions & 10 deletions .github/workflows/ci-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: CI - Python

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

permissions:
Expand All @@ -10,6 +14,7 @@ permissions:
jobs:
build:
name: Build
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
Comment thread
titusfortner marked this conversation as resolved.
uses: ./.github/workflows/bazel.yml
with:
name: Build
Expand Down Expand Up @@ -42,7 +47,7 @@ jobs:

unit-tests:
name: Unit Tests
needs: build
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/bazel.yml
strategy:
fail-fast: false
Expand All @@ -57,18 +62,20 @@ jobs:

remote-tests:
name: Remote Tests
needs: build
uses: ./.github/workflows/bazel.yml
with:
name: Integration Tests Remote
needs-display: true
rerun-with-debug: true
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-remote
run: >
./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)
Comment thread
titusfortner marked this conversation as resolved.
Comment thread
titusfortner marked this conversation as resolved.
Comment thread
titusfortner marked this conversation as resolved.

browser-tests:
name: Browser Tests
needs: build
uses: ./.github/workflows/bazel.yml
strategy:
fail-fast: false
Expand All @@ -83,12 +90,16 @@ jobs:
needs-display: true
os: ${{ matrix.os }}
rerun-with-debug: true
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-${{ matrix.browser }}
run: >
./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)
Comment thread
titusfortner marked this conversation as resolved.

selenium-manager-tests:
name: Selenium Manager Tests
needs: build
uses: ./.github/workflows/bazel.yml
strategy:
fail-fast: false
Expand All @@ -99,5 +110,12 @@ jobs:
needs-display: true
os: ${{ matrix.os }}
rerun-with-debug: true
run: |
bazel test --local_test_jobs 1 --flaky_test_attempts 3 --pin_browsers=false --build_tests_only --test_tag_filters=se-manager //py/...
run: >
./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/...' }}
Comment thread
titusfortner marked this conversation as resolved.
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ jobs:
outputs:
java: ${{ steps.read.outputs.java }}
grid: ${{ steps.read.outputs.grid }}
py: ${{ steps.read.outputs.py }}
py_targets: ${{ steps.read.outputs.py_targets }}
rb_targets: ${{ steps.read.outputs.rb_targets }}
dotnet: ${{ steps.read.outputs.dotnet }}
rust: ${{ steps.read.outputs.rust }}
Expand Down Expand Up @@ -98,10 +98,10 @@ jobs:
}
check_binding "//java" "java"
check_binding "openqa/selenium/grid" "grid"
check_binding "//py" "py"
check_binding "//dotnet" "dotnet"
check_binding "//rust" "rust"
process_binding "//rb" "rb"
process_binding "//py" "py"
Comment thread
titusfortner marked this conversation as resolved.
dotnet:
name: .NET
needs: read-targets
Expand All @@ -124,7 +124,9 @@ jobs:
name: Python
needs: read-targets
uses: ./.github/workflows/ci-python.yml
if: needs.read-targets.outputs.py != ''
if: needs.read-targets.outputs.py_targets != ''
with:
targets: ${{ needs.read-targets.outputs.py_targets }}

ruby:
name: Ruby
Expand Down
3 changes: 2 additions & 1 deletion scripts/github-actions/rerun-failures.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ fi
if [[ "$RUN_CMD" == *"/ci-build.sh"* ]]; then
base_cmd="bazel test --config=rbe-ci --build_tests_only --keep_going"
else
base_cmd=$(echo "$RUN_CMD" | sed 's| //[^ ]*||g')
# Strip the targets (literal `//...` or a trailing `$(...)` query) to get the base command.
base_cmd=$(echo "$RUN_CMD" | sed -E 's| \$\(.*$||; s| //[^ ]*||g')
Comment thread
titusfortner marked this conversation as resolved.
fi
targets=$(tr '\n' ' ' < build/failures/_run1.txt)
echo "Rerunning tests: $base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 $targets"
Expand Down