duel 0.1.1 → 0.1.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/CHANGELOG.md +67 -1
- data/README.md +20 -2
- data/docs/ci.md +495 -61
- data/docs/configuration.md +80 -0
- data/docs/how-it-works.md +4 -1
- data/lib/duel/baseline.rb +30 -4
- data/lib/duel/cli.rb +170 -28
- data/lib/duel/config.rb +71 -0
- data/lib/duel/init.rb +41 -7
- data/lib/duel/runner.rb +1 -1
- data/lib/duel/summary.rb +5 -3
- data/lib/duel/templates/duel.gitlab-ci.yml.erb +148 -0
- data/lib/duel/templates/duel.rb.erb +13 -0
- data/lib/duel/templates/perf-comment.yml.erb +59 -0
- data/lib/duel/templates/perf.yml.erb +116 -46
- data/lib/duel/version.rb +1 -1
- data/sig/duel/baseline.rbs +14 -1
- data/sig/duel/cli.rbs +64 -2
- data/sig/duel/config.rbs +36 -0
- data/sig/duel/init.rbs +13 -0
- data/sig/duel/runner.rbs +15 -3
- data/sig/duel/summary.rbs +3 -1
- metadata +3 -1
data/sig/duel/config.rbs
CHANGED
|
@@ -13,6 +13,12 @@ module Duel
|
|
|
13
13
|
# When the workflow comments on a pull request (see #comment).
|
|
14
14
|
type comment = :always | :results | :failures | :never
|
|
15
15
|
|
|
16
|
+
# Which runs a regression fails (see #fail_on).
|
|
17
|
+
type fail_on = :every_run | :pull_requests
|
|
18
|
+
|
|
19
|
+
# What a push is compared with (see #push_base).
|
|
20
|
+
type push_base = :before | :last_passed
|
|
21
|
+
|
|
16
22
|
@root: String
|
|
17
23
|
@benchmarks: String
|
|
18
24
|
@watch: Array[String]
|
|
@@ -23,6 +29,9 @@ module Duel
|
|
|
23
29
|
@prepares: Hash[Symbol, Array[prepare]]
|
|
24
30
|
@ruby: ruby
|
|
25
31
|
@comment: comment
|
|
32
|
+
@fail_on: fail_on
|
|
33
|
+
@push_base: push_base
|
|
34
|
+
@accept_label: String?
|
|
26
35
|
@metrics: Array[singleton(Metric)]
|
|
27
36
|
@in_workers: Array[^(Stops stops) -> void]
|
|
28
37
|
@hooks: Hash[Symbol, Array[hook]]
|
|
@@ -67,6 +76,33 @@ module Duel
|
|
|
67
76
|
# Sets #comment, or fails for a value it doesn't take.
|
|
68
77
|
def comment=: (untyped mode) -> untyped
|
|
69
78
|
|
|
79
|
+
# Which runs a regression fails: :every_run (the default), or
|
|
80
|
+
# :pull_requests.
|
|
81
|
+
attr_reader fail_on: fail_on
|
|
82
|
+
|
|
83
|
+
# The values #fail_on takes.
|
|
84
|
+
FAIL_ON: Array[fail_on]
|
|
85
|
+
|
|
86
|
+
# Sets #fail_on, or fails for a value it doesn't take.
|
|
87
|
+
def fail_on=: (untyped runs) -> untyped
|
|
88
|
+
|
|
89
|
+
# The name of a label that accepts a regression in a pull request, or
|
|
90
|
+
# nil (the default) for none.
|
|
91
|
+
attr_reader accept_label: String?
|
|
92
|
+
|
|
93
|
+
# Sets #accept_label, or fails for what isn't a name or nil.
|
|
94
|
+
def accept_label=: (untyped label) -> untyped
|
|
95
|
+
|
|
96
|
+
# What a push is compared with: :before (the default), the commit
|
|
97
|
+
# before it, or :last_passed, the last commit Duel passed.
|
|
98
|
+
attr_reader push_base: push_base
|
|
99
|
+
|
|
100
|
+
# The values #push_base takes.
|
|
101
|
+
PUSH_BASES: Array[push_base]
|
|
102
|
+
|
|
103
|
+
# Sets #push_base, or fails for a value it doesn't take.
|
|
104
|
+
def push_base=: (untyped base) -> untyped
|
|
105
|
+
|
|
70
106
|
# What #prepare was given, by scope.
|
|
71
107
|
# @api private
|
|
72
108
|
attr_reader prepares: Hash[Symbol, Array[prepare]]
|
data/sig/duel/init.rbs
CHANGED
|
@@ -21,6 +21,7 @@ module Duel
|
|
|
21
21
|
@root: String
|
|
22
22
|
@force: bool?
|
|
23
23
|
@dry_run: bool?
|
|
24
|
+
@gitlab: bool?
|
|
24
25
|
@stackprof: bool?
|
|
25
26
|
|
|
26
27
|
def initialize: (Array[String] argv, ?out: _Output, ?err: _Output, ?root: String) -> void
|
|
@@ -99,5 +100,17 @@ module Duel
|
|
|
99
100
|
|
|
100
101
|
# What marks the workflow's comment on a pull request.
|
|
101
102
|
def marker: () -> String
|
|
103
|
+
|
|
104
|
+
# The branch that marks the last commit Duel passed in a push.
|
|
105
|
+
def passed_branch: () -> String
|
|
106
|
+
|
|
107
|
+
# Where the GitLab CI jobs are, from the repository's root.
|
|
108
|
+
def gitlab_file: () -> String
|
|
109
|
+
|
|
110
|
+
# The GitLab CI job's name.
|
|
111
|
+
def gitlab_job: () -> String
|
|
112
|
+
|
|
113
|
+
# The Ruby image's tag for GitLab CI.
|
|
114
|
+
def gitlab_ruby: () -> String
|
|
102
115
|
end
|
|
103
116
|
end
|
data/sig/duel/runner.rbs
CHANGED
|
@@ -18,7 +18,7 @@ module Duel
|
|
|
18
18
|
|
|
19
19
|
# How a run is set up (see Duel::CLI for where each comes from).
|
|
20
20
|
# @api private
|
|
21
|
-
class Settings < Struct[String | Regexp | Integer | Float | bool | Config::ruby | Config::comment | nil]
|
|
21
|
+
class Settings < Struct[String | Regexp | Integer | Float | bool | Config::ruby | Config::comment | Config::fail_on | nil]
|
|
22
22
|
attr_accessor base: String?
|
|
23
23
|
attr_accessor base_dir: String?
|
|
24
24
|
attr_accessor candidate_dir: String?
|
|
@@ -36,13 +36,25 @@ module Duel
|
|
|
36
36
|
# When the workflow comments on a pull request (--comment), over
|
|
37
37
|
# Config#comment.
|
|
38
38
|
attr_accessor comment: Config::comment?
|
|
39
|
+
# Which runs a regression fails (--fail-on), over Config#fail_on.
|
|
40
|
+
attr_accessor fail_on: Config::fail_on?
|
|
41
|
+
# The branch pushed, where #base is the push's, the commit before it,
|
|
42
|
+
# on GitHub Actions (DUEL_BASE): see Baseline#ref.
|
|
43
|
+
attr_accessor pushed: String?
|
|
44
|
+
# The branch a pull request targets, on GitHub Actions
|
|
45
|
+
# (GITHUB_BASE_REF), on origin: see Baseline#main_branch.
|
|
46
|
+
attr_accessor target: String?
|
|
39
47
|
|
|
40
48
|
def self.new: (?String? base, ?String? base_dir, ?String? candidate_dir, ?Regexp filter, ?Integer jobs,
|
|
41
49
|
?Integer processes, ?Float limit, ?Float confidence, ?Float? warm, ?bool force, ?String? config_path,
|
|
42
|
-
?Float timeout, ?Config::ruby ruby, ?Config::comment? comment
|
|
50
|
+
?Float timeout, ?Config::ruby ruby, ?Config::comment? comment,
|
|
51
|
+
?Config::fail_on? fail_on, ?String? pushed,
|
|
52
|
+
?String? target) -> instance
|
|
43
53
|
| (?base: String?, ?base_dir: String?, ?candidate_dir: String?, ?filter: Regexp, ?jobs: Integer,
|
|
44
54
|
?processes: Integer, ?limit: Float, ?confidence: Float, ?warm: Float?, ?force: bool,
|
|
45
|
-
?config_path: String?, ?timeout: Float, ?ruby: Config::ruby, ?comment: Config::comment
|
|
55
|
+
?config_path: String?, ?timeout: Float, ?ruby: Config::ruby, ?comment: Config::comment?,
|
|
56
|
+
?fail_on: Config::fail_on?, ?pushed: String?,
|
|
57
|
+
?target: String?) -> instance
|
|
46
58
|
|
|
47
59
|
def self.defaults: () -> Settings
|
|
48
60
|
end
|
data/sig/duel/summary.rbs
CHANGED
|
@@ -25,6 +25,7 @@ module Duel
|
|
|
25
25
|
# How Duel decides that a timing is slower, in its docs.
|
|
26
26
|
DECIDES: String
|
|
27
27
|
|
|
28
|
+
@note: String?
|
|
28
29
|
@runner: Runner
|
|
29
30
|
@results: Array[Result]
|
|
30
31
|
@settings: Settings
|
|
@@ -51,7 +52,8 @@ module Duel
|
|
|
51
52
|
# The counted measures that differ, an iteration.
|
|
52
53
|
def self.changed_counts: (Result result) -> Hash[String, [Float, Float]]
|
|
53
54
|
|
|
54
|
-
def initialize: (Runner runner, Array[Result] results, settings: Settings, baseline: String, candidate: String
|
|
55
|
+
def initialize: (Runner runner, Array[Result] results, settings: Settings, baseline: String, candidate: String,
|
|
56
|
+
?note: String?) -> void
|
|
55
57
|
|
|
56
58
|
# The Markdown.
|
|
57
59
|
def markdown: () -> String
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: duel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Erik Berlin
|
|
@@ -68,7 +68,9 @@ files:
|
|
|
68
68
|
- lib/duel/stats.rb
|
|
69
69
|
- lib/duel/summary.rb
|
|
70
70
|
- lib/duel/templates/benchmark_duel.rb.erb
|
|
71
|
+
- lib/duel/templates/duel.gitlab-ci.yml.erb
|
|
71
72
|
- lib/duel/templates/duel.rb.erb
|
|
73
|
+
- lib/duel/templates/perf-comment.yml.erb
|
|
72
74
|
- lib/duel/templates/perf.yml.erb
|
|
73
75
|
- lib/duel/testing.rb
|
|
74
76
|
- lib/duel/version.rb
|