Skip to content

Commit

Permalink
Merge branch 'trunk' into add-duration-to-action-constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
titusfortner authored Jun 19, 2024
2 parents 0ef4c94 + 0e2a683 commit f090146
Show file tree
Hide file tree
Showing 57 changed files with 3,422 additions and 5,509 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,6 @@ jobs:
- name: Set resolution
if: inputs.os == 'windows' && inputs.browser != ''
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
- name: Setup Chrome
if: inputs.browser == 'chrome'
uses: browser-actions/setup-chrome@latest
with:
chrome-version: ${{ inputs.browser-version || 'stable' }}
- name: Setup Firefox
if: inputs.browser == 'firefox'
uses: abhi1693/[email protected]
with:
browser: firefox
version: ${{ inputs.browser-version || 'latest' }}
- name: Setup Edge
if: inputs.browser == 'edge'
uses: browser-actions/setup-edge@latest
with:
edge-version: ${{ inputs.browser-version || 'stable' }}
- name: Setup Safari
if: inputs.browser == 'safari'
run: sudo safaridriver --enable
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/ci-javascript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ jobs:
bazel test
--flaky_test_attempts 3
--test_tag_filters ${{ matrix.browser }}
--local_test_jobs 1
//javascript/node/...
2 changes: 2 additions & 0 deletions .github/workflows/ci-ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ jobs:
--local_test_jobs 1
--test_size_filters large
--test_tag_filters ${{ matrix.browser }}
${{ matrix.os != 'windows' && '--pin_browsers=true' || '' }}
//rb/spec/...
integration-tests-remote:
Expand Down Expand Up @@ -123,4 +124,5 @@ jobs:
--local_test_jobs 1
--test_size_filters large
--test_tag_filters ${{ matrix.browser }}-remote
${{ matrix.os != 'windows' && '--pin_browsers=true' || '' }}
//rb/spec/...
14 changes: 7 additions & 7 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ jobs:
with:
name: Nightly Ruby Release
cache-key: rb-nightly-${{ matrix.gem }}
env:
GEM_HOST_API_KEY: "Bearer $GITHUB_TOKEN"
run: ./go rb:release['nightly', '--config=release']
run: |
export GEM_HOST_API_KEY="Bearer $GITHUB_TOKEN"
./go rb:release[nightly]
on-ruby-failure:
name: On Ruby Failure
runs-on: ubuntu-latest
Expand All @@ -63,7 +63,7 @@ jobs:
with:
name: Nightly Python Release
cache-key: python-nightly
run: ./go py:release['nightly', '--config=release']
run: ./go py:release[nightly]
secrets: inherit
on-python-failure:
name: On Python Failure
Expand All @@ -90,7 +90,7 @@ jobs:
with:
name: Nightly Java Release
cache-key: java-nightly
run: ./go publish-maven-snapshot
run: ./go java:release[nightly]
secrets: inherit
on-java-failure:
name: On Java Failure
Expand Down Expand Up @@ -118,7 +118,7 @@ jobs:
name: Nightly DotNet Release
cache-key: dotnet-nightly
dotnet-version: '6.x'
run: ./go dotnet:release['nightly', '--config=release']
run: ./go dotnet:release[--stamp,nightly]
secrets: inherit
on-dotnet-failure:
name: On .NET Failure
Expand Down Expand Up @@ -179,7 +179,7 @@ jobs:
echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
echo "@seleniumhq:registry=https://npm.pkg.github.com" >> ~/.npmrc
echo "always-auth=true" >> ~/.npmrc
./go node:release['nightly', '--config=release']
./go node:release[--stamp,nightly]
secrets: inherit
on-javascript-failure:
name: On JavaScript Failure
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
fetch-tags: true
ref: release-${{ github.event.inputs.version }}
- name: Install Ruby
uses: ruby/setup-ruby@d5fb7a202fc07872cb44f00ba8e6197b70cb0c55
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'
working-directory: 'rb'
Expand All @@ -80,10 +80,10 @@ jobs:
run: git reset HEAD~1
- name: Update everything including early release CDP
if: ${{ github.event.inputs.chrome_channel == 'early-stable' }}
run: ./go all:prepare['Beta']
run: ./go all:prepare[${{ github.event.inputs.version }},Beta]
- name: Update everything including released CDP
if: ${{ github.event.inputs.chrome_channel == 'stable' }}
run: ./go "all:prepare[Stable]"
run: ./go "all:prepare[${{ github.event.inputs.version }},Stable]"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ py/selenium/webdriver/remote/isDisplayed.js
py/docs/build/
py/build/
py/LICENSE
py/pytestdebug.log
selenium.egg-info/
third_party/java/jetty/jetty-repacked.jar
*.user
Expand Down
1 change: 0 additions & 1 deletion .skipped-tests
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox-beta
-//rb/spec/integration/selenium/webdriver:element-chrome
-//rb/spec/integration/selenium/webdriver/firefox:driver-firefox-beta
-//rb/spec/integration/selenium/webdriver/chrome:service-chrome-bidi
-//rb/spec/integration/selenium/webdriver/edge:service-edge-bidi
-//rb/spec/integration/selenium/webdriver/firefox:service-firefox-bidi
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ filegroup(
srcs = [
"Rakefile",
],
visibility = ["//rb:__subpackages__",],
visibility = ["//rb:__subpackages__"],
)

alias(
Expand Down
120 changes: 44 additions & 76 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -336,69 +336,30 @@ end

task 'release-java': %i[java-release-zip publish-maven]

# TODO: just set the environment variables that maven is asking for
def read_m2_user_pass
user = ENV.fetch('SEL_M2_USER', nil)
pass = ENV.fetch('SEL_M2_PASS', nil)
if user && pass
puts 'Fetching m2 user and pass from environment variables.'
return [user, pass]
end

puts 'Fetching m2 user and pass from /.m2/settings.xml.'
puts 'Maven environment variables not set, inspecting /.m2/settings.xml.'
settings = File.read("#{Dir.home}/.m2/settings.xml")
found_section = false
settings.each_line do |line|
if !found_section
found_section = line.include? '<id>sonatype-nexus-staging</id>'
elsif line.include?('<username>')
user = line[%r{<username>(.*?)</username>}, 1]
ENV['MAVEN_USER'] = line[%r{<username>(.*?)</username>}, 1]
elsif line.include?('<password>')
pass = line[%r{<password>(.*?)</password>}, 1]
ENV['MAVEN_PASSWORD'] = line[%r{<password>(.*?)</password>}, 1]
end
break if user && pass
break if ENV['MAVEN_PASSWORD'] && ENV['MAVEN_USER']
end
[user, pass]
end

desc 'Publish all Java jars to Maven as stable release'
task 'publish-maven': JAVA_RELEASE_TARGETS do
creds = read_m2_user_pass
JAVA_RELEASE_TARGETS.each do |p|
Bazel.execute('run',
['--stamp',
'--define',
'maven_repo=https://oss.sonatype.org/service/local/staging/deploy/maven2',
'--define',
"maven_user=#{creds[0]}",
'--define',
"maven_password=#{creds[1]}",
'--define',
'gpg_sign=true'],
p)
end
task 'publish-maven' do
Rake::Task['java:release'].invoke
end

desc 'Publish all Java jars to Maven as nightly release'
task 'publish-maven-snapshot': JAVA_RELEASE_TARGETS do
creds = read_m2_user_pass
if java_version.end_with?('-SNAPSHOT')
JAVA_RELEASE_TARGETS.each do |p|
Bazel.execute('run',
['--stamp',
'--define',
'maven_repo=https://oss.sonatype.org/content/repositories/snapshots',
'--define',
"maven_user=#{creds[0]}",
'--define',
"maven_password=#{creds[1]}",
'--define',
'gpg_sign=false'],
p)
end
else
puts 'No SNAPSHOT version configured. Targets will not be pushed to the snapshot repo in SonaType.'
end
task 'publish-maven-snapshot' do
Rake::Task['java:release'].invoke('nightly')
end

desc 'Install jars to local m2 directory'
Expand Down Expand Up @@ -485,11 +446,11 @@ namespace :node do

desc 'Release Node npm package'
task :release do |_task, arguments|
args = arguments.to_a.compact.empty? ? ['--stamp'] : arguments.to_a.compact
args = arguments.to_a.compact
nightly = args.delete('nightly')
Rake::Task['node:version'].invoke('nightly') if nightly

Bazel.execute('run', args, '//javascript/node/selenium-webdriver:selenium-webdriver.publish')
Bazel.execute('run', ['--stamp'], '//javascript/node/selenium-webdriver:selenium-webdriver.publish')
end

desc 'Release Node npm package'
Expand Down Expand Up @@ -550,12 +511,12 @@ namespace :py do

desc 'Release Python wheel and sdist to pypi'
task :release do |_task, arguments|
args = arguments.to_a.compact.empty? ? ['--stamp'] : arguments.to_a.compact
args = arguments.to_a.compact
nightly = args.delete('nightly')
Rake::Task['py:version'].invoke('nightly') if nightly

command = nightly.nil? ? '//py:selenium-release' : '//py:selenium-release-nightly'
Bazel.execute('run', args, command)
command = nightly ? '//py:selenium-release-nightly' : '//py:selenium-release'
Bazel.execute('run', ['--stamp'], command)
end

desc 'generate and copy files required for local development'
Expand Down Expand Up @@ -706,9 +667,6 @@ namespace :rb do
args = arguments.to_a.compact
webdriver = args.delete('webdriver')
devtools = args.delete('devtools')
if args.include?('--config=remote') || args.include?('--config=release')
File.write('rb/.ruby-version', 'jruby-9.4.7.0')
end

Bazel.execute('build', args, '//rb:selenium-webdriver') if webdriver || !devtools
Bazel.execute('build', args, '//rb:selenium-devtools') if devtools || !webdriver
Expand All @@ -724,16 +682,15 @@ namespace :rb do
desc 'Push Ruby gems to rubygems'
task :release do |_task, arguments|
args = arguments.to_a.compact
if args.include?('--config=remote') || args.include?('--config=release')
File.write('rb/.ruby-version', 'jruby-9.4.7.0')
end

nightly = args.delete('nightly')
wd_target = nightly ? '//rb:selenium-webdriver-release' : '//rb:selenium-webdriver-release-nightly'
cdp_target = nightly ? '//rb:selenium-devtools-release' : '//rb:selenium-devtools-release-nightly'

Bazel.execute('run', args, wd_target)
Bazel.execute('run', args, cdp_target)
if nightly
Bazel.execute('run', [], '//rb:selenium-webdriver-bump-nightly-version')
Bazel.execute('run', ['--stamp'], '//rb:selenium-webdriver-release-nightly')
else
Bazel.execute('run', ['--stamp'], '//rb:selenium-webdriver-release')
Bazel.execute('run', ['--stamp'], '//rb:selenium-devtools-release')
end
end

desc 'Generate Ruby documentation'
Expand Down Expand Up @@ -802,16 +759,14 @@ namespace :dotnet do

desc 'Upload nupkg files to Nuget'
task :release do |_task, arguments|
args = arguments.to_a.compact.empty? ? ['--stamp'] : arguments.to_a.compact
args = arguments.to_a.compact
nightly = args.delete('nightly')
Rake::Task['dotnet:version'].invoke('nightly') if nightly
Rake::Task['dotnet:package'].invoke('--stamp')

Rake::Task['dotnet:package'].invoke(*args)

release_version = dotnet_version
api_key = ENV.fetch('NUGET_API_KEY', nil)
push_destination = 'https://api.nuget.org/v3/index.json'
if release_version.include?('-nightly')
if nightly
# Nightly builds are pushed to GitHub NuGet repository
# This commands will run in GitHub Actions
api_key = ENV.fetch('GITHUB_TOKEN', nil)
Expand Down Expand Up @@ -885,13 +840,13 @@ namespace :java do
desc 'Build Java Client Jars'
task :build do |_task, arguments|
args = arguments.to_a.compact
Bazel.execute('build', args, '//java/src/org/openqa/selenium:client-combined')
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('build', args, target) }
end

desc 'Build Grid Jar'
desc 'Build Grid Server'
task :grid do |_task, arguments|
args = arguments.to_a.compact
Bazel.execute('build', args, '//java/src/org/openqa/selenium/grid:grid')
Bazel.execute('build', args, '//java/src/org/openqa/selenium/grid:executable-grid')
end

desc 'Package Java bindings and grid into releasable packages and stage for release'
Expand All @@ -917,9 +872,21 @@ namespace :java do

desc 'Deploy all jars to Maven'
task :release do |_task, arguments|
args = arguments.to_a.compact.empty? ? ['--stamp'] : arguments.to_a.compact
Rake::Task['java:package'].invoke(*args)
Rake::Task['publish-maven'].invoke
args = arguments.to_a.compact
nightly = args.delete('nightly')

ENV['MAVEN_USER'] ||= ENV.fetch('SEL_M2_USER', nil)
ENV['MAVEN_PASSWORD'] ||= ENV.fetch('SEL_M2_PASS', nil)
read_m2_user_pass unless ENV['MAVEN_PASSWORD'] && ENV['MAVEN_USER']

repo = nightly ? 'content/repositories/snapshots' : 'service/local/staging/deploy/maven2'
ENV['MAVEN_REPO'] = "https://oss.sonatype.org/#{repo}"
ENV['GPG_SIGN'] = (!nightly).to_s

Rake::Task['java:version'].invoke if nightly
Rake::Task['java:package'].invoke('--stamp')
Rake::Task['java:build'].invoke('--stamp')
JAVA_RELEASE_TARGETS.each { |target| Bazel.execute('run', ['--stamp'], target) }
end

desc 'Install jars to local m2 directory'
Expand Down Expand Up @@ -1104,8 +1071,9 @@ namespace :all do
end

desc 'Update everything in preparation for a release'
task :prepare, [:channel] do |_task, arguments|
task :prepare, [:version, :channel] do |_task, arguments|
chrome_channel = arguments[:channel] || 'Stable'
version = arguments[:version]
args = Array(chrome_channel) ? ['--', "--chrome_channel=#{chrome_channel.capitalize}"] : []
Bazel.execute('run', args, '//scripts:pinned_browsers')
commit!('Update pinned browser versions', ['common/repositories.bzl'])
Expand Down Expand Up @@ -1135,7 +1103,7 @@ namespace :all do
commit!('Update authors file', ['AUTHORS'])

# Note that this does not include Rust version changes that are handled in separate rake:version task
Rake::Task['all:version'].invoke
Rake::Task['all:version'].invoke(version)
commit!("FIX CHANGELOGS BEFORE MERGING!\n\nUpdate versions and change logs to release Selenium #{java_version}",
['dotnet/CHANGELOG',
'dotnet/selenium-dotnet-version.bzl',
Expand Down
4 changes: 2 additions & 2 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ rules_closure_toolchains()

http_archive(
name = "rules_rust",
integrity = "sha256-F8U7+AC5MvMtPKGdLLnorVM84cDXKfDRgwd7/dq3rUY=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.46.0/rules_rust-v0.46.0.tar.gz"],
integrity = "sha256-JLN47ZcAbx9wEr5Jiib4HduZATGLiDgK7oUi/fvotzU=",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.42.1/rules_rust-v0.42.1.tar.gz"],
)

load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Manifest-Version: 1.0

Name: inject.js
Digest-Algorithms: SHA1 SHA256
SHA1-Digest: b2nrco3zOUBDJuyARPlsNEU8O9A=
SHA256-Digest: lU8GPe0dnC/AH4PaP0/akwta9vNay0n7fsgkBOieLsg=

Name: manifest.json
Digest-Algorithms: SHA1 SHA256
SHA1-Digest: EjY6pS7xUwQxN7ijQqys3bdEHHc=
SHA256-Digest: eLH2wKnhmjOvDJk/13OJMeh+X4sdlSpbOIfyhp44Zaw=

Binary file not shown.
Loading

0 comments on commit f090146

Please sign in to comment.