You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Several tests contain 'raise' statements that are expected to fail, but the test framework might not properly handle these as expected failures. Verify that the test framework correctly interprets these as expected failures rather than actual test failures.
raise'This code is executed but expected to fail'endit'does not guard when value matches',only: {condition: :guarded}do# passendenddescribe'#except'doit'guards when value matches and test fails',except: {condition: :guarded}doraise'This code is executed but expected to fail'endit'does not guard when value does not match and test passes',except: {condition: :not_guarded}do# passendendendcontext'when multiple guards'doit'guards if neither only nor except match and test fails',except: {condition: :not_guarded},only: {condition: :not_guarded}doraise'This code is executed but expected to fail'endit'guards if both only and except match',except: {condition: :guarded},only: {condition: :guarded}doraise'This code is executed but expected to fail'endit'guards if except matches and only does not',except: {condition: :guarded},only: {condition: :not_guarded}doraise'This code is executed but expected to fail'endit'does not guard if only matches and except does not',except: {condition: :not_guarded},only: {condition: :guarded}do# passendit'gives correct reason',except: [{condition: :guarded,reason: 'bug1'},{condition: :not_guarded,reason: 'bug2'}]doraise'This code is executed but expected to fail'end
*The send(results) call is unsafe as it will execute any method name returned in results. This could lead to arbitrary method execution. Consider using a more explicit approach with a whitelist of allowed methods.
before do |example|
guards = described_class.new(example, bug_tracker: 'https://github.com/SeleniumHQ/selenium/issues')
guards.add_condition(:condition, :guarded)
results = guards.disposition
- send(*results) if results+ if results && [:skip, :pending].include?(results.first)+ send(*results)+ end
end
Apply / Chat
Suggestion importance[1-10]: 9
__
Why: The suggestion addresses a significant security vulnerability by restricting the send(*results) call to only allow specific safe methods (skip and pending). Without this restriction, the code could execute arbitrary methods, potentially leading to security issues.
The action failed during the Ruby linting process with Bazel build errors:
1. Missing target error: The build system could not find the target guard in the package rb/spec/integration/selenium/webdriver. 2. Specifically, the error occurred because the file /home/runner/work/selenium/selenium/rb/spec/integration/selenium/webdriver/BUILD.bazel does not declare a target named 'guard'. 3. This missing target is referenced in /home/runner/work/selenium/selenium/rb/spec/BUILD.bazel at line 13. 4. The analysis of target '//rb:lint' failed, causing the entire build to abort.
Relevant error logs:
1: ##[group]Operating System2: Ubuntu
...
925: Package 'php-sql-formatter' is not installed, so not removed926: Package 'php8.3-ssh2' is not installed, so not removed927: Package 'php-ssh2-all-dev' is not installed, so not removed928: Package 'php8.3-stomp' is not installed, so not removed929: Package 'php-stomp-all-dev' is not installed, so not removed930: Package 'php-swiftmailer' is not installed, so not removed931: Package 'php-symfony' is not installed, so not removed932: Package 'php-symfony-asset' is not installed, so not removed933: Package 'php-symfony-asset-mapper' is not installed, so not removed934: Package 'php-symfony-browser-kit' is not installed, so not removed935: Package 'php-symfony-clock' is not installed, so not removed936: Package 'php-symfony-debug-bundle' is not installed, so not removed937: Package 'php-symfony-doctrine-bridge' is not installed, so not removed938: Package 'php-symfony-dom-crawler' is not installed, so not removed939: Package 'php-symfony-dotenv' is not installed, so not removed940: Package 'php-symfony-error-handler' is not installed, so not removed941: Package 'php-symfony-event-dispatcher' is not installed, so not removed
...
1119: Package 'php-twig-html-extra' is not installed, so not removed1120: Package 'php-twig-i18n-extension' is not installed, so not removed1121: Package 'php-twig-inky-extra' is not installed, so not removed1122: Package 'php-twig-intl-extra' is not installed, so not removed1123: Package 'php-twig-markdown-extra' is not installed, so not removed1124: Package 'php-twig-string-extra' is not installed, so not removed1125: Package 'php8.3-uopz' is not installed, so not removed1126: Package 'php-uopz-all-dev' is not installed, so not removed1127: Package 'php8.3-uploadprogress' is not installed, so not removed1128: Package 'php-uploadprogress-all-dev' is not installed, so not removed1129: Package 'php8.3-uuid' is not installed, so not removed1130: Package 'php-uuid-all-dev' is not installed, so not removed1131: Package 'php-validate' is not installed, so not removed1132: Package 'php-vlucas-phpdotenv' is not installed, so not removed1133: Package 'php-voku-portable-ascii' is not installed, so not removed1134: Package 'php-wmerrors' is not installed, so not removed1135: Package 'php-xdebug-all-dev' is not installed, so not removed
...
1861: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/example/headless.js 4ms (unchanged)1862: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/example/logging.js 7ms (unchanged)1863: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/firefox.js 41ms (unchanged)1864: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/http/index.js 19ms (unchanged)1865: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/http/util.js 10ms (unchanged)1866: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/ie.js 15ms (unchanged)1867: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/index.js 24ms (unchanged)1868: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/io/exec.js 7ms (unchanged)1869: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/io/index.js 13ms (unchanged)1870: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/io/zip.js 8ms (unchanged)1871: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/jsdoc_conf.json 2ms (unchanged)1872: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/atoms/make-atoms-module.js 2ms (unchanged)1873: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/by.js 17ms (unchanged)1874: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/capabilities.js 20ms (unchanged)1875: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/command.js 10ms (unchanged)1876: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/error.js 27ms (unchanged)1877: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/lib/fedcm/account.js 3ms (unchanged)
...
1946: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/fingerprint_test.js 3ms (unchanged)1947: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/firefox/addon_test.js 5ms (unchanged)1948: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/firefox/contextSwitching_test.js 3ms (unchanged)1949: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/firefox/full_page_screenshot_test.js 3ms (unchanged)1950: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/firefox/options_test.js 10ms (unchanged)1951: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/frame_test.js 7ms (unchanged)1952: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/http/http_test.js 14ms (unchanged)1953: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/http/util_test.js 7ms (unchanged)1954: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/ie/options_test.js 5ms (unchanged)1955: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/io/io_test.js 29ms (unchanged)1956: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/io/zip_test.js 9ms (unchanged)1957: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/api_test.js 2ms (unchanged)1958: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/by_test.js 8ms (unchanged)1959: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/capabilities_test.js 13ms (unchanged)1960: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/credentials_test.js 7ms (unchanged)1961: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/error_test.js 13ms (unchanged)1962: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/lib/form_submit_test.js 3ms (unchanged)
...
1983: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/select_test.js 12ms (unchanged)1984: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/stale_element_test.js 4ms (unchanged)1985: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/upload_test.js 9ms (unchanged)1986: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/virtualAuthenticator_test.js 17ms (unchanged)1987: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/webComponent_test.js 5ms (unchanged)1988: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/test/window_test.js 12ms (unchanged)1989: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/testing/index.js 14ms (unchanged)1990: ../../../../../../../../../../work/selenium/selenium/javascript/selenium-webdriver/tools/init_jasmine.js 1ms (unchanged)1991: �[0m- Ruby1992: rubocop1993: �[32mComputing main repo mapping:�[0m 1994: �[32mLoading:�[0m 1995: �[32mLoading:�[0m 0 packages loaded1996: �[32mAnalyzing:�[0m target //rb:lint (1 packages loaded, 0 targets configured)1997: �[32mAnalyzing:�[0m target //rb:lint (1 packages loaded, 0 targets configured)1998: �[31m�[1mERROR: �[0m/home/runner/work/selenium/selenium/rb/spec/integration/selenium/webdriver/BUILD.bazel: no such target '//rb/spec/integration/selenium/webdriver:guard': target 'guard' not declared in package 'rb/spec/integration/selenium/webdriver' defined by /home/runner/work/selenium/selenium/rb/spec/integration/selenium/webdriver/BUILD.bazel1999: �[31m�[1mERROR: �[0m/home/runner/work/selenium/selenium/rb/spec/BUILD.bazel:13:11: no such target '//rb/spec/integration/selenium/webdriver:guard': target 'guard' not declared in package 'rb/spec/integration/selenium/webdriver' defined by /home/runner/work/selenium/selenium/rb/spec/integration/selenium/webdriver/BUILD.bazel and referenced by '//rb/spec:spec'2000: �[31m�[1mERROR: �[0mAnalysis of target '//rb:lint' failed; build aborted: Analysis failed2001: �[32mINFO: �[0mElapsed time: 0.543s, Critical Path: 0.04s2002: �[32mINFO: �[0m1 process: 1 internal.2003: �[31m�[1mERROR: �[0mBuild did NOT complete successfully2004: �[31m�[1mFAILED:�[0m 2005: �[31m�[1mERROR: �[0mBuild failed. Not running target2006: �[0m2007: ##[error]Process completed with exit code 1.2008: Post job cleanup.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
💥 What does this PR do?
As integration tests this creates test endpoints for all of the browsers, this is more accurately unit tests
🔧 Implementation Notes
💡 Additional Considerations
🔄 Types of changes
PR Type
Tests, Other
Description
Moved guard tests from integration to unit tests
Updated zipper tests to remove unnecessary exclusive guard
Cleaned up test organization for clarity
Changes walkthrough 📝
guard_spec.rb
Remove guard integration testsrb/spec/integration/selenium/webdriver/guard_spec.rb
guards_spec.rb
Add guard tests as unit testsrb/spec/unit/selenium/webdriver/guards_spec.rb
scenarios
zipper_spec.rb
Update zipper unit test descriptionrb/spec/unit/selenium/webdriver/zipper_spec.rb