open-telemetry / opentelemetry-python

OpenTelemetry Python API and SDK
https://opentelemetry.io
Apache License 2.0
1.67k stars 570 forks source link

Test our docs #4001

Open ocelotl opened 6 days ago

ocelotl commented 6 days ago

Describe your environment

OS: (e.g, Ubuntu) Python version: (e.g., Python 3.8.10) SDK version: (e.g., 1.25.0) API version: (e.g., 1.25.0)

What happened?

Nothing

Steps to Reproduce

We should add tests for our docs. Just testing that we can run the example in CI will do.

Expected Result

Doc tests running in CI

Actual Result

No tests running in CI

Additional context

No response

Would you like to implement a fix?

None

Charlie-lizhihan commented 5 days ago

Hi, I would like to try this one. But I didn't have a chance do documentation testing before. Is there any specific guidance or constraints I should be aware of before I start working on this? Thanks!

emdneto commented 5 days ago

@Charlie-lizhihan I would start by looking at what we have right now here: https://github.com/open-telemetry/opentelemetry-python/tree/main/docs/getting_started and include those tests as part of CI.

Charlie-lizhihan commented 2 days ago

@emdneto Thank you so much!

pmcollins commented 2 days ago

Shameless plug, but I wrote oteltest for this purpose.

It lets you run example scripts or integration tests, with all configuration and logic co-located within each script.