Skip to content

Commit

Permalink
[rb] add rake tasks to wrap bazel commands (#12153)
Browse files Browse the repository at this point in the history
Co-authored-by: Diego Molina <diemol@users.noreply.github.com>
  • Loading branch information
titusfortner and diemol authored Jun 6, 2023
1 parent 722376a commit 1000271
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ bazel-selenium/external/bundle/bin/rdbg -A

If you want to use RubyMine for development, a bit of extra configuration is necessary to let the IDE know about Bazel toolchain and artifacts:

1. Run `bazel build @bundle//:bundle //rb:selenium-devtools //rb:selenium-webdriver` before configuring IDE.
1. Run `bundle exec rake update` as necessary to update generated artifacts.
2. Open `rb/` as a main project directory.
3. In <kbd>Settings / Languages & Frameworks / Ruby SDK and Gems</kbd> add new <kbd>Interpreter</kbd> pointing to `../bazel-selenium/external/rules_ruby_dist/dist/bin/ruby`.
4. You should now be able to run and debug any spec. It uses Chrome by default, but you can alter it using environment variables above.
Expand Down
2 changes: 2 additions & 0 deletions rb/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ GEM
public_suffix (5.0.1)
rack (2.2.5)
rainbow (3.1.1)
rake (13.0.6)
regexp_parser (2.6.1)
reline (0.3.3)
io-console (~> 0.5)
Expand Down Expand Up @@ -87,6 +88,7 @@ PLATFORMS
DEPENDENCIES
debug (~> 1.7)
rack (~> 2.0)
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.42)
rubocop-performance (~> 1.15)
Expand Down
18 changes: 18 additions & 0 deletions rb/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# frozen_string_literal: true

require 'rspec/core/rake_task'

desc 'Setup everything to run tests in RubyMine'
task :update do
system 'bazel build @bundle//:bundle //rb:selenium-devtools //rb:selenium-webdriver'
end

desc 'Run unit tests'
task :unit do
system 'bazel test --test_size_filters small //rb/...'
end

desc 'Run all integration tests in chrome'
task :spec do
system "bazel test --test_size_filters large //rb/..."
end
1 change: 1 addition & 0 deletions rb/selenium-webdriver.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'websocket', ['~> 1.0']

s.add_development_dependency 'rack', ['~> 2.0']
s.add_development_dependency 'rake', ['~> 13.0']
s.add_development_dependency 'rspec', ['~> 3.0']
s.add_development_dependency 'rubocop', ['~> 1.42']
s.add_development_dependency 'rubocop-performance', ['~> 1.15']
Expand Down

0 comments on commit 1000271

Please sign in to comment.