buildkite-test_collector 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/Gemfile.lock +2 -2
- data/lib/buildkite/test_collector/ci.rb +3 -1
- data/lib/buildkite/test_collector/minitest_plugin.rb +3 -3
- data/lib/buildkite/test_collector/tracer.rb +15 -5
- data/lib/buildkite/test_collector/version.rb +1 -1
- data/lib/buildkite/test_collector.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: 96fb0d0c08ff10d420388b2438ae199c7fbf72878d1fa5631c68b27e70f11cac
|
4
|
+
data.tar.gz: 78846d669900e535d1e03bd7494611dd124f2c1bae59471ad41b5b0d9f1efb1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7151f06cf10d7aeb296b9d8c9294f9cdab0b07fc01112176cdc28ad55f7b65d4aa51fcc21dfd179eb58bc6c69592583f58335dece7f3b46ac1e2ba7718da369
|
7
|
+
data.tar.gz: cb1157c4a4cfaa719d852f2ac271bd09bbd25a461b4f6a9c002063d7461e3bb06e8107342cceb77dada1cda8090c3643aa3e2827aac7355fea90b51bbae4f7f0
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# CHANGELOG
|
2
2
|
|
3
|
+
## v1.1.1
|
4
|
+
|
5
|
+
- Strip CR/LF from token input #127 - @gchan
|
6
|
+
- Allow specify run name prefix and suffix #130 - @juanitofatas
|
7
|
+
- Improve Minitest support by using after_teardown #131 - @davidstosik
|
8
|
+
- Avoid breaking test suite stubs `Process.clock_gettime` #132 - @juanitofatas (thanks @ChrisBR)
|
9
|
+
|
3
10
|
## v1.1.0
|
4
11
|
|
5
12
|
- Remove an internal debugging change #115 — @juanitofatas
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
buildkite-test_collector (1.1.
|
4
|
+
buildkite-test_collector (1.1.1)
|
5
5
|
activesupport (>= 5.2, < 8)
|
6
6
|
websocket (~> 1.2)
|
7
7
|
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
diff-lcs (1.4.4)
|
18
18
|
i18n (1.10.0)
|
19
19
|
concurrent-ruby (~> 1.0)
|
20
|
-
minitest (5.
|
20
|
+
minitest (5.16.1)
|
21
21
|
rake (13.0.6)
|
22
22
|
rspec (3.10.0)
|
23
23
|
rspec-core (~> 3.10.0)
|
@@ -39,7 +39,9 @@ class Buildkite::TestCollector::CI
|
|
39
39
|
"debug" => ENV["BUILDKITE_ANALYTICS_DEBUG_ENABLED"],
|
40
40
|
"version" => Buildkite::TestCollector::VERSION,
|
41
41
|
"collector" => Buildkite::TestCollector::NAME,
|
42
|
-
|
42
|
+
"run_name_prefix" => ENV["BUILDKITE_ANALYTICS_RUN_NAME_PREFIX"],
|
43
|
+
"run_name_suffix" => ENV["BUILDKITE_ANALYTICS_RUN_NAME_SUFFIX"],
|
44
|
+
}.compact
|
43
45
|
end
|
44
46
|
|
45
47
|
def generic
|
@@ -12,9 +12,7 @@ module Buildkite::TestCollector::MinitestPlugin
|
|
12
12
|
Thread.current[:_buildkite_tracer] = tracer
|
13
13
|
end
|
14
14
|
|
15
|
-
def
|
16
|
-
super
|
17
|
-
|
15
|
+
def after_teardown
|
18
16
|
tracer = Thread.current[:_buildkite_tracer]
|
19
17
|
if !tracer.nil?
|
20
18
|
Thread.current[:_buildkite_tracer] = nil
|
@@ -23,5 +21,7 @@ module Buildkite::TestCollector::MinitestPlugin
|
|
23
21
|
trace = Buildkite::TestCollector::MinitestPlugin::Trace.new(self, history: tracer.history)
|
24
22
|
Buildkite::TestCollector.uploader.traces[trace.source_location] = trace
|
25
23
|
end
|
24
|
+
|
25
|
+
super
|
26
26
|
end
|
27
27
|
end
|
@@ -4,6 +4,16 @@ require "active_support/core_ext/hash/indifferent_access"
|
|
4
4
|
|
5
5
|
module Buildkite::TestCollector
|
6
6
|
class Tracer
|
7
|
+
# https://github.com/buildkite/test-collector-ruby/issues/131
|
8
|
+
class MonotonicTime
|
9
|
+
GET_TIME = Process.method(:clock_gettime)
|
10
|
+
private_constant :GET_TIME
|
11
|
+
|
12
|
+
def self.call
|
13
|
+
GET_TIME.call Process::CLOCK_MONOTONIC
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
7
17
|
class Span
|
8
18
|
attr_accessor :section, :start_at, :end_at, :detail, :children
|
9
19
|
|
@@ -28,23 +38,23 @@ module Buildkite::TestCollector
|
|
28
38
|
end
|
29
39
|
|
30
40
|
def initialize
|
31
|
-
@top = Span.new(:top,
|
41
|
+
@top = Span.new(:top, MonotonicTime.call, nil, {})
|
32
42
|
@stack = [@top]
|
33
43
|
end
|
34
44
|
|
35
45
|
def enter(section, **detail)
|
36
|
-
new_entry = Span.new(section,
|
46
|
+
new_entry = Span.new(section, MonotonicTime.call, nil, detail)
|
37
47
|
current_span.children << new_entry
|
38
48
|
@stack << new_entry
|
39
49
|
end
|
40
50
|
|
41
51
|
def leave
|
42
|
-
current_span.end_at =
|
52
|
+
current_span.end_at = MonotonicTime.call
|
43
53
|
@stack.pop
|
44
54
|
end
|
45
55
|
|
46
56
|
def backfill(section, duration, **detail)
|
47
|
-
new_entry = Span.new(section,
|
57
|
+
new_entry = Span.new(section, MonotonicTime.call - duration, MonotonicTime.call, detail)
|
48
58
|
current_span.children << new_entry
|
49
59
|
end
|
50
60
|
|
@@ -54,7 +64,7 @@ module Buildkite::TestCollector
|
|
54
64
|
|
55
65
|
def finalize
|
56
66
|
raise "Stack not empty" unless @stack.size == 1
|
57
|
-
@top.end_at =
|
67
|
+
@top.end_at = MonotonicTime.call
|
58
68
|
self
|
59
69
|
end
|
60
70
|
|
@@ -23,7 +23,7 @@ module Buildkite
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def self.configure(hook:, token: nil, url: nil, debug_enabled: false, tracing_enabled: true)
|
26
|
-
self.api_token = token || ENV["BUILDKITE_ANALYTICS_TOKEN"]
|
26
|
+
self.api_token = (token || ENV["BUILDKITE_ANALYTICS_TOKEN"])&.strip
|
27
27
|
self.url = url || DEFAULT_URL
|
28
28
|
self.debug_enabled = debug_enabled || !!(ENV["BUILDKITE_ANALYTICS_DEBUG_ENABLED"])
|
29
29
|
self.tracing_enabled = tracing_enabled
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: buildkite-test_collector
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Buildkite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|