mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-28 20:52:57 +08:00
Update CONTRIBUTING document (#417)
Co-authored-by: alrex <aboten@lightstep.com>
This commit is contained in:
@ -153,6 +153,21 @@ rather than conform to specific API names or argument patterns in the spec.
|
||||
|
||||
For a deeper discussion, see: https://github.com/open-telemetry/opentelemetry-specification/issues/165
|
||||
|
||||
## Running Tests Locally
|
||||
|
||||
1. Go to your Contrib repo directory. `git clone git@github.com:open-telemetry/opentelemetry-python-contrib.git && cd opentelemetry-python-contrib`.
|
||||
2. Clone the [OpenTelemetry Python](https://github.com/open-telemetry/opentelemetry-python) Python Core repo to a folder named `opentelemetry-python-core`. `git clone https://github.com/open-telemetry/opentelemetry-python.git opentelemetry-python-core`.
|
||||
3. Make sure you have `tox` installed. `pip install tox`.
|
||||
4. Run `tox` without any arguments to run tests for all the packages. Read more about [tox](https://tox.readthedocs.io/en/latest/).
|
||||
|
||||
### Testing against a different Core repo branch/commit
|
||||
|
||||
1. Change directory to the repo that was cloned above. `cd opentelemetry-python-core`.
|
||||
2. Move the head of this repo to the SHA hash you want your tests to use. The current SHA hash can be found in `.github/workflows/test.yml` file under the `opentelemetry-python-contrib` directory. For example, currently it is `1a12fa0d681e37c1fda9cb8d46212ff3bbf6b76a`. So use `git fetch && git checkout <current SHA hash>`.
|
||||
3. Go back to the root directory. `cd ../`.
|
||||
4. With `tox` installed, run tests for a package. (e.g. `tox -e test-instrumentation-flask`.)
|
||||
|
||||
|
||||
## Style Guide
|
||||
|
||||
* docstrings should adhere to the [Google Python Style
|
||||
|
Reference in New Issue
Block a user