1
0
Fork 0
mirror of https://github.com/teamcapybara/capybara.git synced 2022-11-09 12:08:07 -05:00

Update CI config for Ruby 3.0 release and update rubocop

This commit is contained in:
Thomas Walpole 2020-12-28 09:55:56 -08:00
parent 8510765c68
commit ca4f9aa001
4 changed files with 17 additions and 7 deletions

View file

@ -1,7 +1,9 @@
require: require:
- rubocop-rspec - rubocop-rspec
- rubocop-performance - rubocop-performance
- rubocop-minitest
- rubocop-rake
AllCops: AllCops:
NewCops: enable NewCops: enable
DisabledByDefault: false DisabledByDefault: false
@ -29,7 +31,7 @@ Metrics/BlockLength:
- 'spec/**/*' - 'spec/**/*'
- 'lib/capybara/spec/**/*' - 'lib/capybara/spec/**/*'
- 'capybara.gemspec' - 'capybara.gemspec'
ExcludedMethods: IgnoredMethods:
- Capybara.add_selector - Capybara.add_selector
- Capybara::Selector::FilterSet.add - Capybara::Selector::FilterSet.add

View file

@ -6,8 +6,8 @@ services:
- docker - docker
- xvfb - xvfb
rvm: rvm:
- 2.7 - 3.0
- jruby-9.2.13.0 - jruby-9.2.14.0
gemfile: gemfile:
- Gemfile - Gemfile
env: env:
@ -35,7 +35,7 @@ cache:
matrix: matrix:
include: include:
- gemfile: gemfiles/Gemfile.gumbo - gemfile: gemfiles/Gemfile.gumbo
rvm: 2.6 rvm: 2.7
script: bundle exec rake rack_smoke script: bundle exec rake rack_smoke
- gemfile: Gemfile - gemfile: Gemfile
rvm: 2.6 rvm: 2.6
@ -56,7 +56,7 @@ matrix:
- gemfile: gemfiles/Gemfile.base-versions - gemfile: gemfiles/Gemfile.base-versions
rvm: 2.5 rvm: 2.5
- gemfile: Gemfile - gemfile: Gemfile
rvm: 2.6 rvm: 2.7
env: HEADLESS=true env: HEADLESS=true
- gemfile: gemfiles/Gemfile.beta-versions - gemfile: gemfiles/Gemfile.beta-versions
rvm: 2.6 rvm: 2.6

View file

@ -18,6 +18,7 @@ RSpec::Core::RakeTask.new(:spec_firefox) do |t|
end end
%w[chrome ie edge chrome_remote firefox_remote safari].each do |driver| %w[chrome ie edge chrome_remote firefox_remote safari].each do |driver|
desc "Run tests using #{driver} driver"
RSpec::Core::RakeTask.new(:"spec_#{driver}") do |t| RSpec::Core::RakeTask.new(:"spec_#{driver}") do |t|
t.rspec_opts = rspec_opts t.rspec_opts = rspec_opts
t.pattern = "./spec/{selenium_spec_#{driver}.rb}" t.pattern = "./spec/{selenium_spec_#{driver}.rb}"
@ -35,8 +36,10 @@ RSpec::Core::RakeTask.new(:spec_rack) do |t|
t.pattern = './spec{,/*/**}/*{_spec.rb}' t.pattern = './spec{,/*/**}/*{_spec.rb}'
end end
desc 'Run specs with Firefox'
task spec: [:spec_firefox] task spec: [:spec_firefox]
desc 'Run basic smoke tests (rack test and rubocop)'
task rack_smoke: %i[rubocop spec_rack] task rack_smoke: %i[rubocop spec_rack]
YARD::Rake::YardocTask.new do |t| YARD::Rake::YardocTask.new do |t|
@ -47,6 +50,7 @@ Cucumber::Rake::Task.new(:cucumber) do |task|
task.cucumber_opts = ['--format=progress', 'features'] task.cucumber_opts = ['--format=progress', 'features']
end end
desc 'Task for running CI'
task :travis do task :travis do
if ENV['CAPYBARA_REMOTE'] && ENV['CAPYBARA_FF'] if ENV['CAPYBARA_REMOTE'] && ENV['CAPYBARA_FF']
Rake::Task[:spec_firefox_remote].invoke Rake::Task[:spec_firefox_remote].invoke
@ -64,6 +68,7 @@ task :travis do
Rake::Task[:cucumber].invoke Rake::Task[:cucumber].invoke
end end
desc 'Build updated JS replacements for Selenium atoms'
task :build_js do task :build_js do
require 'uglifier' require 'uglifier'
Dir.glob('./lib/capybara/selenium/atoms/src/*.js').each do |fn| Dir.glob('./lib/capybara/selenium/atoms/src/*.js').each do |fn|
@ -78,6 +83,7 @@ task :build_js do
end end
end end
desc 'Release new version'
task :release do task :release do
version = Capybara::VERSION version = Capybara::VERSION
puts "Releasing #{version}, y/n?" puts "Releasing #{version}, y/n?"

View file

@ -47,8 +47,10 @@ Gem::Specification.new do |s|
s.add_development_dependency('rspec', ['>= 3.5.0']) s.add_development_dependency('rspec', ['>= 3.5.0'])
s.add_development_dependency('rspec-instafail') s.add_development_dependency('rspec-instafail')
s.add_development_dependency('rubocop', ['~>1.1']) s.add_development_dependency('rubocop', ['~>1.1'])
s.add_development_dependency('rubocop-minitest')
s.add_development_dependency('rubocop-performance') s.add_development_dependency('rubocop-performance')
s.add_development_dependency('rubocop-rspec', ['~>2.0.0.pre']) s.add_development_dependency('rubocop-rake')
s.add_development_dependency('rubocop-rspec', ['~>2.0'])
s.add_development_dependency('sauce_whisk') s.add_development_dependency('sauce_whisk')
s.add_development_dependency('selenium_statistics') s.add_development_dependency('selenium_statistics')
s.add_development_dependency('selenium-webdriver', ['~>3.5']) s.add_development_dependency('selenium-webdriver', ['~>3.5'])