buildkite-test_collector 2.7.0 → 2.7.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 +5 -0
- data/CODEOWNERS +1 -1
- data/Gemfile.lock +1 -1
- data/README.md +6 -6
- data/buildkite-test_collector.gemspec +1 -1
- data/lib/buildkite/test_collector/library_hooks/rspec.rb +0 -1
- data/lib/buildkite/test_collector/version.rb +1 -1
- metadata +3 -4
- data/lib/buildkite/test_collector/test_links_plugin/formatter.rb +0 -62
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcfc8923f58efed71367663fffeff688fbfbf9eeb330b7876cc89b71fb3e72d7
|
4
|
+
data.tar.gz: 59df6ce58d186a12ef039a26aa372d96af142bc0f6ecd390767ec182737960d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fdc80dfdc84af033309dee9071334d5d5978d01d2515bdc3324dce5726146edb7d145867cec458232ccd9bc83c6da53638c9895f43daca3483eb19366a18c94
|
7
|
+
data.tar.gz: ae959e70dec2e553f72be5168b5df7fb69aa1e94c040fa6563f277cfcf98e979604b3e5e4fc23b413b61dac018d0628babbf8be0465e869f2ad678b9cb50bd4e
|
data/CHANGELOG.md
CHANGED
data/CODEOWNERS
CHANGED
@@ -1 +1 @@
|
|
1
|
-
* @buildkite/test-
|
1
|
+
* @buildkite/test-engine
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
**DEPRECATION NOTICE**
|
4
4
|
Versions prior to 2.1.x are unsupported and will not work after mid-2023. Please upgrade to the latest version.
|
5
5
|
|
6
|
-
Official [Buildkite Test
|
6
|
+
Official [Buildkite Test Engine](https://buildkite.com/platform/test-engine) collectors for Ruby test frameworks ✨
|
7
7
|
|
8
8
|
⚒ **Supported test frameworks:** RSpec, Minitest, and [more coming soon](https://github.com/buildkite/test-collector-ruby/issues?q=is%3Aissue+is%3Aopen+label%3A%22test+frameworks%22).
|
9
9
|
|
@@ -68,13 +68,13 @@ BUILDKITE_ANALYTICS_TOKEN=xyz rake
|
|
68
68
|
Add the `BUILDKITE_ANALYTICS_TOKEN` secret to your CI, push your changes to a branch, and open a pull request 🎉
|
69
69
|
|
70
70
|
```bash
|
71
|
-
git checkout -b add-buildkite-test-
|
72
|
-
git commit -am "Add Buildkite Test
|
73
|
-
git push origin add-buildkite-test-
|
71
|
+
git checkout -b add-buildkite-test-engine
|
72
|
+
git commit -am "Add Buildkite Test Engine"
|
73
|
+
git push origin add-buildkite-test-engine
|
74
74
|
```
|
75
75
|
|
76
76
|
### VCR
|
77
|
-
If your test suites use [VCR](https://github.com/vcr/vcr) to stub network requests, you'll need to modify the config to allow actual network requests to Test
|
77
|
+
If your test suites use [VCR](https://github.com/vcr/vcr) to stub network requests, you'll need to modify the config to allow actual network requests to Test Engine.
|
78
78
|
|
79
79
|
```
|
80
80
|
VCR.configure do |c|
|
@@ -119,7 +119,7 @@ And run the tests:
|
|
119
119
|
bundle exec rspec
|
120
120
|
```
|
121
121
|
|
122
|
-
Useful resources for developing collectors include the [Buildkite Test
|
122
|
+
Useful resources for developing collectors include the [Buildkite Test Engine docs](https://buildkite.com/docs/test-engine).
|
123
123
|
|
124
124
|
See [DESIGN.md](DESIGN.md) for an overview of the design of this gem.
|
125
125
|
|
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
|
|
8
8
|
spec.authors = ["Buildkite"]
|
9
9
|
spec.email = ["support+analytics@buildkite.com"]
|
10
10
|
|
11
|
-
spec.summary = "Track test executions and report to Buildkite Test
|
11
|
+
spec.summary = "Track test executions and report to Buildkite Test Engine"
|
12
12
|
spec.homepage = "https://github.com/buildkite/test-collector-ruby"
|
13
13
|
spec.license = "MIT"
|
14
14
|
|
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: 2.7.
|
4
|
+
version: 2.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Buildkite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -88,7 +88,6 @@ files:
|
|
88
88
|
- lib/buildkite/test_collector/rspec_plugin/reporter.rb
|
89
89
|
- lib/buildkite/test_collector/rspec_plugin/trace.rb
|
90
90
|
- lib/buildkite/test_collector/session.rb
|
91
|
-
- lib/buildkite/test_collector/test_links_plugin/formatter.rb
|
92
91
|
- lib/buildkite/test_collector/tracer.rb
|
93
92
|
- lib/buildkite/test_collector/uploader.rb
|
94
93
|
- lib/buildkite/test_collector/uuid.rb
|
@@ -118,5 +117,5 @@ requirements: []
|
|
118
117
|
rubygems_version: 3.5.11
|
119
118
|
signing_key:
|
120
119
|
specification_version: 4
|
121
|
-
summary: Track test executions and report to Buildkite Test
|
120
|
+
summary: Track test executions and report to Buildkite Test Engine
|
122
121
|
test_files: []
|
@@ -1,62 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Buildkite::TestCollector::TestLinksPlugin
|
4
|
-
class Formatter
|
5
|
-
RSpec::Core::Formatters.register self, :dump_failures
|
6
|
-
|
7
|
-
def initialize(output)
|
8
|
-
@output = output
|
9
|
-
end
|
10
|
-
|
11
|
-
def dump_failures(notification)
|
12
|
-
# Do not display summary if no failed examples
|
13
|
-
return if notification.failed_examples.empty?
|
14
|
-
|
15
|
-
# Check if a Test Analytics token is set
|
16
|
-
return unless Buildkite::TestCollector.api_token
|
17
|
-
|
18
|
-
metadata = fetch_metadata
|
19
|
-
|
20
|
-
# return if metadata was not fetched successfully
|
21
|
-
return if metadata.nil?
|
22
|
-
|
23
|
-
# return if suite url is nil
|
24
|
-
return if metadata['suite_url'].nil?
|
25
|
-
|
26
|
-
@output << "\n\n🔥 \x1b[31mTest Analytics failures 🔥\n"
|
27
|
-
@output << '_____________________________'
|
28
|
-
@output << "\n\n"
|
29
|
-
|
30
|
-
@output << notification.failed_examples.map do |example|
|
31
|
-
failed_example_output(example, metadata['suite_url'])
|
32
|
-
end.join("\n")
|
33
|
-
|
34
|
-
@output << "\n\n"
|
35
|
-
end
|
36
|
-
|
37
|
-
private
|
38
|
-
|
39
|
-
def generate_scope_name_digest(scope, name)
|
40
|
-
Digest::SHA256.hexdigest(scope + name)
|
41
|
-
end
|
42
|
-
|
43
|
-
def failed_example_output(example, url)
|
44
|
-
scope = example.example_group.metadata[:full_description]
|
45
|
-
name = example.description
|
46
|
-
scope_name_digest = generate_scope_name_digest(scope, name)
|
47
|
-
test_url = "#{url}/tests/#{scope_name_digest}"
|
48
|
-
"🔗 \x1b[4m\x1b[37m#{%(\x1b]1339;url=#{test_url};content="#{scope} #{name}"\x07)}\x1b[m"
|
49
|
-
end
|
50
|
-
|
51
|
-
def fetch_metadata
|
52
|
-
return unless Buildkite::TestCollector.api_token
|
53
|
-
|
54
|
-
http = Buildkite::TestCollector::HTTPClient.new(Buildkite::TestCollector.url)
|
55
|
-
response = http.metadata
|
56
|
-
|
57
|
-
JSON.parse(response.body) if response.code == '200'
|
58
|
-
rescue StandardError => e
|
59
|
-
# We don't need to output anything here
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|