-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[receiver/kubeletstats] Improve unit test assertions #27468
Labels
Contribfest
good first issue
Good for newcomers
receiver/kubeletstats
test coverage
Improve test coverage
Comments
TylerHelmuth
added
help wanted
Extra attention is needed
good first issue
Good for newcomers
test coverage
Improve test coverage
receiver/kubeletstats
labels
Oct 6, 2023
TylerHelmuth
added
Contribfest
and removed
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Oct 23, 2023
TylerHelmuth
added
help wanted
Extra attention is needed
good first issue
Good for newcomers
labels
Dec 13, 2023
@TylerHelmuth is this issue still open? |
@hamzmu yes, would you like to work on it? |
yes can i work on it. thanks |
Reassigning to @ChrsMark as there is an open PR already |
dmitryax
pushed a commit
that referenced
this issue
Jan 11, 2024
…#30348) **Description:** This PR introduces the usage of pdata and golden files within the unit tests of the `kubeletstats` receiver. Insted of manually asserting the unit-tests' results and having the expected values hard-coded within the tests we use generated pdata stored in golden files to improve the assertions by using the [`pdatatest`](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/c87856083e3afa11cd35dbd9cbb8fbda0194fbf4/pkg/pdatatest/README.md#L11) helper functions. **Link to tracking Issue:** Fixes #27468 **Testing:** <Describe what testing was performed and which tests were added.> Unit tests being improved. --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
cparkins
pushed a commit
to AmadeusITGroup/opentelemetry-collector-contrib
that referenced
this issue
Feb 1, 2024
…open-telemetry#30348) **Description:** This PR introduces the usage of pdata and golden files within the unit tests of the `kubeletstats` receiver. Insted of manually asserting the unit-tests' results and having the expected values hard-coded within the tests we use generated pdata stored in golden files to improve the assertions by using the [`pdatatest`](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/c87856083e3afa11cd35dbd9cbb8fbda0194fbf4/pkg/pdatatest/README.md#L11) helper functions. **Link to tracking Issue:** Fixes open-telemetry#27468 **Testing:** <Describe what testing was performed and which tests were added.> Unit tests being improved. --------- Signed-off-by: ChrsMark <chrismarkou92@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Contribfest
good first issue
Good for newcomers
receiver/kubeletstats
test coverage
Improve test coverage
Originally posted by @dmitryax in #27276 (comment)
Currently the unit tests in
scraper_test.go
check the results of scraping by cycling through the returned metrics. The tests could be improved by comparing the ResourceMetrics returned by.Scrape()
with a expected ResourceMetrics struct that is setup by the test.The text was updated successfully, but these errors were encountered: