Skip to content
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 shared test code from ext/ to tests/ #559

Merged
merged 4 commits into from
Apr 15, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-flask/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ install_requires =
[options.extras_require]
test =
flask~=1.0
opentelemetry-ext-testutil
opentelemetry-test

[options.packages.find]
where = src
7 changes: 2 additions & 5 deletions ext/opentelemetry-ext-flask/tests/test_flask_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from werkzeug.wrappers import BaseResponse

from opentelemetry import trace as trace_api
from opentelemetry.ext.testutil.wsgitestutil import WsgiTestBase
from opentelemetry.test.wsgitestutil import WsgiTestBase


def expected_attributes(override_attributes):
Expand Down Expand Up @@ -78,10 +78,7 @@ def assert_environ():

def test_simple(self):
expected_attrs = expected_attributes(
{
"http.target": "/hello/123",
"http.route": "/hello/<int:helloid>",
}
{"http.target": "/hello/123", "http.route": "/hello/<int:helloid>"}
)
resp = self.client.get("/hello/123")
self.assertEqual(200, resp.status_code)
Expand Down
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-wsgi/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ install_requires =

[options.extras_require]
test =
opentelemetry-ext-testutil
opentelemetry-test

[options.packages.find]
where = src
2 changes: 1 addition & 1 deletion ext/opentelemetry-ext-wsgi/tests/test_wsgi_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import opentelemetry.ext.wsgi as otel_wsgi
from opentelemetry import trace as trace_api
from opentelemetry.ext.testutil.wsgitestutil import WsgiTestBase
from opentelemetry.test.wsgitestutil import WsgiTestBase


class Response:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

[metadata]
name = opentelemetry-ext-testutil
name = opentelemetry-test
description = Test utilities for OpenTelemetry unit tests
author = OpenTelemetry Authors
author_email = [email protected]
url = https://github.com/open-telemetry/opentelemetry-python/ext/opentelemetry-ext-testutil
url = https://github.com/open-telemetry/opentelemetry-python/tests/util
platforms = any
license = Apache-2.0
classifiers =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

BASE_DIR = os.path.dirname(__file__)
VERSION_FILENAME = os.path.join(
BASE_DIR, "src", "opentelemetry", "ext", "testutil", "version.py"
BASE_DIR, "src", "opentelemetry", "test", "version.py"
)
PACKAGE_INFO = {}
with open(VERSION_FILENAME) as f:
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ commands_pre =
ext: pip install {toxinidir}/opentelemetry-api
grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc
grpc: pip install {toxinidir}/opentelemetry-sdk
wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil
wsgi,flask: pip install {toxinidir}/tests/util
wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
wsgi,flask: pip install {toxinidir}/opentelemetry-sdk
flask: pip install {toxinidir}/opentelemetry-auto-instrumentation
Expand Down