Skip to content

Conversation

@shs96c
Copy link
Member

@shs96c shs96c commented Dec 22, 2025

PR Type

Enhancement


Description

  • Add missing Bazel build configuration for logging tests

  • Define small and large test suites with appropriate dependencies

  • Enable Firefox browser testing for large test suite


Diagram Walkthrough

flowchart LR
  A["logging module"] -- "needs build config" --> B["BUILD.bazel"]
  B -- "defines" --> C["SmallTests suite"]
  B -- "defines" --> D["LargeTests suite"]
  C -- "runs" --> E["unit tests"]
  D -- "runs with" --> F["Firefox browser"]
Loading

File Walkthrough

Relevant files
Build configuration
BUILD.bazel
Add Bazel build configuration for logging tests                   

java/test/org/openqa/selenium/logging/BUILD.bazel

  • Create new Bazel build file for logging test module
  • Define SmallTests suite with LoggingTest and
    PerformanceLoggingMockTest
  • Define LargeTests suite with Firefox browser integration
  • Configure dependencies including JUnit5, Mockito, AssertJ, and Guava
+37/-0   

@selenium-ci selenium-ci added C-java Java Bindings B-build Includes scripting, bazel and CI integrations labels Dec 22, 2025
@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
Extract common deps

Extract common dependencies from the SmallTests and LargeTests suites into a
COMMON_DEPS variable to reduce duplication and improve maintainability.

java/test/org/openqa/selenium/logging/BUILD.bazel [12-36]

-deps = [
+COMMON_DEPS = [
     "//java/src/org/openqa/selenium/remote",
     artifact("org.assertj:assertj-core"),
     artifact("org.junit.jupiter:junit-jupiter-api"),
 ] + JUNIT5_DEPS
 
 ...
 
-deps = [
-    "//java/src/org/openqa/selenium/remote",
+deps = COMMON_DEPS
+
+...
+
+deps = COMMON_DEPS + [
     "//java/test/org/openqa/selenium/testing:annotations",
     "//java/test/org/openqa/selenium/testing:test-base",
     "//java/test/org/openqa/selenium/testing/drivers",
-    artifact("org.assertj:assertj-core"),
-    artifact("org.junit.jupiter:junit-jupiter-api"),
-] + JUNIT5_DEPS
+]

[To ensure code accuracy, apply this suggestion manually]

Suggestion importance[1-10]: 7

__

Why: This suggestion correctly identifies duplicated dependencies and proposes refactoring them into a common variable. This improves code readability and maintainability by reducing redundancy and ensuring consistency between the test suites.

Medium
Refine glob pattern for test sources

*Refine the glob pattern for the LargeTests source files to ["Test.java"] to
prevent inadvertently including non-test helper or utility classes.

java/test/org/openqa/selenium/logging/BUILD.bazel [24-27]

     srcs = glob(
-    ["*.java"],
+    ["*Test.java"],
     exclude = SMALL_TEST_SRCS,
 ),
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: This is a good suggestion for improving the robustness of the build file by making the glob pattern more specific, which will prevent potential future build failures if non-test Java files are added to the directory.

Low
Add public visibility

Add visibility = ["//visibility:public"] to the java_test_suite definitions to
make them accessible to other build targets and CI systems.

java/test/org/openqa/selenium/logging/BUILD.bazel [8-19]

 java_test_suite(
     name = "SmallTests",
+    visibility = ["//visibility:public"],
     size = "small",
     srcs = SMALL_TEST_SRCS,
     deps = [
         "//java/src/org/openqa/selenium/remote",
         artifact("org.assertj:assertj-core"),
         artifact("com.google.guava:guava"),
         artifact("org.junit.jupiter:junit-jupiter-api"),
         artifact("org.mockito:mockito-core"),
     ] + JUNIT5_DEPS,
 )
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: Adding public visibility to test suites is a good practice in Bazel to allow CI systems or other build targets to discover and run them. While the suggestion only shows the change for one test suite, it is a valid improvement for reusability.

Low
  • More

@asolntsev asolntsev added this to the 4.40.0 milestone Dec 22, 2025
@shs96c shs96c merged commit 3e99f76 into SeleniumHQ:trunk Dec 22, 2025
15 checks passed
@shs96c shs96c deleted the missing-build-file branch December 22, 2025 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

B-build Includes scripting, bazel and CI integrations C-java Java Bindings Review effort 2/5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants