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
36 changes: 34 additions & 2 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ on:
required: false
type: string
default: 'ignore-artifacts'
rerun-with-debug:
description: Rerun failing tests with debugging enabled
required: false
type: boolean
default: false

jobs:
bazel:
Expand Down Expand Up @@ -181,7 +186,33 @@ jobs:
if: inputs.browser == 'safari'
run: sudo safaridriver --enable
- name: Run Bazel
run: ${{ inputs.run }}
shell: bash
env:
MSYS_NO_PATHCONV: 1
MSYS2_ARG_CONV_EXCL: "*"
run: |
mkdir -p build
set +e
${{ inputs.run }} 2>&1 | tee build/bazel-console.log
exit ${PIPESTATUS[0]}
- name: Parse Bazel log for failures
if: always()
shell: bash
run: |
awk '
/PASSED in/ {n=0; delete a; next}
/FAILED in/ {a[++n]=$1}
END {for (i=1; i<=n; i++) print a[i]}
' build/bazel-console.log > build/bazel-failures.txt
- name: Rerun failures with debug
if: failure() && inputs.rerun-with-debug
shell: bash
run: |
if [ -s build/bazel-failures.txt ]; then
base_cmd=$(echo "${{ inputs.run }}" | sed 's| //[^ ]*||g')
targets=$(cat build/bazel-failures.txt | tr '\n' ' ')
$base_cmd --test_env=SE_DEBUG=true --flaky_test_attempts=1 $targets
fi
- name: Start SSH session
if: failure() && runner.debug == '1'
uses: mxschmitt/action-tmate@v3
Expand All @@ -207,7 +238,8 @@ jobs:
name: test-logs-${{ inputs.os }}-${{ inputs.name }}-${{ inputs.browser }}
retention-days: 7
path: |
**/*.log
bazel-testlogs/**/*.log
build/bazel-failures.txt
- name: "Upload changes"
if: ${{ always() && inputs.artifact-name != 'ignore-artifacts' }}
uses: actions/upload-artifact@v4
Expand Down
37 changes: 20 additions & 17 deletions .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,15 @@ jobs:
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest `
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest `
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest `
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest `
//java/test/org/openqa/selenium/remote:RemoteWebDriverBuilderTest `
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest `
//java/test/org/openqa/selenium/devtools:NetworkInterceptorRestTest
run: >
bazel test --flaky_test_attempts 3
//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverBuilderTest
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
//java/test/org/openqa/selenium/devtools:NetworkInterceptorRestTest

browser-tests-macos:
name: Browser Tests
Expand All @@ -47,13 +48,14 @@ jobs:
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote \
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest \
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest \
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest \
//java/test/org/openqa/selenium/remote:RemoteWebDriverBuilderTest \
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
run: >
bazel test --flaky_test_attempts 3
//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
//java/test/org/openqa/selenium/remote:RemoteWebDriverBuilderTest
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest

remote-tests:
name: Remote Tests
Expand All @@ -70,5 +72,6 @@ jobs:
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
run: >
bazel test --flaky_test_attempts 3
//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
6 changes: 3 additions & 3 deletions java/src/org/openqa/selenium/grid/graphql/SessionData.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.openqa.selenium.grid.distributor.Distributor;
import org.openqa.selenium.internal.Require;

public class SessionData implements DataFetcher {
public class SessionData implements DataFetcher<org.openqa.selenium.grid.graphql.Session> {

private final Distributor distributor;

Expand All @@ -34,10 +34,10 @@ public SessionData(Distributor distributor) {
}

@Override
public Object get(DataFetchingEnvironment environment) {
public org.openqa.selenium.grid.graphql.Session get(DataFetchingEnvironment environment) {
String sessionId = environment.getArgument("id");

if (sessionId.isEmpty()) {
if (sessionId == null || sessionId.isEmpty()) {
throw new SessionNotFoundException("Session id is empty. A valid session id is required.");
}

Expand Down
Loading
Loading