gitlab-crystalball 0.8.1 → 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: 4ecaca1010fa8832b924a6acd3e9163175ffa144a13b8d298ee35d5b8baaf546
4
- data.tar.gz: 84af3bed1b01cdd235c881e948c033da9a630102ad6133ac3b181df24dc52545
3
+ metadata.gz: bfe4631fc79255c0c4091aca48807cb31f7a596730233b3afaa5a7cf1e913be7
4
+ data.tar.gz: af6a47b8418995cd7845041d8a0c773ecfb40c64d1cd3c3e0292a574979b5a1a
5
5
  SHA512:
6
- metadata.gz: e9fac346de4eb92f888b3fe3cad20c5618058f329c76b7c3b08e61b2ac0ac913f2e52f650c568b017cb38280ee4dd62f1ae68c3155eacc31f1efbfdb33e9582c
7
- data.tar.gz: d9b2d7d86a787e8bed3c4ade3561d58593f8f146a477babfab4ed63a638b9c2d52059b44777dc250f1eec082f360f285effa1c7054f7569175284b1c78ed549a
6
+ metadata.gz: b8c59e192fe8be3eee41156660274e82338122e9057b2323c5a72adc66a570ea99b3dc5bbf6aa99f4c4742fbdfebb81c07fc01bf0f7565fcfdf2380fccbe2ce2
7
+ data.tar.gz: f2352dc108e8ffa284b4a4505f5df7312f970771f573cfdf46bfa9d93090f2a88136c0e9bb39ab393ddcd8411dc8bacbd2e40d064ef5b5aa89f9acc6266acfc9
@@ -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.1"
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.1
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-13 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