Skip to content

docs: add missing tests for getting started examples#4662

Merged
xrmx merged 4 commits into
open-telemetry:mainfrom
injisg:sgali/otmpy-docs-test
Aug 28, 2025
Merged

docs: add missing tests for getting started examples#4662
xrmx merged 4 commits into
open-telemetry:mainfrom
injisg:sgali/otmpy-docs-test

Conversation

@injisg
Copy link
Copy Markdown
Contributor

@injisg injisg commented Jun 30, 2025

Description

Add test_metrics.py and test_otlpcollector.py to validate the metrics_example.py and otlpcollector_example.py scripts.

  • test_metrics.py: Validates all 7 metric types with specific expected values
  • test_otlpcollector.py: Tests OTLP collector example with graceful timeout handling

Fixes #4001

Type of change

Please delete options that are not relevant.

  • [x ] Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

  • [x ] Executed both tests in my environment

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • [x ] No.

Checklist:

  • [x ] Followed the style guidelines of this project
  • Changelogs have been updated
  • [x ] Unit tests have been added
  • Documentation has been updated

Add test_metrics.py and test_otlpcollector.py to validate the
metrics_example.py and otlpcollector_example.py scripts.

- test_metrics.py: Validates all 7 metric types with specific expected values
- test_otlpcollector.py: Tests OTLP collector example with graceful timeout handling

Fixes open-telemetry#4001
@injisg injisg requested a review from a team as a code owner June 30, 2025 02:42
@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Jun 30, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Jun 30, 2025

I think the issue was about running examples code in CI and not about writing some new tests

@injisg
Copy link
Copy Markdown
Contributor Author

injisg commented Jul 4, 2025

I think the issue was about running examples code in CI and not about writing some new tests

My bad! 😄 i'll update!

@injisg
Copy link
Copy Markdown
Contributor Author

injisg commented Jul 4, 2025

I think the issue was about running examples code in CI and not about writing some new tests

@xrmx - I do see that the existing tests run as part of CI. Example run from another PR that's open: https://github.com/open-telemetry/opentelemetry-python/actions/runs/15904348585/job/44855076756?pr=4659

Is there more to be done to add these tests to the CI pipeline? I see that they are configured here 🤔

@xrmx xrmx moved this to Ready for review in Python PR digest Jul 28, 2025
@injisg
Copy link
Copy Markdown
Contributor Author

injisg commented Aug 10, 2025

@xrmx just checking in again - can you help clarify the requirements?

@xrmx xrmx added the Skip Changelog PRs that do not require a CHANGELOG.md entry label Aug 18, 2025
@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Aug 18, 2025

@sginji please fix the lint errors and setup pre-commit and we should be good to go.

@xrmx xrmx moved this from Ready for review to Reviewed PR that needs fixing in Python PR digest Aug 18, 2025
@injisg injisg force-pushed the sgali/otmpy-docs-test branch from f5442cb to f249def Compare August 27, 2025 07:41
@injisg injisg force-pushed the sgali/otmpy-docs-test branch from 3378d99 to 081bf0a Compare August 27, 2025 07:59
@injisg
Copy link
Copy Markdown
Contributor Author

injisg commented Aug 27, 2025

@sginji please fix the lint errors and setup pre-commit and we should be good to go.

@xrmx I've fixed lint and setup pre-commit too.

@xrmx xrmx enabled auto-merge (squash) August 28, 2025 10:45
@xrmx xrmx merged commit 6c8e2ab into open-telemetry:main Aug 28, 2025
468 of 469 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewed PR that needs fixing to Done in Python PR digest Aug 28, 2025
JWinermaSplunk pushed a commit to JWinermaSplunk/opentelemetry-python that referenced this pull request Feb 17, 2026
…4662)

* docs: add missing tests for getting started examples

Add test_metrics.py and test_otlpcollector.py to validate the
metrics_example.py and otlpcollector_example.py scripts.

- test_metrics.py: Validates all 7 metric types with specific expected values
- test_otlpcollector.py: Tests OTLP collector example with graceful timeout handling

Fixes open-telemetry#4001

* Fix lint errors

* Apply pre-commit fixes

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
JWinermaSplunk pushed a commit to JWinermaSplunk/opentelemetry-python that referenced this pull request Feb 17, 2026
…4662)

* docs: add missing tests for getting started examples

Add test_metrics.py and test_otlpcollector.py to validate the
metrics_example.py and otlpcollector_example.py scripts.

- test_metrics.py: Validates all 7 metric types with specific expected values
- test_otlpcollector.py: Tests OTLP collector example with graceful timeout handling

Fixes open-telemetry#4001

* Fix lint errors

* Apply pre-commit fixes

---------

Co-authored-by: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Skip Changelog PRs that do not require a CHANGELOG.md entry

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Test our docs

2 participants