buildkite-test_collector 2.7.0 → 2.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -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 -2
- 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: 031c438a0a80bcd10c351184efb4749618f5bf65d94518454cfe4d105c3d0f05
|
4
|
+
data.tar.gz: aeb85765c74bd2e59c4daa11270fcd807aa4964f9eea985ae0587075bdb437d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38352feb0b55450da89472f06f883bd565b4ee6ac4c7f14ff8dfb7456621626c404868d25c7348676db2b288948f65bad26b6d40308097800583960150f0f4b8
|
7
|
+
data.tar.gz: a7500ee72f134530e3b7254dfe3391604edea02937d2e762349e8ea242be0d55c46c48d3563fdfe909aeee9475575fc4815a7e36bd3105188e8fd36cb1aa8b9b
|
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
|
|
@@ -5,14 +5,12 @@ require "rspec/expectations"
|
|
5
5
|
|
6
6
|
require_relative "../rspec_plugin/reporter"
|
7
7
|
require_relative "../rspec_plugin/trace"
|
8
|
-
require_relative "../test_links_plugin/formatter"
|
9
8
|
|
10
9
|
Buildkite::TestCollector.uploader = Buildkite::TestCollector::Uploader
|
11
10
|
|
12
11
|
RSpec.configure do |config|
|
13
12
|
config.before(:suite) do
|
14
13
|
config.add_formatter Buildkite::TestCollector::RSpecPlugin::Reporter
|
15
|
-
config.add_formatter Buildkite::TestCollector::TestLinksPlugin::Formatter
|
16
14
|
end
|
17
15
|
|
18
16
|
config.around(:each) do |example|
|
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.2
|
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-16 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
|