buildkite-test_collector 2.15.0 → 2.17.0
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/.buildkite/pipeline.release.yml +13 -7
- data/.buildkite/steps/release +9 -7
- data/CHANGELOG.md +112 -0
- data/README.md +25 -89
- data/buildkite-test_collector.gemspec +7 -2
- data/docs/opentelemetry.md +351 -132
- data/exe/buildkite-rspec +6 -0
- data/lib/buildkite/rspec_runner.rb +301 -0
- data/lib/buildkite/test_collector/ci.rb +1 -1
- data/lib/buildkite/test_collector/library_hooks/rspec.rb +12 -11
- data/lib/buildkite/test_collector/otel/child_span_forwarder.rb +105 -0
- data/lib/buildkite/test_collector/otel/child_span_metrics_reporter.rb +24 -0
- data/lib/buildkite/test_collector/otel/span_filter.rb +55 -0
- data/lib/buildkite/test_collector/otel/span_metrics_reporter.rb +69 -0
- data/lib/buildkite/test_collector/otel/test_span_metrics_reporter.rb +32 -0
- data/lib/buildkite/test_collector/otel.rb +559 -228
- data/lib/buildkite/test_collector/rspec_plugin/phase_spans.rb +85 -0
- data/lib/buildkite/test_collector/rspec_plugin/reporter.rb +29 -26
- data/lib/buildkite/test_collector/rspec_plugin/trace.rb +8 -11
- data/lib/buildkite/test_collector/trace.rb +1 -3
- data/lib/buildkite/test_collector/version.rb +1 -1
- data/lib/buildkite/test_collector.rb +47 -58
- metadata +31 -8
- data/lib/buildkite/test_collector/otel/execution_child_forwarder.rb +0 -62
- data/lib/buildkite/test_collector/otel/root_span_metrics_reporter.rb +0 -37
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f40dec372895345d99af434be7e214f1cc9009643a904b20f78d7bb158be935d
|
|
4
|
+
data.tar.gz: ac03c35d84ba8bb8c80fa850284f3a29387861872503d1bc9419de85d7b74f6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c2a1da6bb295a35862e55e31c99551484d21adedf5e9cc4b71e2387a6480097640314b746c7927b86847737435ba0e7a5e2153640627716489c8e50707b72b27
|
|
7
|
+
data.tar.gz: 57646e4a9e9f13045e257a838f450f43331c24c9f6f6161168bfa36687bff5586cef1abff0525232df99006fbfeebf5167bfcf18882ab806b35d571d3feecc96
|
|
@@ -12,13 +12,15 @@
|
|
|
12
12
|
# - The build step is side-effect-free: it builds the gem, checks
|
|
13
13
|
# tag/version consistency, and queries RubyGems read-only. It runs on
|
|
14
14
|
# every rehearsal, so rehearsals exercise the release code. It never sees
|
|
15
|
-
#
|
|
15
|
+
# RELEASE_PUBLISH (set only on the publish step below), so it stops
|
|
16
|
+
# before `gem push` even on tag builds.
|
|
16
17
|
# - The publish steps mint a push token via the rubygems.org OIDC API key
|
|
17
18
|
# role, whose access policy trusts this pipeline (see the credential
|
|
18
19
|
# cut-over section of ctg docs/publishing.md).
|
|
19
|
-
# - The publish
|
|
20
|
-
# tag
|
|
21
|
-
# the release script independently re-checks
|
|
20
|
+
# - The publish step exists only on an exact test-collector-ruby/vX.Y.Z
|
|
21
|
+
# tag, behind a block step; it sets RELEASE_PUBLISH=true in its own
|
|
22
|
+
# environment, and the release script independently re-checks the tag
|
|
23
|
+
# and RELEASE_PUBLISH before `gem push`.
|
|
22
24
|
|
|
23
25
|
agents:
|
|
24
26
|
queue: hosted
|
|
@@ -35,13 +37,17 @@ steps:
|
|
|
35
37
|
|
|
36
38
|
- block: ":rocket: Publish test-collector-ruby to RubyGems?"
|
|
37
39
|
key: ruby-confirm
|
|
38
|
-
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
40
|
+
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
39
41
|
|
|
40
42
|
- label: ":rubygems: test-collector-ruby: publish to RubyGems"
|
|
41
|
-
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
43
|
+
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
42
44
|
depends_on:
|
|
43
45
|
- ruby-build
|
|
44
46
|
- ruby-confirm
|
|
47
|
+
env:
|
|
48
|
+
# Step-local publish signal: distinguishes this credentialed step from
|
|
49
|
+
# the rehearsal build step, which runs the same script.
|
|
50
|
+
RELEASE_PUBLISH: "true"
|
|
45
51
|
command: test-collector-ruby/.buildkite/steps/release
|
|
46
52
|
plugins:
|
|
47
53
|
- rubygems-oidc#v0.2.0:
|
|
@@ -51,4 +57,4 @@ steps:
|
|
|
51
57
|
environment:
|
|
52
58
|
- GEM_HOST_API_KEY
|
|
53
59
|
- BUILDKITE_TAG
|
|
54
|
-
-
|
|
60
|
+
- RELEASE_PUBLISH
|
data/.buildkite/steps/release
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# Monorepo release script for test-collector-ruby: build the gem, check
|
|
3
|
-
# tag/version consistency and RubyGems state, then publish — but
|
|
4
|
-
#
|
|
5
|
-
#
|
|
6
|
-
#
|
|
3
|
+
# tag/version consistency and RubyGems state, then publish — but only in
|
|
4
|
+
# the publish step, which sets RELEASE_PUBLISH=true in its own container
|
|
5
|
+
# (see pipeline.release.yml); the pre-confirmation build step runs this
|
|
6
|
+
# same script as a side-effect-free rehearsal, even on tag builds.
|
|
7
|
+
# Everything before the push runs in rehearsals too, so dry-runs exercise
|
|
8
|
+
# this code.
|
|
7
9
|
#
|
|
8
10
|
# Injected by `ctg gather` from the ctg repo's overlay/ directory during the
|
|
9
11
|
# dry-run era; post-cutover this file is maintained here, in the monorepo.
|
|
@@ -50,15 +52,15 @@ else
|
|
|
50
52
|
echo "${GEM_NAME} ${VERSION} is not on rubygems.org (HTTP ${STATUS})"
|
|
51
53
|
fi
|
|
52
54
|
|
|
53
|
-
if [ "${
|
|
55
|
+
if [ "${RELEASE_PUBLISH:-}" != "true" ]; then
|
|
54
56
|
echo "--- Rehearsal only"
|
|
55
|
-
echo "
|
|
57
|
+
echo "RELEASE_PUBLISH is not 'true': stopping before 'gem push ${GEM_FILENAME}'."
|
|
56
58
|
exit 0
|
|
57
59
|
fi
|
|
58
60
|
|
|
59
61
|
echo "--- Publishing ${GEM_FILENAME} to RubyGems"
|
|
60
62
|
if [ -z "${BUILDKITE_TAG:-}" ]; then
|
|
61
|
-
echo "
|
|
63
|
+
echo "RELEASE_PUBLISH=true without a ${PROJECT}/vX.Y.Z tag; refusing" >&2
|
|
62
64
|
exit 1
|
|
63
65
|
fi
|
|
64
66
|
if [ "${ALREADY_PUBLISHED}" = "true" ]; then
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,117 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## v2.17.0
|
|
6
|
+
|
|
7
|
+
* Export an OpenTelemetry `test.execution` span for examples that RSpec fails
|
|
8
|
+
without running them, such as every example under a failing
|
|
9
|
+
`before(:context)` hook. These spans carry the failure but time only its
|
|
10
|
+
reporting and have no phase spans.
|
|
11
|
+
* Keep OpenTelemetry test span and event attributes (execution identity, result,
|
|
12
|
+
and failure detail) when the process sets `OTEL_ATTRIBUTE_COUNT_LIMIT`,
|
|
13
|
+
`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`, or `OTEL_EVENT_ATTRIBUTE_COUNT_LIMIT`
|
|
14
|
+
below the collector's needs.
|
|
15
|
+
* `buildkite-rspec` writes formatter `--out` files per batch instead of
|
|
16
|
+
overwriting them, so earlier batches' output is no longer lost. A `%{batch}`
|
|
17
|
+
placeholder in the path is replaced with the batch ID; otherwise the file name
|
|
18
|
+
is prefixed with it (`--out tmp/rspec.json` writes `tmp/<batch>-rspec.json`).
|
|
19
|
+
This applies to command-line and options-file formatters.
|
|
20
|
+
|
|
21
|
+
* Add `test.setup`, `test.body`, and `test.teardown` phase spans under each
|
|
22
|
+
OpenTelemetry `test.execution` span. Instrumented child spans nest under the
|
|
23
|
+
phase they ran in, each phase records its failures, and phase spans bypass
|
|
24
|
+
`otel_span_filter`. Only phases that grouped a span or failed are exported,
|
|
25
|
+
so examples with no instrumented work add no child spans.
|
|
26
|
+
`Buildkite::TestCollector.annotate` records on the `test.execution` span
|
|
27
|
+
rather than the current span, and does nothing outside an example.
|
|
28
|
+
* Send a `Buildkite-Tests-Span-Stream` header on every OpenTelemetry export:
|
|
29
|
+
`test` on requests carrying `test.execution` spans and `child` on requests
|
|
30
|
+
carrying child and phase spans. Relays between the collector and Buildkite
|
|
31
|
+
should forward it.
|
|
32
|
+
|
|
33
|
+
## v2.16.0
|
|
34
|
+
|
|
35
|
+
* Report `code.line.number` for shared example inclusions (`it_behaves_like`,
|
|
36
|
+
`include_examples`, `include_context`) in OpenTelemetry test spans; the line
|
|
37
|
+
was previously omitted because RSpec's inclusion location includes the frame
|
|
38
|
+
label.
|
|
39
|
+
* Prevent OpenTelemetry export failures outside `StandardError`, including
|
|
40
|
+
WebMock network-blocking errors, from failing the test suite.
|
|
41
|
+
* Add the OTLP endpoint host to WebMock's allow list when WebMock is loaded.
|
|
42
|
+
* Validate OpenTelemetry run keys before export and fall back to the JSON upload
|
|
43
|
+
with a warning when they are invalid (or report that results cannot be
|
|
44
|
+
uploaded when no JSON token is available).
|
|
45
|
+
* Ignore empty `BUILDKITE_ANALYTICS_*` metadata overrides so they do not replace
|
|
46
|
+
values detected from the CI environment.
|
|
47
|
+
* Read bktec's relay credential from `BUILDKITE_TESTS_OTLP_TOKEN` and stop
|
|
48
|
+
reading `OTEL_EXPORTER_OTLP_*_HEADERS`, so credentials the process configures
|
|
49
|
+
for other OpenTelemetry destinations are never sent to Buildkite.
|
|
50
|
+
* Pin OpenTelemetry export to gzip, peer-verified HTTPS, and the system
|
|
51
|
+
certificate store, ignoring process-wide `OTEL_EXPORTER_OTLP_*` transport
|
|
52
|
+
overrides. Requires `opentelemetry-exporter-otlp` 0.29+; older versions fall
|
|
53
|
+
back to the JSON upload with a warning.
|
|
54
|
+
* Reduce the experimental OpenTelemetry test span batch size from 512 to 120 so
|
|
55
|
+
a batch of failures with maximum-length output fits the server's 900 KiB
|
|
56
|
+
request limit. Override the batch and queue sizes with
|
|
57
|
+
`BUILDKITE_TESTS_OTEL_TEST_SPAN_BATCH_SIZE` and
|
|
58
|
+
`BUILDKITE_TESTS_OTEL_TEST_SPAN_QUEUE_SIZE`; invalid values warn and use
|
|
59
|
+
the defaults.
|
|
60
|
+
* Override the OpenTelemetry child span batch and queue sizes with
|
|
61
|
+
`BUILDKITE_TESTS_OTEL_CHILD_SPAN_BATCH_SIZE` and
|
|
62
|
+
`BUILDKITE_TESTS_OTEL_CHILD_SPAN_QUEUE_SIZE`, and warn when child spans are
|
|
63
|
+
dropped instead of discarding them silently. `test.execution` results are
|
|
64
|
+
unaffected by child span drops.
|
|
65
|
+
* Set every OpenTelemetry batch processor option explicitly, including the export
|
|
66
|
+
timeout and starting the export thread on boot, so `OTEL_BSP_*` and
|
|
67
|
+
`OTEL_RUBY_BSP_START_THREAD_ON_BOOT` no longer affect Buildkite export.
|
|
68
|
+
* Truncate OpenTelemetry test span attributes to 10,243 characters (test names
|
|
69
|
+
keep the same identity as the JSON upload), exception messages to 10,243
|
|
70
|
+
characters, other event attributes to 16,384 characters, events to the newest
|
|
71
|
+
100 per span, and the failure summary in the span status to 1,024 characters.
|
|
72
|
+
* **Breaking change to the experimental OpenTelemetry support:** opt-in
|
|
73
|
+
submission is now OTLP-only for RSpec. `otel_enabled: true` submits executions
|
|
74
|
+
as spans without also uploading legacy JSON, and the separate `otel_only`
|
|
75
|
+
option has been removed (passing it now raises `ArgumentError`). OpenTelemetry
|
|
76
|
+
remains off by default, so suites that never opted in are unaffected. When
|
|
77
|
+
OpenTelemetry cannot be used, the collector warns and uploads JSON instead:
|
|
78
|
+
at configure time for a non-RSpec hook, and at suite start when the
|
|
79
|
+
OpenTelemetry gems are missing or Ruby is older than 3.3. Without a token,
|
|
80
|
+
`otel_enabled` stays off and nothing is exported, the same as the JSON path,
|
|
81
|
+
which skips uploading without a token. When only `BUILDKITE_TESTS_OTLP_TOKEN`
|
|
82
|
+
held the credential, the fallback warning says results will not be uploaded,
|
|
83
|
+
since the JSON path has no token to use. Execution name
|
|
84
|
+
affixes (`BUILDKITE_ANALYTICS_EXECUTION_NAME_PREFIX`/`SUFFIX`) and custom
|
|
85
|
+
`env:` values have no OTLP equivalent and are not sent when `otel_enabled` is
|
|
86
|
+
on; the JSON upload that carried them in the old dual mode no longer happens.
|
|
87
|
+
* **Breaking change to the experimental OpenTelemetry support:** remove the
|
|
88
|
+
`otel_instrumentations` option (passing it now raises `ArgumentError`). It
|
|
89
|
+
only accepted `nil` or `[]`, and `[]` skipped installing the instrumentation
|
|
90
|
+
gems the suite had already required. Choose instrumentation by requiring the
|
|
91
|
+
gems you want; the collector installs every registered instrumentation when it
|
|
92
|
+
configures the SDK, and installs none when the suite configures the SDK
|
|
93
|
+
itself. There is no replacement switch that disables all instrumentation at
|
|
94
|
+
once: to skip one gem your bundle requires anyway, set the SDK's
|
|
95
|
+
`OTEL_RUBY_INSTRUMENTATION_<NAME>_ENABLED=false`; to skip them all, configure
|
|
96
|
+
the SDK yourself without `use_all` (see [Choosing
|
|
97
|
+
instrumentation](docs/opentelemetry.md#choosing-instrumentation)).
|
|
98
|
+
* Warn prominently, usually naming the HTTP status or connection error, the first
|
|
99
|
+
time Buildkite rejects or the collector drops `test.execution` spans, since
|
|
100
|
+
OTLP is now the only upload path. A test span that could not be started counts
|
|
101
|
+
as dropped too. When more are dropped after that, report the total at the
|
|
102
|
+
suite-end flush and again at process exit for anything still draining.
|
|
103
|
+
* Keep stable suite, CI worker/run, and VCS identity on OpenTelemetry resources,
|
|
104
|
+
while moving Test Engine run metadata, framework details, and configured tags
|
|
105
|
+
to each `test.execution` span. Child spans no longer carry execution-only
|
|
106
|
+
metadata as duplicated resource attributes.
|
|
107
|
+
* Send the Ruby version and configured location prefix with OpenTelemetry test
|
|
108
|
+
executions so OTLP-only uploads retain their classic upload tags and selector
|
|
109
|
+
paths.
|
|
110
|
+
* Add `otel_span_filter` to drop selected OpenTelemetry child spans before they
|
|
111
|
+
are queued for export. `test.execution` spans are never filtered, and a
|
|
112
|
+
filter that fails retains the span and warns once. Passing a value that does
|
|
113
|
+
not respond to `call` raises `ArgumentError` at configure time.
|
|
114
|
+
|
|
3
115
|
## v2.15.0
|
|
4
116
|
|
|
5
117
|
* Add [experimental, opt-in OpenTelemetry trace export](docs/opentelemetry.md)
|
data/README.md
CHANGED
|
@@ -5,7 +5,7 @@ Versions prior to 2.1.x are unsupported and will not work after mid-2023. Please
|
|
|
5
5
|
|
|
6
6
|
Official [Buildkite Test Engine](https://buildkite.com/platform/test-engine) collectors for Ruby test frameworks ✨
|
|
7
7
|
|
|
8
|
-
⚒ **Supported test frameworks:** RSpec, Minitest, Cucumber, and [more coming soon](https://github.com/buildkite/
|
|
8
|
+
⚒ **Supported test frameworks:** RSpec, Minitest, Cucumber, and [more coming soon](https://github.com/buildkite/bktest/issues).
|
|
9
9
|
|
|
10
10
|
📦 **Supported CI systems:** Buildkite, GitHub Actions, CircleCI, Codeship, and others via the `BUILDKITE_ANALYTICS_*` environment variables.
|
|
11
11
|
|
|
@@ -83,102 +83,38 @@ BUILDKITE_ANALYTICS_TOKEN=xyz cucumber
|
|
|
83
83
|
|
|
84
84
|
Add the `BUILDKITE_ANALYTICS_TOKEN` secret to your CI, push your changes to a branch, and open a pull request 🎉
|
|
85
85
|
|
|
86
|
-
### OpenTelemetry
|
|
86
|
+
### OpenTelemetry submission (experimental)
|
|
87
87
|
|
|
88
|
-
RSpec suites can
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
RSpec suites can submit each test execution as an OpenTelemetry trace. Each
|
|
89
|
+
trace is rooted in a `test.execution` span carrying the test's name, location,
|
|
90
|
+
result, and failure detail. Phase spans underneath it, `test.setup`,
|
|
91
|
+
`test.body`, and `test.teardown`, group the instrumented child spans by whether
|
|
92
|
+
they ran in before hooks, the example itself, or after hooks, and each records
|
|
93
|
+
the failure raised in its phase. A phase with no spans and no failure is not
|
|
94
|
+
exported.
|
|
93
95
|
|
|
94
|
-
This feature is still under development and may change.
|
|
95
|
-
|
|
96
|
-
with an existing OpenTelemetry setup, but that configuration is not yet
|
|
97
|
-
supported or guaranteed to work.
|
|
98
|
-
|
|
99
|
-
OpenTelemetry export is off by default. Opt in when you configure the collector:
|
|
96
|
+
This feature is still under development and may change. OpenTelemetry is off by
|
|
97
|
+
default. Enable it when you configure the collector:
|
|
100
98
|
|
|
101
99
|
```ruby
|
|
102
100
|
Buildkite::TestCollector.configure(hook: :rspec, otel_enabled: true)
|
|
103
101
|
```
|
|
104
102
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
The collector configures a global provider for child spans and installs all
|
|
109
|
-
applicable instrumentation registered when the suite starts. Because export is
|
|
110
|
-
optional and its dependencies require Ruby 3.3+, the collector does not install
|
|
111
|
-
them automatically. Add the OpenTelemetry SDK and OTLP exporter, plus any
|
|
112
|
-
instrumentation you want to use:
|
|
113
|
-
|
|
114
|
-
```ruby
|
|
115
|
-
# Gemfile
|
|
116
|
-
gem "opentelemetry-exporter-otlp", "~> 0.34", require: false
|
|
117
|
-
gem "opentelemetry-sdk", "~> 1.13", require: false
|
|
118
|
-
gem "opentelemetry-instrumentation-pg", require: false
|
|
119
|
-
|
|
120
|
-
# spec/spec_helper.rb
|
|
121
|
-
require "opentelemetry-instrumentation-pg"
|
|
122
|
-
require "buildkite/test_collector"
|
|
123
|
-
|
|
124
|
-
Buildkite::TestCollector.configure(hook: :rspec, otel_enabled: true)
|
|
125
|
-
```
|
|
103
|
+
When enabled, OpenTelemetry is the only submission path. Every `test.execution` span includes
|
|
104
|
+
`buildkite.execution.via=otlp`, which tells Buildkite to synthesize the test
|
|
105
|
+
execution from the span. Nothing is uploaded to `/v1/uploads`.
|
|
126
106
|
|
|
127
|
-
|
|
128
|
-
`
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
reserved for a future release and disables span export with a warning. See the
|
|
132
|
-
[OpenTelemetry guide](docs/opentelemetry.md#choosing-instrumentation) for more.
|
|
133
|
-
|
|
134
|
-
Export needs Ruby 3.3 or newer, which is what the OpenTelemetry gems require. If
|
|
135
|
-
those gems are unavailable, the option is accepted and export remains disabled.
|
|
136
|
-
|
|
137
|
-
The collector honors standard `OTEL_EXPORTER_OTLP_TRACES_HEADERS` (or the
|
|
138
|
-
generic `OTEL_EXPORTER_OTLP_HEADERS`) and gives them precedence over its own
|
|
139
|
-
headers, including `Authorization`. bktec's OTLP relay uses this to provide its
|
|
140
|
-
local credential without changing `BUILDKITE_ANALYTICS_TOKEN`, which remains
|
|
141
|
-
available for normal JSON uploads in `otel_enabled` mode. Without an OTLP
|
|
142
|
-
Authorization header, spans use `BUILDKITE_ANALYTICS_TOKEN`, which must be an
|
|
143
|
-
agent OIDC token with the `write_uploads` scope; a suite API token still uploads
|
|
144
|
-
executions, but its spans are rejected.
|
|
145
|
-
|
|
146
|
-
Export failures never fail a test or block the normal Test Engine upload. See the
|
|
147
|
-
[OpenTelemetry guide](docs/opentelemetry.md) for setup details and current
|
|
148
|
-
limitations.
|
|
149
|
-
|
|
150
|
-
### OTLP-only submission (experimental)
|
|
151
|
-
|
|
152
|
-
RSpec suites can go one step further and submit results *only* over OTLP, with
|
|
153
|
-
no JSON upload at all. It exports the same spans as `otel_enabled` and adds
|
|
154
|
-
`buildkite.execution.via=otlp`, which tells Buildkite to synthesize each test
|
|
155
|
-
execution from its span server-side:
|
|
156
|
-
|
|
157
|
-
```ruby
|
|
158
|
-
Buildkite::TestCollector.configure(hook: :rspec, otel_only: true)
|
|
159
|
-
```
|
|
107
|
+
This requires Ruby 3.3 or newer and the optional `opentelemetry-sdk` and
|
|
108
|
+
`opentelemetry-exporter-otlp` gems, which the collector does not install. If
|
|
109
|
+
OpenTelemetry cannot be configured, the collector warns and uploads results as
|
|
110
|
+
JSON instead.
|
|
160
111
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
- `Buildkite::TestCollector.tag_execution` sets attributes on the test span.
|
|
168
|
-
- `tags:` given to `configure` become resource attributes on every span.
|
|
169
|
-
- Instrumentation works exactly as it does with `otel_enabled`: everything you
|
|
170
|
-
require and register installs, and `otel_instrumentations: []` exports only
|
|
171
|
-
the `test.execution` spans. See
|
|
172
|
-
[choosing instrumentation](docs/opentelemetry.md#choosing-instrumentation).
|
|
173
|
-
- Your code can also talk to OpenTelemetry directly — the collector configures
|
|
174
|
-
the global tracer provider, so
|
|
175
|
-
`OpenTelemetry::Trace.current_span.set_attribute(...)` works during a test,
|
|
176
|
-
and any instrumentation joins the test's trace.
|
|
177
|
-
|
|
178
|
-
`otel_only` is currently RSpec-only and has the same Ruby 3.3+ and OpenTelemetry
|
|
179
|
-
gem requirements as `otel_enabled`. It's an alternative to `otel_enabled`; the
|
|
180
|
-
two are mutually exclusive, and passing both (either value) raises
|
|
181
|
-
`ArgumentError`.
|
|
112
|
+
If Buildkite rejects the exported `test.execution` spans, the collector prints a
|
|
113
|
+
prominent warning. Tests continue to run, but the affected results are not
|
|
114
|
+
uploaded. See the
|
|
115
|
+
[OpenTelemetry guide](docs/opentelemetry.md) for dependency setup,
|
|
116
|
+
instrumentation, filtering noisy child spans with `otel_span_filter`,
|
|
117
|
+
authentication, attributes, and current limitations.
|
|
182
118
|
|
|
183
119
|
## More information
|
|
184
120
|
|
|
@@ -204,7 +140,7 @@ See [DESIGN.md](DESIGN.md) for an overview of the design of this gem.
|
|
|
204
140
|
|
|
205
141
|
## 👩💻 Contributing
|
|
206
142
|
|
|
207
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/
|
|
143
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/bktest
|
|
208
144
|
|
|
209
145
|
## 🚀 Releasing
|
|
210
146
|
|
|
@@ -9,11 +9,13 @@ Gem::Specification.new do |spec|
|
|
|
9
9
|
spec.email = ["support+analytics@buildkite.com"]
|
|
10
10
|
|
|
11
11
|
spec.summary = "Track test executions and report to Buildkite Test Engine"
|
|
12
|
-
spec.homepage = "https://github.com/buildkite/test-collector-ruby"
|
|
12
|
+
spec.homepage = "https://github.com/buildkite/bktest/tree/main/test-collector-ruby"
|
|
13
13
|
spec.license = "MIT"
|
|
14
14
|
|
|
15
15
|
spec.metadata["homepage_uri"] = spec.homepage
|
|
16
|
-
spec.metadata["source_code_uri"] = "https://github.com/buildkite/
|
|
16
|
+
spec.metadata["source_code_uri"] = "https://github.com/buildkite/bktest"
|
|
17
|
+
spec.metadata["changelog_uri"] = "https://github.com/buildkite/bktest/blob/main/test-collector-ruby/CHANGELOG.md"
|
|
18
|
+
spec.metadata["bug_tracker_uri"] = "https://github.com/buildkite/bktest/issues"
|
|
17
19
|
|
|
18
20
|
# Specify which files should be added to the gem when it is released.
|
|
19
21
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -21,6 +23,8 @@ Gem::Specification.new do |spec|
|
|
|
21
23
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
|
22
24
|
end
|
|
23
25
|
spec.require_paths = ["lib"]
|
|
26
|
+
spec.bindir = "exe"
|
|
27
|
+
spec.executables = ["buildkite-rspec"]
|
|
24
28
|
|
|
25
29
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
|
26
30
|
|
|
@@ -31,4 +35,5 @@ Gem::Specification.new do |spec|
|
|
|
31
35
|
spec.add_development_dependency "ostruct"
|
|
32
36
|
spec.add_development_dependency "rspec-core", '~> 3.10'
|
|
33
37
|
spec.add_development_dependency "rspec-expectations", '~> 3.10'
|
|
38
|
+
spec.add_development_dependency "webmock"
|
|
34
39
|
end
|