ci-helper 0.2.6 → 0.3.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
  SHA256:
3
- metadata.gz: e4041f65da690c41117fb7784cd41dba96dd13313e6e9f3caaeddbb55b585b4e
4
- data.tar.gz: aa4d96e07893b21e88259f6f6d39fa438f9af9382ade808f30f32c7accf42988
3
+ metadata.gz: af54c4df4f96a962deb3ab2acbbbf2b189d1a14f945f1ad17501a196237babdc
4
+ data.tar.gz: 73211997e92fca4b8873e9e0e1c8dafc4f208cba7c41618500d136ec639c7e62
5
5
  SHA512:
6
- metadata.gz: 4ce17c1aa8fa9f7039ce3adaafdac51da7256c13e76bda63b38d3d6e69a477d7a1a630f08515434ae45bee55158044db566f98524f563427c7111eb6f66ebd11
7
- data.tar.gz: a781c0965d67bf987bda0ef703addc8a892bb31b317a0a4efe280fec5fc874e5a34393048d85d9c02fa82222ff493c550143e421dbb242d4cf519571103ca770
6
+ metadata.gz: 3efa5ce49a800e019fa1a5b86f3d6d46132b91fb5eeb343d52f72a2052b5beec94ce8001e3c54edf180a2c7a45588217a464085aa4b191064106204f29ccf317
7
+ data.tar.gz: 6a91623e8a061aab27caa74e6f74a7dbf24a095ff821b5984fbd62672976f69dbf8615cf7772334e212e6052ee699cb538198efac70b2f31a6f00984fb59d46f
data/README.md CHANGED
@@ -47,7 +47,7 @@ List of available commands:
47
47
  If you want to use `ActiveRecord::Migrator`, you'll have to write rake task by your own.
48
48
  * **RubocopLint** — executes rubocop linter. Does not accept flags.
49
49
  * **RunSpecs** — executes `rspec` in project root.
50
- Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`.
50
+ Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`.
51
51
  * `--node-index` — if you run specs in parallel in CI, then you might use this flag.
52
52
  * `--node-total` — if you run specs in parallel in CI, then you might use this flag.
53
53
  * `--with-database` — if you want to prepare database before executing specs,
@@ -62,6 +62,13 @@ Accepted flags: `--node-index`, `node-total`, `with-database`, `split-resultset`
62
62
  delimited by coma.
63
63
  * `--ignored-paths [values]` - accepts path patterns that should be ignored,
64
64
  delimited by coma.
65
+ * **CheckCoverage** — checks coverage by executing `SimpleCov::collate`.
66
+ You should set `SimpleCov::minimum_coverage` in your `spec_helper.rb` file.
67
+ Accepted flags: `--split-resultset`.
68
+ * `--split-resultset` — if you execute command `RunSpecs` with `--split-resultset true`,
69
+ you also should set this flag to `true`. If this flag set to `true`, final coverage will be
70
+ calculated by merging results in all files, matching the mask `coverage/resultset.*.json`.
71
+ By default final coverage is calculated using result from `coverage/.resultset.json`.
65
72
 
66
73
  ### Rake Tasks
67
74
 
@@ -17,4 +17,6 @@ require "ci_helper/tools/colorize"
17
17
  require "ci_helper/tools/inflector"
18
18
  require "ci_helper/version"
19
19
 
20
+ # :nocov:
20
21
  require "ci_helper/railtie" if defined?(Rails)
22
+ # :nocov:
@@ -12,7 +12,7 @@ module CIHelper
12
12
 
13
13
  # :nocov:
14
14
  def process_stdout
15
- @process_stdout ||= STDOUT
15
+ @process_stdout ||= $stdout
16
16
  end
17
17
  # :nocov:
18
18
  end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module CIHelper
4
+ module Commands
5
+ class CheckCoverage < BaseCommand
6
+ def call
7
+ SimpleCov.collate(files)
8
+ 0
9
+ end
10
+
11
+ private
12
+
13
+ def files
14
+ return path.glob("coverage/resultset.*.json") if split_resultset?
15
+
16
+ [path.join("coverage/.resultset.json")]
17
+ end
18
+
19
+ def split_resultset?
20
+ options[:split_resultset] == "true"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -5,9 +5,11 @@ module CIHelper
5
5
  class Inflector < Delegator
6
6
  include Singleton
7
7
 
8
+ # rubocop:disable Lint/MissingSuper
8
9
  def initialize
9
10
  @inflector = Dry::Inflector.new { |inflections| inflections.acronym "DB" }
10
11
  end
12
+ # rubocop:enable Lint/MissingSuper
11
13
 
12
14
  def __getobj__
13
15
  @inflector
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CIHelper
4
- VERSION = "0.2.6"
4
+ VERSION = "0.3.0"
5
5
  end
@@ -9,7 +9,7 @@ class SequelManagement
9
9
  MIGRATIONS_PATH = "db/migrate"
10
10
 
11
11
  def initialize
12
- self.logger = Logger.new(STDOUT)
12
+ self.logger = Logger.new($stdout)
13
13
 
14
14
  define_db_task!
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ci-helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - JustAnotherDude
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-01 00:00:00.000000000 Z
11
+ date: 2020-09-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: colorize
@@ -190,6 +190,7 @@ files:
190
190
  - lib/ci_helper/cli.rb
191
191
  - lib/ci_helper/commands.rb
192
192
  - lib/ci_helper/commands/bundler_audit.rb
193
+ - lib/ci_helper/commands/check_coverage.rb
193
194
  - lib/ci_helper/commands/check_db_development.rb
194
195
  - lib/ci_helper/commands/check_db_rollback.rb
195
196
  - lib/ci_helper/commands/check_spec_suffixes.rb