knapsack_pro 0.15.2 → 0.16.0

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
  SHA1:
3
- metadata.gz: 4ef7eebc64a5bd78e609ab24ae4775f23f399c02
4
- data.tar.gz: 0d49110973766dd8a6e5ee4ae90febbb83bae5c2
3
+ metadata.gz: 29937a880aa916b87440c968c42c0ef48e657faa
4
+ data.tar.gz: c570bd3da47a9b4641316d1f91a94cd964151118
5
5
  SHA512:
6
- metadata.gz: 929a048c9ebd2364073bc5e1ee7daf6101796df1d714cc67595e23d091480e87ddbde90424e37bfb74d821949574b269dfef09336fd76b4a03e72eed309f031c
7
- data.tar.gz: acc5eff4d55bf6e910276258fdf4fd1966b6f6a05248dda7a2c41c31a4460c02fb12585316e23ad5f267d3397e8966a9b9904431d2151866a53c16c913c5a941
6
+ metadata.gz: 07d059e6b79a117447db263430b45dfee56651d3462a1600589f87b229e78c1c7e5be71a93c5439737b969d7b3a1e0df56a537a7610eabfa55da64bc7dc775a1
7
+ data.tar.gz: 4ebeeb9e24932ea069e545775481cc60fc03979c9ea2a3c85220e16cd5d5af593a17f50c377c773d1819ee45adc799a9a4c83e31ead65b4aab80bd3d702de317
data/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  * TODO
4
4
 
5
+ ### 0.16.0
6
+
7
+ * Add KNAPSACK_PRO_LOG_LEVEL option
8
+
9
+ Related PR:
10
+ https://github.com/ArturT/knapsack/pull/49
11
+
12
+ https://github.com/KnapsackPro/knapsack_pro-ruby/compare/v0.15.2...v0.16.0
13
+
5
14
  ### 0.15.2
6
15
 
7
16
  * Cache API response test file paths to fix problem with double request to get test suite distribution for the node.
data/README.md CHANGED
@@ -87,6 +87,8 @@ For instance when you will run tests with rake knapsack_pro:rspec then:
87
87
  - [Info for snap-ci.com users](#info-for-snap-cicom-users)
88
88
  - [FAQ](#faq)
89
89
  - [How to run tests for particular CI node in your development environment](#how-to-run-tests-for-particular-ci-node-in-your-development-environment)
90
+ - [What happens when Knapsack Pro API is not available/not reachable temporarily?](#what-happens-when-knapsack-pro-api-is-not-availablenot-reachable-temporarily)
91
+ - [How can I change log level?](#how-can-i-change-log-level)
90
92
  - [Gem tests](#gem-tests)
91
93
  - [Spec](#spec)
92
94
  - [Contributing](#contributing)
@@ -550,6 +552,18 @@ For instance to run subset of tests for the first CI node with specified seed yo
550
552
 
551
553
  Above example is for RSpec. You can use respectively rake task name and token environment variable when you want to run tests for minitest, cucumber or spinach.
552
554
 
555
+ ### What happens when Knapsack Pro API is not available/not reachable temporarily?
556
+
557
+ knapsack_pro gem has fallback behaviour and it will split test files across CI nodes based on popular test directory names.
558
+
559
+ ### How can I change log level?
560
+
561
+ You can change log level by specifying the `KNAPSACK_PRO_LOG_LEVEL` environment variable.
562
+
563
+ KNAPSACK_PRO_LOG_LEVEL=warn bundle exec rake knapsack_pro:rspec
564
+
565
+ Available values are `debug`, `info`, and `warn`. The default log level is `info`.
566
+
553
567
  ## Gem tests
554
568
 
555
569
  ### Spec
data/lib/knapsack_pro.rb CHANGED
@@ -59,7 +59,7 @@ module KnapsackPro
59
59
  def logger
60
60
  unless @logger
61
61
  default_logger = ::Logger.new(STDOUT)
62
- default_logger.level = ::Logger::INFO
62
+ default_logger.level = KnapsackPro::Config::Env.log_level
63
63
  self.logger = default_logger
64
64
  end
65
65
  @logger
@@ -120,6 +120,14 @@ module KnapsackPro
120
120
  value
121
121
  end
122
122
 
123
+ def log_level
124
+ {
125
+ 'debug' => ::Logger::DEBUG,
126
+ 'info' => ::Logger::INFO,
127
+ 'warn' => ::Logger::WARN,
128
+ }[ENV['KNAPSACK_PRO_LOG_LEVEL']] || ::Logger::INFO
129
+ end
130
+
123
131
  private
124
132
 
125
133
  def required_env(env_name)
@@ -1,3 +1,3 @@
1
1
  module KnapsackPro
2
- VERSION = '0.15.2'
2
+ VERSION = '0.16.0'
3
3
  end
@@ -443,4 +443,18 @@ describe KnapsackPro::Config::Env do
443
443
  end
444
444
  end
445
445
  end
446
+
447
+ describe '.log_level' do
448
+ subject { described_class.log_level }
449
+
450
+ context 'when ENV exists' do
451
+ let(:log_level) { 'debug' }
452
+ before { stub_const('ENV', { 'KNAPSACK_PRO_LOG_LEVEL' => log_level }) }
453
+ it { should eql ::Logger::DEBUG }
454
+ end
455
+
456
+ context "when ENV doesn't exist" do
457
+ it { should eql ::Logger::INFO }
458
+ end
459
+ end
446
460
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knapsack_pro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.2
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ArturT
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-07 00:00:00.000000000 Z
11
+ date: 2016-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake