Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize testbed #1062

Merged
merged 25 commits into from
Jun 17, 2020
Merged

Generalize testbed #1062

merged 25 commits into from
Jun 17, 2020

Conversation

kbrockhoff
Copy link
Member

@kbrockhoff kbrockhoff commented Jun 1, 2020

Description: Extracted out TestResultsSummary (in testbed/testbed/results.go), DataProvider (in testbed/testbed/data_provider.go), OtelcolRunner (in testbed/testbed/otelcol_runner.go), TestCaseValidator (in testbed/testbed/validator.go) interfaces with multiple implementations. Added tracing correctness tests in testbed/correctness using the testbed with different implementations of the 5 interfaces listed than what the perf tests use.

Link to tracking Issue: Provides the support to cleanly implement #652, #1022, #1023, #1027, #1031

Testing: All existing testbed-driven tests still pass. Correctness tests run without any panics. Correctness tests are reporting a number of bugs with translations.

Documentation: Godocs on all public methods.

@codecov
Copy link

codecov bot commented Jun 1, 2020

Codecov Report

Merging #1062 into master will increase coverage by 0.12%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1062      +/-   ##
==========================================
+ Coverage   86.73%   86.85%   +0.12%     
==========================================
  Files         201      201              
  Lines       14513    14518       +5     
==========================================
+ Hits        12588    12610      +22     
+ Misses       1471     1458      -13     
+ Partials      454      450       -4     
Impacted Files Coverage Δ
service/service.go 52.06% <100.00%> (+1.54%) ⬆️
service/builder/exporters_builder.go 72.85% <0.00%> (+2.85%) ⬆️
translator/internaldata/resource_to_oc.go 76.47% <0.00%> (+2.94%) ⬆️
internal/collector/telemetry/telemetry.go 87.93% <0.00%> (+3.44%) ⬆️
exporter/loggingexporter/logging_exporter.go 83.68% <0.00%> (+3.54%) ⬆️
service/telemetry.go 88.88% <0.00%> (+3.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f134f50...6f6545e. Read the comment docs.

@tigrannajaryan tigrannajaryan self-assigned this Jun 2, 2020
@tigrannajaryan tigrannajaryan added this to In progress in Collector via automation Jun 2, 2020
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for undertaking this.

testbed/testbed/data_providers.go Outdated Show resolved Hide resolved
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 5, 2020

CLA Check
The committers are authorized under a signed CLA.

testbed/correctness/correctness_test.go Show resolved Hide resolved
testbed/correctness/correctness_test.go Outdated Show resolved Hide resolved
testbed/correctness/correctness_test.go Outdated Show resolved Hide resolved
testbed/testbed/child_process.go Outdated Show resolved Hide resolved
testbed/correctness/correctness_test.go Outdated Show resolved Hide resolved
tc.ValidateData()
}

func createConfigFile(t *testing.T, sender testbed.DataSender, receiver testbed.DataReceiver, resultDir string,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a copy of createConfigFile from scenarios.go or is different from it? If it is a copy perhaps extract as testbed helper func.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would make things easier to create a configmodels.Config directly instead of building the yaml string then converting that into a configmodels.Config.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a different configuration than used by perf tests. Generating string and converting to Config because functionality does not currently exist to write out Config back to a string.

testbed/testbed/child_process.go Outdated Show resolved Hide resolved
@kbrockhoff kbrockhoff changed the title Generalize testbed [WIP] Generalize testbed Jun 12, 2020
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an excellent and very useful PR. I left some comments to refine it, let's get it merged asap. I believe it is going to help us catch a lot of correctness problems (as you posted it found a bunch, now we need to analyse them).
Can we run the correctness test as part of the build, but ignore the failures for now?

testbed/README.md Outdated Show resolved Hide resolved
testbed/README.md Outdated Show resolved Hide resolved
testbed/README.md Outdated Show resolved Hide resolved
testbed/README.md Outdated Show resolved Hide resolved
testbed/README.md Outdated Show resolved Hide resolved
testbed/testbed/test_case.go Outdated Show resolved Hide resolved
testbed/testbed/validator.go Outdated Show resolved Hide resolved
testbed/testbed/validator.go Show resolved Hide resolved
testbed/testbed/validator.go Show resolved Hide resolved
testbed/testbed/validator.go Show resolved Hide resolved
@kbrockhoff
Copy link
Member Author

Commented out the test assertion for zero span diffs so tests are not failed because of diffs but the report is still created.

Added correctness tests into the Makefile testbed-runtests and testbed-listtests targets.

Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the replies. Only a couple open comments remaining, please address.

testbed/testbed/otelcol_runner.go Outdated Show resolved Hide resolved
testbed/correctness/correctness_test.go Outdated Show resolved Hide resolved
testbed/testbed/otelcol_runner.go Outdated Show resolved Hide resolved
Collector automation moved this from In progress to Reviewer approved Jun 17, 2020
Copy link
Member

@tigrannajaryan tigrannajaryan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, only minor output formatting issue left.

@tigrannajaryan tigrannajaryan merged commit e3df9f3 into open-telemetry:master Jun 17, 2020
Collector automation moved this from Reviewer approved to Done Jun 17, 2020
@tigrannajaryan
Copy link
Member

@kbrockhoff Thanks a lot! This is a much wanted contribution.

@kbrockhoff kbrockhoff deleted the generalize-testbed branch June 18, 2020 12:21
wyTrivail pushed a commit to mxiamxia/opentelemetry-collector that referenced this pull request Jul 13, 2020
…telemetry#1062)

Extracted out TestResultsSummary (in testbed/testbed/results.go), DataProvider (in testbed/testbed/data_provider.go), OtelcolRunner (in testbed/testbed/otelcol_runner.go), TestCaseValidator (in testbed/testbed/validator.go) interfaces with multiple implementations. Added tracing correctness tests in testbed/correctness using the testbed with different implementations of the 5 interfaces listed than what the perf tests use.

**Link to tracking Issue:** Provides the support to cleanly implement open-telemetry#652, open-telemetry#1022, open-telemetry#1023, open-telemetry#1027, open-telemetry#1031

**Testing:** All existing testbed-driven tests still pass. Correctness tests run without any panics. Correctness tests are reporting a number of bugs with translations.

**Documentation:** Godocs on all public methods.
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
* Integration tests for OTel Collector Attributes.

* Update CHANGELOG.md

* Fix review

* Fix review.

* Fix test.

* Fix test.

Co-authored-by: Tyler Yahn <[email protected]>
Troels51 pushed a commit to Troels51/opentelemetry-collector that referenced this pull request Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Collector
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants