Skip to content

Commit 1000271

Browse files
titusfortnerdiemol
andauthored
[rb] add rake tasks to wrap bazel commands (#12153)
Co-authored-by: Diego Molina <[email protected]>
1 parent 722376a commit 1000271

File tree

4 files changed

+22
-1
lines changed

4 files changed

+22
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ bazel-selenium/external/bundle/bin/rdbg -A
277277

278278
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:
279279

280-
1. Run `bazel build @bundle//:bundle //rb:selenium-devtools //rb:selenium-webdriver` before configuring IDE.
280+
1. Run `bundle exec rake update` as necessary to update generated artifacts.
281281
2. Open `rb/` as a main project directory.
282282
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`.
283283
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.

rb/Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ GEM
3232
public_suffix (5.0.1)
3333
rack (2.2.5)
3434
rainbow (3.1.1)
35+
rake (13.0.6)
3536
regexp_parser (2.6.1)
3637
reline (0.3.3)
3738
io-console (~> 0.5)
@@ -87,6 +88,7 @@ PLATFORMS
8788
DEPENDENCIES
8889
debug (~> 1.7)
8990
rack (~> 2.0)
91+
rake (~> 13.0)
9092
rspec (~> 3.0)
9193
rubocop (~> 1.42)
9294
rubocop-performance (~> 1.15)

rb/Rakefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
require 'rspec/core/rake_task'
4+
5+
desc 'Setup everything to run tests in RubyMine'
6+
task :update do
7+
system 'bazel build @bundle//:bundle //rb:selenium-devtools //rb:selenium-webdriver'
8+
end
9+
10+
desc 'Run unit tests'
11+
task :unit do
12+
system 'bazel test --test_size_filters small //rb/...'
13+
end
14+
15+
desc 'Run all integration tests in chrome'
16+
task :spec do
17+
system "bazel test --test_size_filters large //rb/..."
18+
end

rb/selenium-webdriver.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ Gem::Specification.new do |s|
5454
s.add_runtime_dependency 'websocket', ['~> 1.0']
5555

5656
s.add_development_dependency 'rack', ['~> 2.0']
57+
s.add_development_dependency 'rake', ['~> 13.0']
5758
s.add_development_dependency 'rspec', ['~> 3.0']
5859
s.add_development_dependency 'rubocop', ['~> 1.42']
5960
s.add_development_dependency 'rubocop-performance', ['~> 1.15']

0 commit comments

Comments
 (0)