gitlab-crystalball 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7ec4fa9b1270e8b3aec30a4b7d5d10968278d7c588b3c954b3aff25dacadfa8a
4
- data.tar.gz: ce71ab46817998338ef0cf7d19d52eae19a9b33ef663c0e63b920691bb990afb
3
+ metadata.gz: bfe4631fc79255c0c4091aca48807cb31f7a596730233b3afaa5a7cf1e913be7
4
+ data.tar.gz: af6a47b8418995cd7845041d8a0c773ecfb40c64d1cd3c3e0292a574979b5a1a
5
5
  SHA512:
6
- metadata.gz: 215d5ca4f23d09a63c0df24d125374bbe36a6730f3386defb0c2195ad804cdff2140d114edbb5dd6e686f1708daa9e88c89ef9098c231a9ac18a1c02378e86ad
7
- data.tar.gz: 396ee4f17aadc5422bbe4da993e8ef7d7e2f7f246b154d7b0ce04b6bae9517294df2e382bac964390ab45795c806d768e2ccc8dad5b57c8ad4bd70d479745e5a
6
+ metadata.gz: b8c59e192fe8be3eee41156660274e82338122e9057b2323c5a72adc66a570ea99b3dc5bbf6aa99f4c4742fbdfebb81c07fc01bf0f7565fcfdf2380fccbe2ce2
7
+ data.tar.gz: f2352dc108e8ffa284b4a4505f5df7312f970771f573cfdf46bfa9d93090f2a88136c0e9bb39ab393ddcd8411dc8bacbd2e40d064ef5b5aa89f9acc6266acfc9
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # Crystalball
2
2
 
3
- ![Build Status](https://gitlab.com/acunskis/crystalball/badges/main/pipeline.svg)
4
- ![Test Coverage](https://gitlab.com/acunskis/crystalball/badges/main/coverage.svg?job=rspec)
3
+ ![Build Status](https://gitlab.com/gitlab-org/ruby/gems/crystalball/badges/main/pipeline.svg)
4
+ ![Test Coverage](https://gitlab.com/gitlab-org/ruby/gems/crystalball/badges/main/coverage.svg?job=rspec%20spec)
5
5
 
6
6
  Crystalball is a Ruby library which implements [Regression Test Selection mechanism](https://tenderlovemaking.com/2015/02/13/predicting-test-failues.html) originally published by Aaron Patterson.
7
7
  Its main purpose is to select a minimal subset of your test suite which should be run to ensure your changes didn't break anything.
@@ -30,11 +30,11 @@ Or install it yourself as:
30
30
 
31
31
  ## Usage
32
32
 
33
- Please see our [official documentation](https://gitlab.com/acunskis/crystalball/-/blob/main/docs/index.md).
33
+ Please see our [official documentation](https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/blob/main/docs/index.md).
34
34
 
35
35
  ### Versioning
36
36
 
37
- We use [semantic versioning](https://semver.org/) for our [releases](https://gitlab.com/acunskis/crystalball/-/releases).
37
+ We use [semantic versioning](https://semver.org/) for our [releases](https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/releases).
38
38
 
39
39
  ## Development
40
40
 
@@ -10,6 +10,7 @@ module Crystalball
10
10
  # Map generator strategy based on harvesting Coverage information during example execution
11
11
  class OneshotCoverageStrategy
12
12
  include BaseStrategy
13
+ include Logging
13
14
  include Helpers::PathFilter
14
15
 
15
16
  def after_register
@@ -21,10 +22,23 @@ module Crystalball
21
22
  # @param [Crystalball::ExampleGroupMap] example_map - object holding example metadata and used files
22
23
  # @param [RSpec::Core::Example] example - a RSpec example
23
24
  def call(example_map, example)
24
- Coverage.start(oneshot_lines: true)
25
+ start_coverage
25
26
  yield example_map, example
26
- paths = Coverage.result.keys
27
- example_map.push(*filter(paths))
27
+ paths = filter(Coverage.result(stop: true, clear: true).keys)
28
+ log(:debug, "[Crystalball] #{example.id} recorded #{paths.size} files")
29
+ example_map.push(*paths)
30
+ end
31
+
32
+ # Start coverage or restart it if it was already started
33
+ #
34
+ # @return [void] <description>
35
+ def start_coverage
36
+ log(:debug, "[Crystalball] Starting oneshot_line coverage capture")
37
+ return Coverage.start(oneshot_lines: true) unless Coverage.running?
38
+
39
+ log(:warn, "[Crystalball] Coverage has been already started, restarting coverage for oneshot_lines!")
40
+ Coverage.result(stop: true, clear: true)
41
+ Coverage.start(oneshot_lines: true)
28
42
  end
29
43
  end
30
44
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Crystalball
4
- VERSION = "0.8.0"
4
+ VERSION = "0.8.2"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitlab-crystalball
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Developer Experience Team
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-05-12 00:00:00.000000000 Z
10
+ date: 2025-05-20 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: git
@@ -23,6 +23,20 @@ dependencies:
23
23
  - - "<"
24
24
  - !ruby/object:Gem::Version
25
25
  version: '4'
26
+ - !ruby/object:Gem::Dependency
27
+ name: ostruct
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '1'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "<"
38
+ - !ruby/object:Gem::Version
39
+ version: '1'
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: actionview
28
42
  requirement: !ruby/object:Gem::Requirement
@@ -286,14 +300,14 @@ files:
286
300
  - lib/crystalball/source_diff/file_diff.rb
287
301
  - lib/crystalball/source_diff/formatting_checker.rb
288
302
  - lib/crystalball/version.rb
289
- homepage: https://gitlab.com/acunskis/crystalball
303
+ homepage: https://gitlab.com/gitlab-org/ruby/gems/crystalball
290
304
  licenses: []
291
305
  metadata:
292
- bug_tracker_uri: https://gitlab.com/acunskis/crystalball/-/issues
293
- changelog_uri: https://gitlab.com/acunskis/crystalball/-/releases
294
- documentation_uri: https://gitlab.com/acunskis/crystalball/-/blob/main/docs/index.md
295
- source_code_uri: https://gitlab.com/acunskis/crystalball/-/tree/main
296
- wiki_uri: https://gitlab.com/acunskis/crystalball/-/wikis/home
306
+ bug_tracker_uri: https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/issues
307
+ changelog_uri: https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/releases
308
+ documentation_uri: https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/blob/main/docs/index.md
309
+ source_code_uri: https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/tree/main
310
+ wiki_uri: https://gitlab.com/gitlab-org/ruby/gems/crystalball/-/wikis/home
297
311
  rubygems_mfa_required: 'false'
298
312
  rdoc_options: []
299
313
  require_paths: