From de93b2ad28116ae2e1285ebc1be5361d83995bf0 Mon Sep 17 00:00:00 2001 From: Dhruv Vora <32409412+dhruv-vora@users.noreply.github.com> Date: Fri, 25 Jun 2021 09:03:15 -0700 Subject: [PATCH] Update CONTRIBUTING document (#417) Co-authored-by: alrex --- CONTRIBUTING.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ed248a9e5..fee9958f3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 `. +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