rspec_chunked 0.2.0 → 0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: efe0c38635ff68615a9a1822f6313b397675d214cec82f62a33a8c8809944b70
4
- data.tar.gz: 59791768b2990b18a034f9fa9e3b59ef6e20b87a84abce4882c0b3a052a99e5b
3
+ metadata.gz: 269d7677063d252032ed8e26c4d0b469417ba5e2bab2cc868edc79176f8201f9
4
+ data.tar.gz: 2ee7a9c1e3b51809ac8f7e3312bf806acbebc049be0d21f80686636aa99a8c6b
5
5
  SHA512:
6
- metadata.gz: 64513baab96a007dc6b6b531dcda77a502aebf6abb7b4c18203c69611440bc1abcf4e64b38dd7259fbff0eea85960bc000085c86e3e267a6e441a38dc66a1a9c
7
- data.tar.gz: 3ffbb31469ed6ae40e0144dbb00274843bca1ca855fdeba7bf71fe7030cada782c810e0ed514d168b75f6c0602313fa9b950364d7b1d7c57b2953d1463cc806c
6
+ metadata.gz: 6a7d86038a73855d043f69a134aa11e7a5aebcff4ad88d4dd5cc39d8d269bef8dd64a9c1a85bccd7e765ed522aa10056400c0d5e0f362d6631093c302517ae6d
7
+ data.tar.gz: 8103b9cc56f2fb35674789dfae0d44c41553c22f511a44cbdd9ae325ab099143be811edcc99534ad9b674ffca179882c64bbe8bcf8893b2cd1cb232ca5b2fa57
data/README.md CHANGED
@@ -16,9 +16,11 @@ If ordering is not enough, permits to balance manually by moving x percentage of
16
16
  - Add manual balance
17
17
  ```ruby
18
18
  # config/initializers/rspec_chunked.rb
19
- return unless defined?(RspecChunked::ChunkedTests)
20
-
21
- RspecChunked::ChunkedTests.balance_settings = { 1 => { to: 2, percentage: 15 }, 4 => { to: 3, percentage: 10 } }
19
+ if defined?(RspecChunked::ChunkedTests)
20
+ data = { 1 => { to: 2, percentage: 15 },
21
+ 4 => { to: 3, percentage: 10 } }
22
+ RspecChunked::ChunkedTests.balance_settings = data
23
+ end
22
24
  ```
23
25
  Balance tests by moving 15% tests files from group 1 into group 2 and moving 10% tests files from group 4 into group 3
24
26
 
data/Rakefile CHANGED
@@ -25,3 +25,7 @@ Rake::TestTask.new(:test) do |t|
25
25
  end
26
26
 
27
27
  task default: :test
28
+
29
+ # gem tasks
30
+ path = File.expand_path(__dir__)
31
+ Dir.glob("#{path}/lib/tasks/**/*.rake").each { |f| import f }
data/lib/rspec_chunked.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rspec_chunked/railtie'
3
+ require 'rspec_chunked/railtie' if defined?(Rails)
4
4
  require 'rspec_chunked/chunked_tests'
5
5
  module RspecChunked
6
6
  end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'rails'
3
4
  module RspecChunked
4
5
  class Railtie < ::Rails::Railtie
5
6
  rake_tasks do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RspecChunked
4
- VERSION = '0.2.0'
4
+ VERSION = '0.3'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  desc 'Run chunked rspec tests on specific qty, sample: CI_JOBS=3 CI_JOB=1 rake rspec_chunked'
4
- task :rspec_chunked do
4
+ task rspec_chunked: :environment do
5
5
  qty_jobs = (ENV['CI_JOBS'] || 3).to_i
6
6
  job_number = (ENV['CI_JOB'] || 1).to_i
7
7
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_chunked
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: '0.3'
5
5
  platform: ruby
6
6
  authors:
7
7
  - owen2345