File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,10 @@ name: CI - Python
22
33on :
44 workflow_call :
5+ inputs :
6+ targets :
7+ required : true
8+ type : string
59 workflow_dispatch :
610
711permissions :
@@ -10,6 +14,7 @@ permissions:
1014jobs :
1115 build :
1216 name : Build
17+ if : github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
1318 uses : ./.github/workflows/bazel.yml
1419 with :
1520 name : Build
4247
4348 unit-tests :
4449 name : Unit Tests
45- needs : build
50+ if : github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
4651 uses : ./.github/workflows/bazel.yml
4752 strategy :
4853 fail-fast : false
@@ -57,18 +62,20 @@ jobs:
5762
5863 remote-tests :
5964 name : Remote Tests
60- needs : build
6165 uses : ./.github/workflows/bazel.yml
6266 with :
6367 name : Integration Tests Remote
6468 needs-display : true
6569 rerun-with-debug : true
66- run : |
67- bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-remote
70+ run : >
71+ ./scripts/github-actions/bazel-test-if-targets.sh
72+ --keep_going
73+ --flaky_test_attempts 3
74+ --local_test_jobs 1
75+ $(bazel query "tests(//py:test-remote) intersect set(${{ inputs.targets || '//py/...' }})" --output=label 2>/dev/null)
6876
6977 browser-tests :
7078 name : Browser Tests
71- needs : build
7279 uses : ./.github/workflows/bazel.yml
7380 strategy :
7481 fail-fast : false
8390 needs-display : true
8491 os : ${{ matrix.os }}
8592 rerun-with-debug : true
86- run : |
87- bazel test --local_test_jobs 1 --flaky_test_attempts 3 //py:test-${{ matrix.browser }}
93+ run : >
94+ ./scripts/github-actions/bazel-test-if-targets.sh
95+ --keep_going
96+ --flaky_test_attempts 3
97+ --local_test_jobs 1
98+ --skip_incompatible_explicit_targets
99+ $(bazel query "tests(//py:test-${{ matrix.browser }}) intersect set(${{ inputs.targets || '//py/...' }})" --output=label 2>/dev/null)
Original file line number Diff line number Diff line change 6464 outputs :
6565 java : ${{ steps.read.outputs.java }}
6666 grid : ${{ steps.read.outputs.grid }}
67- py : ${{ steps.read.outputs.py }}
67+ py_targets : ${{ steps.read.outputs.py_targets }}
6868 rb_targets : ${{ steps.read.outputs.rb_targets }}
6969 dotnet : ${{ steps.read.outputs.dotnet }}
7070 rust : ${{ steps.read.outputs.rust }}
@@ -96,10 +96,10 @@ jobs:
9696 }
9797 check_binding "//java" "java"
9898 check_binding "openqa/selenium/grid" "grid"
99- check_binding "//py" "py"
10099 check_binding "//dotnet" "dotnet"
101100 check_binding "//rust" "rust"
102101 process_binding "//rb" "rb"
102+ process_binding "//py" "py"
103103 dotnet :
104104 name : .NET
105105 needs : read-targets
@@ -122,7 +122,9 @@ jobs:
122122 name : Python
123123 needs : read-targets
124124 uses : ./.github/workflows/ci-python.yml
125- if : needs.read-targets.outputs.py != ''
125+ if : needs.read-targets.outputs.py_targets != ''
126+ with :
127+ targets : ${{ needs.read-targets.outputs.py_targets }}
126128
127129 ruby :
128130 name : Ruby
Original file line number Diff line number Diff line change 2222if [[ " $RUN_CMD " == * " /ci-build.sh" * ]]; then
2323 base_cmd=" bazel test --config=rbe-ci --build_tests_only --keep_going"
2424else
25- base_cmd=$( echo " $RUN_CMD " | sed ' s| //[^ ]*||g' )
25+ # Strip the targets (literal `//...` or a trailing `$(...)` query) to get the base command.
26+ base_cmd=$( echo " $RUN_CMD " | sed -E ' s| \$\(.*$||; s| //[^ ]*||g' )
2627fi
2728targets=$( tr ' \n' ' ' < build/failures/_run1.txt)
2829echo " Rerunning tests: $base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 $targets "
You can’t perform that action at this time.
0 commit comments