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

Add e2e test for tail sampling config example #129

Merged
merged 10 commits into from
Feb 9, 2024

Conversation

joaopgrassi
Copy link
Contributor

@joaopgrassi joaopgrassi commented Feb 8, 2024

After spending some time learning/looking at the testbed package in the collector, here's what I came up with to run e2e tests for our configuration samples:

  • New data Provider (sampleConfigsDataProvider): This implements the DataProvider interface. Since we have samples with different expectation/results, the data provider simply receives a list of spans, and when the load generator asks for it, it returns that. This way, each test is in full control of the data that is sent to the collector

  • New validator (SampleConfigsValidator): This implements the TestCaseValidator interface, and the same way the data provider, receives the expected spans. It then compares the expected with the received from the mock back-end. For now the assertion simply looks for SpanIDs.

Then it's just using the testbed framework to actually run the collector/tests. For now, I'm testing the tail sampling configuration.

@joaopgrassi joaopgrassi marked this pull request as ready for review February 8, 2024 15:17
@joaopgrassi joaopgrassi requested a review from a team as a code owner February 8, 2024 15:17
config_examples/README.md Outdated Show resolved Hide resolved
config_examples/README.md Outdated Show resolved Hide resolved
config_examples/README.md Show resolved Hide resolved
config_examples/tail_sampling.yaml Show resolved Hide resolved
testbed/integration/config_examples_test.go Outdated Show resolved Hide resolved
testbed/integration/data_providers.go Outdated Show resolved Hide resolved
testbed/integration/validation.go Outdated Show resolved Hide resolved
testbed/integration/data_providers.go Outdated Show resolved Hide resolved
testbed/integration/validation.go Outdated Show resolved Hide resolved
config_examples/README.md Show resolved Hide resolved
@evan-bradley evan-bradley merged commit 221c994 into main Feb 9, 2024
2 checks passed
@evan-bradley evan-bradley deleted the feat/samples-test-sampling branch February 9, 2024 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants