-
Notifications
You must be signed in to change notification settings - Fork 698
Move the metrics basic test to TestBase class #3092
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
Move the metrics basic test to TestBase class #3092
Conversation
934c9b5
to
8c56a37
Compare
8c56a37
to
459bb92
Compare
tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py
Outdated
Show resolved
Hide resolved
self.assertEqual( | ||
data_point.sum, | ||
expected_value, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are min
, max
, count
etc... assertions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py
Outdated
Show resolved
Hide resolved
Can you add a Skip Changelog label? |
tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py
Outdated
Show resolved
Hide resolved
tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py
Outdated
Show resolved
Hide resolved
tests/opentelemetry-test-utils/src/opentelemetry/test/test_base.py
Outdated
Show resolved
Hide resolved
bcc7b78
to
eb27734
Compare
metric: Metric, | ||
expected_value: Union[int, float], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The way I would find this useful is if it takes the current metric and the expected metric, not a single float/int value. The following code has things that don't make it useable for many use cases; why does the count have to be 1? How can one use this when the count is not 1? There are no assertions of min, max etc.?
Description
Move the metrics basic test to TestBase class so each metric instrumentation could use those functions
The functions moved from the tornado instrumentation test:
https://github.com/open-telemetry/opentelemetry-python-contrib/blob/0f2451be26c87a366d44283022341fc904c88b22/instrumentation/opentelemetry-instrumentation-tornado/tests/test_metrics_instrumentation.py#L38
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Does This PR Require a Contrib Repo Change?
Answer the following question based on these examples of changes that would require a Contrib Repo Change:
The OTel specification has changed which prompted this PR to update the method interfaces of
opentelemetry-api/
oropentelemetry-sdk/
The method interfaces of
test/util
have changedScripts in
scripts/
that were copied over to the Contrib repo have changedConfiguration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in
pyproject.toml
isort.cfg
.flake8
When a new
.github/CODEOWNER
is addedMajor changes to project information, such as in:
README.md
CONTRIBUTING.md
Yes. - Link to PR:
No.
Checklist: