buildkite-test_collector 2.14.0 → 2.16.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 +47 -5
- data/.buildkite/pipeline.yml +30 -0
- data/.buildkite/steps/release +74 -0
- data/CHANGELOG.md +97 -0
- data/Gemfile +5 -0
- data/README.md +32 -12
- data/buildkite-test_collector.gemspec +7 -8
- data/buildkite.yaml +23 -30
- data/docs/opentelemetry.md +425 -0
- data/lib/buildkite/test_collector/ci.rb +6 -2
- data/lib/buildkite/test_collector/error.rb +0 -1
- data/lib/buildkite/test_collector/library_hooks/rspec.rb +31 -14
- data/lib/buildkite/test_collector/otel/child_span_forwarder.rb +81 -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 +793 -0
- data/lib/buildkite/test_collector/rspec_plugin/reporter.rb +31 -4
- data/lib/buildkite/test_collector/rspec_plugin/trace.rb +52 -2
- data/lib/buildkite/test_collector/trace.rb +4 -1
- data/lib/buildkite/test_collector/uuid.rb +11 -1
- data/lib/buildkite/test_collector/version.rb +1 -1
- data/lib/buildkite/test_collector.rb +81 -4
- metadata +46 -12
- data/CODEOWNERS +0 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 83d45811e314ed3a6defa2daebb928af60cf113a555e0409c5a842ad44cf0385
|
|
4
|
+
data.tar.gz: bb1687220b76611bb509f12d1804bf9ec530423e55b66a89cfd4ac0bb66acfd4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 42527c632311eafe2cc64e48b92b3a4da9e148b0a32fb72a687393f7ccf227cbee57be3fc8e50ba555844ef3d27e9dfae8b923285588ccf8cd0c635f9e92baab
|
|
7
|
+
data.tar.gz: 554ca53a2271210bdc6c796187f60bc5069038c98137514c156c5d9f0ef877767608a4d44d6f9357687c4892e7743e55550ca49e097bb08099cefdcc5872dfc4
|
|
@@ -1,12 +1,54 @@
|
|
|
1
|
+
# Monorepo release pipeline for test-collector-ruby, uploaded by the
|
|
2
|
+
# release dispatcher (.buildkite/pipeline.release.yml) running on the
|
|
3
|
+
# separate bktest-release Buildkite pipeline — never by CI: as a rehearsal
|
|
4
|
+
# when this project changes (no tag), and for real on a
|
|
5
|
+
# test-collector-ruby/vX.Y.Z tag. Injected by `ctg gather` from the ctg
|
|
6
|
+
# repo's overlay/ directory during the dry-run era; post-cutover this file
|
|
7
|
+
# is maintained here, in the monorepo. It replaces the source repo's
|
|
8
|
+
# .buildkite/pipeline.release.yml, which assumed the repo root was the
|
|
9
|
+
# project root.
|
|
10
|
+
#
|
|
11
|
+
# Safety model (see docs/publishing.md in the ctg repo):
|
|
12
|
+
# - The build step is side-effect-free: it builds the gem, checks
|
|
13
|
+
# tag/version consistency, and queries RubyGems read-only. It runs on
|
|
14
|
+
# every rehearsal, so rehearsals exercise the release code. It never sees
|
|
15
|
+
# RELEASE_PUBLISH (set only on the publish step below), so it stops
|
|
16
|
+
# before `gem push` even on tag builds.
|
|
17
|
+
# - The publish steps mint a push token via the rubygems.org OIDC API key
|
|
18
|
+
# role, whose access policy trusts this pipeline (see the credential
|
|
19
|
+
# cut-over section of ctg docs/publishing.md).
|
|
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`.
|
|
24
|
+
|
|
1
25
|
agents:
|
|
2
26
|
queue: hosted
|
|
3
27
|
|
|
4
28
|
steps:
|
|
5
|
-
-
|
|
29
|
+
- label: ":rubygems: test-collector-ruby: build + rehearse release"
|
|
30
|
+
key: ruby-build
|
|
31
|
+
command: test-collector-ruby/.buildkite/steps/release
|
|
32
|
+
plugins:
|
|
33
|
+
- docker#v5.12.0:
|
|
34
|
+
image: "ruby:3.4"
|
|
35
|
+
environment:
|
|
36
|
+
- BUILDKITE_TAG
|
|
6
37
|
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
if: build.tag
|
|
38
|
+
- block: ":rocket: Publish test-collector-ruby to RubyGems?"
|
|
39
|
+
key: ruby-confirm
|
|
40
|
+
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
41
|
+
|
|
42
|
+
- label: ":rubygems: test-collector-ruby: publish to RubyGems"
|
|
43
|
+
if: build.tag =~ /^test-collector-ruby\/v[0-9]+\.[0-9]+\.[0-9]+$/
|
|
44
|
+
depends_on:
|
|
45
|
+
- ruby-build
|
|
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"
|
|
51
|
+
command: test-collector-ruby/.buildkite/steps/release
|
|
10
52
|
plugins:
|
|
11
53
|
- rubygems-oidc#v0.2.0:
|
|
12
54
|
role: "rg_oidc_akr_fy1x4px4yjwd1rdhkkda"
|
|
@@ -15,4 +57,4 @@ steps:
|
|
|
15
57
|
environment:
|
|
16
58
|
- GEM_HOST_API_KEY
|
|
17
59
|
- BUILDKITE_TAG
|
|
18
|
-
|
|
60
|
+
- RELEASE_PUBLISH
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Monorepo pipeline for test-collector-ruby, uploaded by the top-level
|
|
2
|
+
# dispatcher when this project changes. Injected by `ctg gather` from the
|
|
3
|
+
# ctg repo's overlay/ directory during the dry-run era; post-cutover this
|
|
4
|
+
# file is maintained here, in the monorepo.
|
|
5
|
+
#
|
|
6
|
+
# Dry-run-safe: pure test steps only, derived from the source repo's
|
|
7
|
+
# buildkite.yaml with credentialed plugins (OIDC role assumption, ECR)
|
|
8
|
+
# removed, Docker Hub images, and a trimmed matrix.
|
|
9
|
+
#
|
|
10
|
+
# Jobs check out the monorepo root, so commands cd into this project.
|
|
11
|
+
|
|
12
|
+
agents:
|
|
13
|
+
queue: hosted
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- group: ":ruby: test-collector-ruby"
|
|
17
|
+
steps:
|
|
18
|
+
- label: ":rspec: Ruby {{matrix}}"
|
|
19
|
+
command:
|
|
20
|
+
- "cd test-collector-ruby"
|
|
21
|
+
- "gem install bundler:2.3.25"
|
|
22
|
+
- "bundle"
|
|
23
|
+
- "bundle exec rake"
|
|
24
|
+
- "bundle exec cucumber"
|
|
25
|
+
plugins:
|
|
26
|
+
- docker#v3.7.0:
|
|
27
|
+
image: "ruby:{{matrix}}"
|
|
28
|
+
matrix:
|
|
29
|
+
- "latest"
|
|
30
|
+
- "3.3"
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Monorepo release script for test-collector-ruby: build the gem, check
|
|
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.
|
|
9
|
+
#
|
|
10
|
+
# Injected by `ctg gather` from the ctg repo's overlay/ directory during the
|
|
11
|
+
# dry-run era; post-cutover this file is maintained here, in the monorepo.
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
|
|
15
|
+
cd "$(dirname "$0")/../.." # this project's root, wherever the checkout cwd is
|
|
16
|
+
|
|
17
|
+
PROJECT="test-collector-ruby"
|
|
18
|
+
GEM_NAME="buildkite-test_collector"
|
|
19
|
+
TAG_PATTERN="^${PROJECT}/v([0-9]+\.[0-9]+\.[0-9]+)$"
|
|
20
|
+
|
|
21
|
+
echo "--- Determining version"
|
|
22
|
+
if [ -n "${BUILDKITE_TAG:-}" ]; then
|
|
23
|
+
if [[ ! "${BUILDKITE_TAG}" =~ ${TAG_PATTERN} ]]; then
|
|
24
|
+
echo "BUILDKITE_TAG '${BUILDKITE_TAG}' does not match ${PROJECT}/vX.Y.Z; refusing" >&2
|
|
25
|
+
exit 1
|
|
26
|
+
fi
|
|
27
|
+
VERSION="${BASH_REMATCH[1]}"
|
|
28
|
+
echo "version ${VERSION} (from tag ${BUILDKITE_TAG})"
|
|
29
|
+
else
|
|
30
|
+
VERSION="$(ruby -Ilib -rbuildkite/test_collector/version -e 'puts Buildkite::TestCollector::VERSION')"
|
|
31
|
+
echo "version ${VERSION} (from lib/buildkite/test_collector/version.rb; no tag)"
|
|
32
|
+
fi
|
|
33
|
+
|
|
34
|
+
GEM_FILENAME="${GEM_NAME}-${VERSION}.gem"
|
|
35
|
+
|
|
36
|
+
echo "--- Building gem"
|
|
37
|
+
gem build "${GEM_NAME}.gemspec"
|
|
38
|
+
if [ ! -f "${GEM_FILENAME}" ]; then
|
|
39
|
+
echo "ERROR: expected ${GEM_FILENAME}; does the gemspec/version.rb say ${VERSION}?" >&2
|
|
40
|
+
echo "gem files found:" >&2
|
|
41
|
+
ls -- *.gem >&2 || true
|
|
42
|
+
exit 1
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
echo "--- Checking rubygems.org for existing version ${VERSION} (read-only)"
|
|
46
|
+
STATUS="$(curl -s -o /dev/null -w "%{http_code}" "https://rubygems.org/api/v2/rubygems/${GEM_NAME}/versions/${VERSION}.json")"
|
|
47
|
+
if [ "${STATUS}" = "200" ]; then
|
|
48
|
+
ALREADY_PUBLISHED=true
|
|
49
|
+
echo "${GEM_NAME} ${VERSION} is already on rubygems.org"
|
|
50
|
+
else
|
|
51
|
+
ALREADY_PUBLISHED=false
|
|
52
|
+
echo "${GEM_NAME} ${VERSION} is not on rubygems.org (HTTP ${STATUS})"
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
if [ "${RELEASE_PUBLISH:-}" != "true" ]; then
|
|
56
|
+
echo "--- Rehearsal only"
|
|
57
|
+
echo "RELEASE_PUBLISH is not 'true': stopping before 'gem push ${GEM_FILENAME}'."
|
|
58
|
+
exit 0
|
|
59
|
+
fi
|
|
60
|
+
|
|
61
|
+
echo "--- Publishing ${GEM_FILENAME} to RubyGems"
|
|
62
|
+
if [ -z "${BUILDKITE_TAG:-}" ]; then
|
|
63
|
+
echo "RELEASE_PUBLISH=true without a ${PROJECT}/vX.Y.Z tag; refusing" >&2
|
|
64
|
+
exit 1
|
|
65
|
+
fi
|
|
66
|
+
if [ "${ALREADY_PUBLISHED}" = "true" ]; then
|
|
67
|
+
echo "version ${VERSION} already published; refusing" >&2
|
|
68
|
+
exit 1
|
|
69
|
+
fi
|
|
70
|
+
if [ -z "${GEM_HOST_API_KEY:-}" ]; then
|
|
71
|
+
echo "GEM_HOST_API_KEY not set (rubygems-oidc plugin missing or failed)" >&2
|
|
72
|
+
exit 1
|
|
73
|
+
fi
|
|
74
|
+
gem push "${GEM_FILENAME}"
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,102 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## v2.16.0
|
|
4
|
+
|
|
5
|
+
* Report `code.line.number` for shared example inclusions (`it_behaves_like`,
|
|
6
|
+
`include_examples`, `include_context`) in OpenTelemetry test spans; the line
|
|
7
|
+
was previously omitted because RSpec's inclusion location includes the frame
|
|
8
|
+
label.
|
|
9
|
+
* Prevent OpenTelemetry export failures outside `StandardError`, including
|
|
10
|
+
WebMock network-blocking errors, from failing the test suite.
|
|
11
|
+
* Add the OTLP endpoint host to WebMock's allow list when WebMock is loaded.
|
|
12
|
+
* Validate OpenTelemetry run keys before export and fall back to the JSON upload
|
|
13
|
+
with a warning when they are invalid (or report that results cannot be
|
|
14
|
+
uploaded when no JSON token is available).
|
|
15
|
+
* Ignore empty `BUILDKITE_ANALYTICS_*` metadata overrides so they do not replace
|
|
16
|
+
values detected from the CI environment.
|
|
17
|
+
* Read bktec's relay credential from `BUILDKITE_TESTS_OTLP_TOKEN` and stop
|
|
18
|
+
reading `OTEL_EXPORTER_OTLP_*_HEADERS`, so credentials the process configures
|
|
19
|
+
for other OpenTelemetry destinations are never sent to Buildkite.
|
|
20
|
+
* Pin OpenTelemetry export to gzip, peer-verified HTTPS, and the system
|
|
21
|
+
certificate store, ignoring process-wide `OTEL_EXPORTER_OTLP_*` transport
|
|
22
|
+
overrides. Requires `opentelemetry-exporter-otlp` 0.29+; older versions fall
|
|
23
|
+
back to the JSON upload with a warning.
|
|
24
|
+
* Reduce the experimental OpenTelemetry test span batch size from 512 to 120 so
|
|
25
|
+
a batch of failures with maximum-length output fits the server's 900 KiB
|
|
26
|
+
request limit. Override the batch and queue sizes with
|
|
27
|
+
`BUILDKITE_TESTS_OTEL_TEST_SPAN_BATCH_SIZE` and
|
|
28
|
+
`BUILDKITE_TESTS_OTEL_TEST_SPAN_QUEUE_SIZE`; invalid values warn and use
|
|
29
|
+
the defaults.
|
|
30
|
+
* Override the OpenTelemetry child span batch and queue sizes with
|
|
31
|
+
`BUILDKITE_TESTS_OTEL_CHILD_SPAN_BATCH_SIZE` and
|
|
32
|
+
`BUILDKITE_TESTS_OTEL_CHILD_SPAN_QUEUE_SIZE`, and warn when child spans are
|
|
33
|
+
dropped instead of discarding them silently. `test.execution` results are
|
|
34
|
+
unaffected by child span drops.
|
|
35
|
+
* Set every OpenTelemetry batch processor option explicitly, including the export
|
|
36
|
+
timeout and starting the export thread on boot, so `OTEL_BSP_*` and
|
|
37
|
+
`OTEL_RUBY_BSP_START_THREAD_ON_BOOT` no longer affect Buildkite export.
|
|
38
|
+
* Truncate OpenTelemetry test span attributes to 10,243 characters (test names
|
|
39
|
+
keep the same identity as the JSON upload), exception messages to 10,243
|
|
40
|
+
characters, other event attributes to 16,384 characters, events to the newest
|
|
41
|
+
100 per span, and the failure summary in the span status to 1,024 characters.
|
|
42
|
+
* **Breaking change to the experimental OpenTelemetry support:** opt-in
|
|
43
|
+
submission is now OTLP-only for RSpec. `otel_enabled: true` submits executions
|
|
44
|
+
as spans without also uploading legacy JSON, and the separate `otel_only`
|
|
45
|
+
option has been removed (passing it now raises `ArgumentError`). OpenTelemetry
|
|
46
|
+
remains off by default, so suites that never opted in are unaffected. When
|
|
47
|
+
OpenTelemetry cannot be used, the collector warns and uploads JSON instead:
|
|
48
|
+
at configure time for a non-RSpec hook, and at suite start when the
|
|
49
|
+
OpenTelemetry gems are missing or Ruby is older than 3.3. Without a token,
|
|
50
|
+
`otel_enabled` stays off and nothing is exported, the same as the JSON path,
|
|
51
|
+
which skips uploading without a token. When only `BUILDKITE_TESTS_OTLP_TOKEN`
|
|
52
|
+
held the credential, the fallback warning says results will not be uploaded,
|
|
53
|
+
since the JSON path has no token to use. Execution name
|
|
54
|
+
affixes (`BUILDKITE_ANALYTICS_EXECUTION_NAME_PREFIX`/`SUFFIX`) and custom
|
|
55
|
+
`env:` values have no OTLP equivalent and are not sent when `otel_enabled` is
|
|
56
|
+
on; the JSON upload that carried them in the old dual mode no longer happens.
|
|
57
|
+
* **Breaking change to the experimental OpenTelemetry support:** remove the
|
|
58
|
+
`otel_instrumentations` option (passing it now raises `ArgumentError`). It
|
|
59
|
+
only accepted `nil` or `[]`, and `[]` skipped installing the instrumentation
|
|
60
|
+
gems the suite had already required. Choose instrumentation by requiring the
|
|
61
|
+
gems you want; the collector installs every registered instrumentation when it
|
|
62
|
+
configures the SDK, and installs none when the suite configures the SDK
|
|
63
|
+
itself. There is no replacement switch that disables all instrumentation at
|
|
64
|
+
once: to skip one gem your bundle requires anyway, set the SDK's
|
|
65
|
+
`OTEL_RUBY_INSTRUMENTATION_<NAME>_ENABLED=false`; to skip them all, configure
|
|
66
|
+
the SDK yourself without `use_all` (see [Choosing
|
|
67
|
+
instrumentation](docs/opentelemetry.md#choosing-instrumentation)).
|
|
68
|
+
* Warn prominently, usually naming the HTTP status or connection error, the first
|
|
69
|
+
time Buildkite rejects or the collector drops `test.execution` spans, since
|
|
70
|
+
OTLP is now the only upload path. A test span that could not be started counts
|
|
71
|
+
as dropped too. When more are dropped after that, report the total at the
|
|
72
|
+
suite-end flush and again at process exit for anything still draining.
|
|
73
|
+
* Keep stable suite, CI worker/run, and VCS identity on OpenTelemetry resources,
|
|
74
|
+
while moving Test Engine run metadata, framework details, and configured tags
|
|
75
|
+
to each `test.execution` span. Child spans no longer carry execution-only
|
|
76
|
+
metadata as duplicated resource attributes.
|
|
77
|
+
* Send the Ruby version and configured location prefix with OpenTelemetry test
|
|
78
|
+
executions so OTLP-only uploads retain their classic upload tags and selector
|
|
79
|
+
paths.
|
|
80
|
+
* Add `otel_span_filter` to drop selected OpenTelemetry child spans before they
|
|
81
|
+
are queued for export. `test.execution` spans are never filtered, and a
|
|
82
|
+
filter that fails retains the span and warns once. Passing a value that does
|
|
83
|
+
not respond to `call` raises `ArgumentError` at configure time.
|
|
84
|
+
|
|
85
|
+
## v2.15.0
|
|
86
|
+
|
|
87
|
+
* Add [experimental, opt-in OpenTelemetry trace export](docs/opentelemetry.md)
|
|
88
|
+
for RSpec suites. Both modes share execution spans and run resources while
|
|
89
|
+
preserving execution roots; `otel_only` skips legacy trace capture and JSON
|
|
90
|
+
uploads. Standard OTLP header environment variables are supported for export
|
|
91
|
+
authentication. Export requires Ruby 3.3 or newer and the OpenTelemetry SDK
|
|
92
|
+
and OTLP exporter gems.
|
|
93
|
+
|
|
94
|
+
* Automatically tag executions with `ci.worker.id` from `BUILDKITE_AGENT_ID`,
|
|
95
|
+
so failures can be grouped by the agent that ran them. An explicit
|
|
96
|
+
caller-supplied `ci.worker.id` tag still takes precedence.
|
|
97
|
+
|
|
98
|
+
* Drop support for Ruby 2.x. Ruby 3.0 or newer is now required.
|
|
99
|
+
|
|
3
100
|
## v2.14.0
|
|
4
101
|
|
|
5
102
|
* Send `location_prefix` in `run_env`
|
data/Gemfile
CHANGED
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,6 +83,35 @@ 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 submission (experimental)
|
|
87
|
+
|
|
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. Instrumented child spans show what the test did and
|
|
91
|
+
where it spent its time.
|
|
92
|
+
|
|
93
|
+
This feature is still under development and may change. OpenTelemetry is off by
|
|
94
|
+
default. Enable it when you configure the collector:
|
|
95
|
+
|
|
96
|
+
```ruby
|
|
97
|
+
Buildkite::TestCollector.configure(hook: :rspec, otel_enabled: true)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
When enabled, OpenTelemetry is the only submission path. Every `test.execution` span includes
|
|
101
|
+
`buildkite.execution.via=otlp`, which tells Buildkite to synthesize the test
|
|
102
|
+
execution from the span. Nothing is uploaded to `/v1/uploads`.
|
|
103
|
+
|
|
104
|
+
This requires Ruby 3.3 or newer and the optional `opentelemetry-sdk` and
|
|
105
|
+
`opentelemetry-exporter-otlp` gems, which the collector does not install. If
|
|
106
|
+
OpenTelemetry cannot be configured, the collector warns and uploads results as
|
|
107
|
+
JSON instead.
|
|
108
|
+
|
|
109
|
+
If Buildkite rejects the exported `test.execution` spans, the collector prints a
|
|
110
|
+
prominent warning. Tests continue to run, but the affected results are not
|
|
111
|
+
uploaded. See the
|
|
112
|
+
[OpenTelemetry guide](docs/opentelemetry.md) for dependency setup,
|
|
113
|
+
instrumentation, filtering noisy child spans with `otel_span_filter`,
|
|
114
|
+
authentication, attributes, and current limitations.
|
|
86
115
|
|
|
87
116
|
## More information
|
|
88
117
|
|
|
@@ -108,20 +137,11 @@ See [DESIGN.md](DESIGN.md) for an overview of the design of this gem.
|
|
|
108
137
|
|
|
109
138
|
## 👩💻 Contributing
|
|
110
139
|
|
|
111
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/
|
|
140
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/buildkite/bktest
|
|
112
141
|
|
|
113
142
|
## 🚀 Releasing
|
|
114
143
|
|
|
115
|
-
|
|
116
|
-
2. Update the CHANGELOG.md with your new version and a description of your changes.
|
|
117
|
-
3. Once your PR is merged to `main` git tag the merge commit and push:
|
|
118
|
-
|
|
119
|
-
```
|
|
120
|
-
git tag vX.X.X
|
|
121
|
-
git push origin vX.X.X
|
|
122
|
-
```
|
|
123
|
-
4. Visit the [release pipeline](https://buildkite.com/buildkite/test-collector-ruby-release) to unblock it and confirm the new version is pushed to rubygems.org
|
|
124
|
-
5. Create a [new release in github](https://github.com/buildkite/test-collector-ruby/releases).
|
|
144
|
+
See the monorepo's [collector release guide](../RELEASING.md#ruby-rubygems).
|
|
125
145
|
|
|
126
146
|
## 📜 MIT License
|
|
127
147
|
|
|
@@ -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.
|
|
@@ -22,17 +24,14 @@ Gem::Specification.new do |spec|
|
|
|
22
24
|
end
|
|
23
25
|
spec.require_paths = ["lib"]
|
|
24
26
|
|
|
25
|
-
spec.required_ruby_version = Gem::Requirement.new(">=
|
|
27
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 3.0.0")
|
|
26
28
|
|
|
27
29
|
spec.add_dependency "concurrent-ruby"
|
|
28
30
|
|
|
29
31
|
spec.add_development_dependency "activesupport", ">= 4.2"
|
|
32
|
+
spec.add_development_dependency "cucumber", '~> 9.0'
|
|
30
33
|
spec.add_development_dependency "ostruct"
|
|
31
34
|
spec.add_development_dependency "rspec-core", '~> 3.10'
|
|
32
35
|
spec.add_development_dependency "rspec-expectations", '~> 3.10'
|
|
33
|
-
|
|
34
|
-
# When running the legacy CI builds against versions of Ruby pre 2.7 we cannot include cucumber 9 as it's not supported.
|
|
35
|
-
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.7')
|
|
36
|
-
spec.add_development_dependency "cucumber", '~> 9.0'
|
|
37
|
-
end
|
|
36
|
+
spec.add_development_dependency "webmock"
|
|
38
37
|
end
|
data/buildkite.yaml
CHANGED
|
@@ -27,36 +27,29 @@ steps:
|
|
|
27
27
|
- "latest"
|
|
28
28
|
- "3.4"
|
|
29
29
|
- "3.3"
|
|
30
|
+
|
|
31
|
+
- label: ":rspec: Tests (EOL Ruby) :ruby: {{matrix}}"
|
|
32
|
+
command:
|
|
33
|
+
- "gem install bundler:2.3.25"
|
|
34
|
+
- "bundle"
|
|
35
|
+
- "bundle exec rake"
|
|
36
|
+
- "bundle exec cucumber"
|
|
37
|
+
plugins:
|
|
38
|
+
- aws-assume-role-with-web-identity#v1.2.0:
|
|
39
|
+
role-arn: "${OIDC_ASSUME_ROLE_ARN:-arn:aws:iam::445615400570:role/pipeline-buildkite-test-collector-ruby-build}"
|
|
40
|
+
session-tags:
|
|
41
|
+
- organization_slug
|
|
42
|
+
- organization_id
|
|
43
|
+
- pipeline_slug
|
|
44
|
+
- build_branch
|
|
45
|
+
|
|
46
|
+
- ecr#v2.9.0:
|
|
47
|
+
login: true
|
|
48
|
+
account_ids: "public.ecr.aws"
|
|
49
|
+
region: "us-east-1"
|
|
50
|
+
- docker#v3.7.0:
|
|
51
|
+
image: "public.ecr.aws/docker/library/ruby:{{matrix}}"
|
|
52
|
+
matrix:
|
|
30
53
|
- "3.2"
|
|
31
54
|
- "3.1"
|
|
32
55
|
- "3.0"
|
|
33
|
-
- "2.7"
|
|
34
|
-
|
|
35
|
-
- group: ":rspec: Legacy Ruby :ruby:"
|
|
36
|
-
steps:
|
|
37
|
-
- label: ":rspec: Tests :ruby: {{matrix}}"
|
|
38
|
-
command:
|
|
39
|
-
- "gem install bundler:2.3.25"
|
|
40
|
-
- "bundle"
|
|
41
|
-
- "bundle exec rake"
|
|
42
|
-
plugins:
|
|
43
|
-
- aws-assume-role-with-web-identity#v1.2.0:
|
|
44
|
-
role-arn: "${OIDC_ASSUME_ROLE_ARN:-arn:aws:iam::445615400570:role/pipeline-buildkite-test-collector-ruby-build}"
|
|
45
|
-
session-tags:
|
|
46
|
-
- organization_slug
|
|
47
|
-
- organization_id
|
|
48
|
-
- pipeline_slug
|
|
49
|
-
- build_branch
|
|
50
|
-
- ecr#v2.9.0:
|
|
51
|
-
login: true
|
|
52
|
-
account_ids: "public.ecr.aws"
|
|
53
|
-
region: "us-east-1"
|
|
54
|
-
- docker#v3.7.0:
|
|
55
|
-
# Images for older Ruby versions aren't available on AWS ECR
|
|
56
|
-
# so fall back to Docker Hub
|
|
57
|
-
image: "ruby:{{matrix}}"
|
|
58
|
-
matrix:
|
|
59
|
-
- "2.6"
|
|
60
|
-
- "2.5"
|
|
61
|
-
- "2.4"
|
|
62
|
-
- "2.3"
|