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 +4 -4
- data/README.md +4 -4
- data/lib/crystalball/map_generator/oneshot_coverage_strategy.rb +17 -3
- data/lib/crystalball/version.rb +1 -1
- metadata +22 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfe4631fc79255c0c4091aca48807cb31f7a596730233b3afaa5a7cf1e913be7
|
4
|
+
data.tar.gz: af6a47b8418995cd7845041d8a0c773ecfb40c64d1cd3c3e0292a574979b5a1a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8c59e192fe8be3eee41156660274e82338122e9057b2323c5a72adc66a570ea99b3dc5bbf6aa99f4c4742fbdfebb81c07fc01bf0f7565fcfdf2380fccbe2ce2
|
7
|
+
data.tar.gz: f2352dc108e8ffa284b4a4505f5df7312f970771f573cfdf46bfa9d93090f2a88136c0e9bb39ab393ddcd8411dc8bacbd2e40d064ef5b5aa89f9acc6266acfc9
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Crystalball
|
2
2
|
|
3
|
-

|
4
|
+

|
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/
|
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/
|
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
|
-
|
25
|
+
start_coverage
|
25
26
|
yield example_map, example
|
26
|
-
paths = Coverage.result.keys
|
27
|
-
|
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
|
data/lib/crystalball/version.rb
CHANGED
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.
|
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-
|
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/
|
303
|
+
homepage: https://gitlab.com/gitlab-org/ruby/gems/crystalball
|
290
304
|
licenses: []
|
291
305
|
metadata:
|
292
|
-
bug_tracker_uri: https://gitlab.com/
|
293
|
-
changelog_uri: https://gitlab.com/
|
294
|
-
documentation_uri: https://gitlab.com/
|
295
|
-
source_code_uri: https://gitlab.com/
|
296
|
-
wiki_uri: https://gitlab.com/
|
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:
|