Skip to content

Commit 521d9e5

Browse files
Add a new CLI tool named golden (#39671)
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description Add a new CLI, golden, to run comparison of expected payloads over OTLP. <!-- Issue number (e.g. #1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes #39662 <!--Describe what testing was performed and which tests were added.--> #### Testing Unit testing. <!--Describe the documentation added.--> #### Documentation README <!--Please delete paragraphs that you did not use before submitting.--> --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 7339402 commit 521d9e5

File tree

21 files changed

+769
-0
lines changed

21 files changed

+769
-0
lines changed

.chloggen/golden.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: new_component
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7+
component: golden
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Add a new CLI, golden, to run comparison of expected payloads over OTLP.
11+
12+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13+
issues: [39662]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext: |
19+
You can run golden with `--otlp-endpoint localhost:4317 --expected expected.yaml --write-expected --timeout 1m`
20+
21+
# If your change doesn't affect end users or the exported elements of any package,
22+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
23+
# Optional: The change log or logs in which this entry should be included.
24+
# e.g. '[user]' or '[user, api]'
25+
# Include 'user' if the change is relevant to end users.
26+
# Include 'api' if there is a change to a library API.
27+
# Default: '[user]'
28+
change_logs: []

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
# Start components list
2020

21+
cmd/golden/ @open-telemetry/collector-contrib-approvers @atoulme
2122
cmd/opampsupervisor/ @open-telemetry/collector-contrib-approvers @evan-bradley @atoulme @tigrannajaryan
2223
cmd/otelcontribcol/ @open-telemetry/collector-contrib-approvers
2324
cmd/oteltestbedcol/ @open-telemetry/collector-contrib-approvers

.github/ISSUE_TEMPLATE/bug_report.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ body:
1818
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
1919
# Do not manually edit it.
2020
# Start components list
21+
- cmd/golden
2122
- cmd/opampsupervisor
2223
- cmd/otelcontribcol
2324
- cmd/oteltestbedcol

.github/ISSUE_TEMPLATE/feature_request.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ body:
1212
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
1313
# Do not manually edit it.
1414
# Start components list
15+
- cmd/golden
1516
- cmd/opampsupervisor
1617
- cmd/otelcontribcol
1718
- cmd/oteltestbedcol

.github/ISSUE_TEMPLATE/other.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ body:
1212
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
1313
# Do not manually edit it.
1414
# Start components list
15+
- cmd/golden
1516
- cmd/opampsupervisor
1617
- cmd/otelcontribcol
1718
- cmd/oteltestbedcol

.github/ISSUE_TEMPLATE/unmaintained.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ body:
1717
# NOTE: The list below is autogenerated using `make generate-gh-issue-templates`
1818
# Do not manually edit it.
1919
# Start components list
20+
- cmd/golden
2021
- cmd/opampsupervisor
2122
- cmd/otelcontribcol
2223
- cmd/oteltestbedcol

.github/component_labels.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This file is auto-generated. Do not edit manually.
2+
cmd/golden cmd/golden
23
cmd/opampsupervisor cmd/opampsupervisor
34
cmd/otelcontribcol cmd/otelcontribcol
45
cmd/oteltestbedcol cmd/oteltestbedcol

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,6 +444,12 @@ opampsupervisor:
444444
cd ./cmd/opampsupervisor && GO111MODULE=on CGO_ENABLED=0 $(GOCMD) build -trimpath -o ../../bin/opampsupervisor_$(GOOS)_$(GOARCH)$(EXTENSION) \
445445
-tags $(GO_BUILD_TAGS) .
446446

447+
# Build the golden executable.
448+
.PHONY: golden
449+
golden:
450+
cd ./cmd/golden && GO111MODULE=on CGO_ENABLED=0 $(GOCMD) build -trimpath -o ../../bin/golden_$(GOOS)_$(GOARCH)$(EXTENSION) \
451+
-tags $(GO_BUILD_TAGS) .
452+
447453
MODULES="internal/buildscripts/modules"
448454
.PHONY: update-core-modules
449455
update-core-module-list:

cmd/golden/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include ../../Makefile.Common

cmd/golden/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Golden tester
2+
3+
<!-- status autogenerated section -->
4+
| Status | |
5+
| ------------- |-----------|
6+
| Stability | [alpha]: metrics |
7+
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Acmd%2Fgolden%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Acmd%2Fgolden) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Acmd%2Fgolden%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Acmd%2Fgolden) |
8+
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@atoulme](https://www.github.com/atoulme) |
9+
10+
[alpha]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#alpha
11+
<!-- end autogenerated section -->

0 commit comments

Comments
 (0)