confiner 0.2.2 → 0.2.3
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/lib/confiner/plugins/gitlab.rb +11 -3
- data/lib/confiner/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e9601fa7e82b448423188a4dde817864c6f7f57f1a1efd9aae67c1b2e8708c7
|
4
|
+
data.tar.gz: 23b2a999e52c58e5081fc9f4857e45a5a0c1783c0b1eca373f4ad4b57394a97f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48ad12ecefe1473ec4d481f3ebce5d325b9a0a052af1705a9a69621ea78a6d2fb5461fa4a068a83808943dc055f71fec936f54764894bc7a94de6e810e6bbb68
|
7
|
+
data.tar.gz: f74349e0a4003152ab16e7e86b4c34b77c58376ad7550fdf1796d4f7bd9633f0fc177abc56133607c4ce3c6108ca43b4598eacaf44eaa029c6127e301f80410b
|
@@ -36,11 +36,13 @@ module Confiner
|
|
36
36
|
# store the examples from the pipelines
|
37
37
|
@examples = get_examples
|
38
38
|
|
39
|
-
@examples.select(&:failed?).map(&:name).uniq.
|
39
|
+
quarantines = @examples.select(&:failed?).map(&:name).uniq.each_with_object([]) do |failed_example, quarantines|
|
40
40
|
# count the number of failures consecutively for this example
|
41
41
|
|
42
42
|
number_of_failures = @examples.select { _1.name == failed_example && _1.failed? }.size
|
43
43
|
if number_of_failures >= threshold
|
44
|
+
quarantines << failed_example
|
45
|
+
|
44
46
|
example = @examples.find { _1.name == failed_example }
|
45
47
|
|
46
48
|
log :quarantine, "Quarantining #{failed_example} (#{number_of_failures} >= #{threshold})", 3
|
@@ -69,6 +71,12 @@ module Confiner
|
|
69
71
|
end
|
70
72
|
end
|
71
73
|
|
74
|
+
if quarantines.any?
|
75
|
+
log :quarantine, "Found #{quarantines.size} candidates to be quarantined", 3
|
76
|
+
else
|
77
|
+
log :quarantine, 'Found no candidates to be quarantined', 3
|
78
|
+
end
|
79
|
+
|
72
80
|
log :gitlab, 'Done with Quarantine Process', 2
|
73
81
|
end
|
74
82
|
|
@@ -86,8 +94,8 @@ module Confiner
|
|
86
94
|
def get_last_n_runs(threshold:)
|
87
95
|
pipelines = [] # collection of both passing and failing pipelines
|
88
96
|
|
89
|
-
pipelines << @gitlab_client.pipelines(project_id, per_page: threshold, status: :success)
|
90
|
-
pipelines << @gitlab_client.pipelines(project_id, per_page: threshold, status: :failed)
|
97
|
+
pipelines << @gitlab_client.pipelines(project_id, per_page: threshold, status: :success, ref: ref)
|
98
|
+
pipelines << @gitlab_client.pipelines(project_id, per_page: threshold, status: :failed, ref: ref)
|
91
99
|
end
|
92
100
|
|
93
101
|
# Get examples from pipelines
|
data/lib/confiner/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: confiner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GitLab Quality
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-03-
|
11
|
+
date: 2022-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|