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

PyPi sources are missing util directory reqiured for tests #2263

Closed
glaubitz opened this issue Nov 4, 2021 · 8 comments · Fixed by #2269
Closed

PyPi sources are missing util directory reqiured for tests #2263

glaubitz opened this issue Nov 4, 2021 · 8 comments · Fixed by #2269
Labels
bug Something isn't working

Comments

@glaubitz
Copy link

glaubitz commented Nov 4, 2021

I'm currently trying to upgrade the opentelemtry-api package in openSUSE from 1.1.0 to 1.6.2 using the sources from PyPi.

Running the testsuite fails because the PyPy sources are missing some of the testsuite dependencies:

[    5s] + pytest-3.6 --ignore=_build.python36 --ignore=_build.python39 --ignore=_build.python38 -v
[    5s] ============================= test session starts ==============================
[    5s] platform linux -- Python 3.6.15, pytest-6.2.5, py-1.10.0, pluggy-1.0.0 -- /usr/bin/python3.6
[    5s] cachedir: .pytest_cache
[    5s] rootdir: /home/abuild/rpmbuild/BUILD/opentelemetry-api-1.6.2
[    5s] collecting ... collected 99 items / 3 errors / 96 selected
[    5s] 
[    5s] ==================================== ERRORS ====================================
[    5s] _________________ ERROR collecting tests/trace/test_globals.py _________________
[    5s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/opentelemetry-api-1.6.2/tests/trace/test_globals.py'.
[    5s] Hint: make sure your test modules/packages have valid Python names.
[    5s] Traceback:
[    5s] /usr/lib64/python3.6/importlib/__init__.py:126: in import_module
[    5s]     return _bootstrap._gcd_import(name[level:], package, level)
[    5s] tests/trace/test_globals.py:5: in <module>
[    5s]     from opentelemetry.test.concurrency_test import ConcurrencyTestBase, MockFunc
[    5s] E   ModuleNotFoundError: No module named 'opentelemetry.test'
[    5s] __________________ ERROR collecting tests/trace/test_proxy.py __________________
[    5s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/opentelemetry-api-1.6.2/tests/trace/test_proxy.py'.
[    5s] Hint: make sure your test modules/packages have valid Python names.
[    5s] Traceback:
[    5s] /usr/lib64/python3.6/importlib/__init__.py:126: in import_module
[    5s]     return _bootstrap._gcd_import(name[level:], package, level)
[    5s] tests/trace/test_proxy.py:20: in <module>
[    5s]     from opentelemetry.test.globals_test import TraceGlobalsTest
[    5s] E   ModuleNotFoundError: No module named 'opentelemetry.test'
[    5s] ___________________ ERROR collecting tests/util/test_once.py ___________________
[    5s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/opentelemetry-api-1.6.2/tests/util/test_once.py'.
[    5s] Hint: make sure your test modules/packages have valid Python names.
[    5s] Traceback:
[    5s] /usr/lib64/python3.6/importlib/__init__.py:126: in import_module
[    5s]     return _bootstrap._gcd_import(name[level:], package, level)
[    5s] tests/util/test_once.py:15: in <module>
[    5s]     from opentelemetry.test.concurrency_test import ConcurrencyTestBase, MockFunc
[    5s] E   ModuleNotFoundError: No module named 'opentelemetry.test'
[    5s] =========================== short test summary info ============================
[    5s] ERROR tests/trace/test_globals.py
[    5s] ERROR tests/trace/test_proxy.py
[    5s] ERROR tests/util/test_once.py
[    5s] !!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!
[    5s] ============================== 3 errors in 0.38s ===============================
[    5s] error: Bad exit status from /var/tmp/rpm-tmp.1B6CG6 (%check)
@glaubitz glaubitz added the bug Something isn't working label Nov 4, 2021
@owais
Copy link
Contributor

owais commented Nov 4, 2021

This package is not published to pypi and can be installed directly from https://github.com/open-telemetry/opentelemetry-python/tree/main/tests/util

@glaubitz
Copy link
Author

glaubitz commented Nov 4, 2021

This package is not published to pypi and can be installed directly from https://github.com/open-telemetry/opentelemetry-python/tree/main/tests/util

Yes, that's my point. It's currently not easily possible to package opentelemetry-api in distributions because of that.

@owais
Copy link
Contributor

owais commented Nov 4, 2021

It should be possible to package it as this is not a runtime dependency but if the build needs to run the test suite before building the packages then it needs this dep which can be installed from git. This should be automatically handled if tox is used to run the tests. If that is not viable for some reason, running the following command before testing should do it:

pip install git+https://github.com/open-telemetry/opentelemetry-python.git#egg=opentelemetry-test&subdirectory=tests/util

@owais
Copy link
Contributor

owais commented Nov 4, 2021

If there are compelling enough reasons, we can publish the package to pypi. I don't think it should be a problem but so far we haven't seen any use cases where it'd make a significant difference.

@glaubitz
Copy link
Author

glaubitz commented Nov 5, 2021

It should be possible to package it as this is not a runtime dependency but if the build needs to run the test suite before building the packages then it needs this dep which can be installed from git. This should be automatically handled if tox is used to run the tests. If that is not viable for some reason, running the following command before testing should do it:

pip install git+https://github.com/open-telemetry/opentelemetry-python.git#egg=opentelemetry-test&subdirectory=tests/util

The build servers cannot download any code for security reasons. No Linux distribution that I know of allows code downloads during builds.

@glaubitz
Copy link
Author

glaubitz commented Nov 5, 2021

If there are compelling enough reasons, we can publish the package to pypi. I don't think it should be a problem but so far we haven't seen any use cases where it'd make a significant difference.

That would be really appreciated. I have been spending a lot of time now getting all the individual opentelemetry Python packages updated in openSUSE and it's quite frustrating due to the various issues with the testsuite.

@owais
Copy link
Contributor

owais commented Nov 5, 2021

@open-telemetry/python-maintainers I think we should publish the test utils package to pypi to make life easier for people re-packing Otel for different platforms. It can perpetually stay unstable (0.x) and we can document that it is meant for internal Otel use only. Any concerns?

@ocelotl
Copy link
Contributor

ocelotl commented Nov 9, 2021

@open-telemetry/python-maintainers I think we should publish the test utils package to pypi to make life easier for people re-packing Otel for different platforms. It can perpetually stay unstable (0.x) and we can document that it is meant for internal Otel use only. Any concerns?

sounds good to me 👍

owais added a commit to owais/opentelemetry-python that referenced this issue Nov 10, 2021
@owais owais mentioned this issue Nov 10, 2021
10 tasks
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 10, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 10, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 10, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 11, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 11, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 11, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 11, 2021
owais added a commit to owais/opentelemetry-python that referenced this issue Nov 11, 2021
owais added a commit that referenced this issue Nov 11, 2021
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue May 12, 2023
https://build.opensuse.org/request/show/1086592
by user dgarcia + dimstar_suse
- Ignore some tests because there's no opentelemetry-test-util module
  gh#open-telemetry/opentelemetry-python#2263
- Update to 1.17.0:
  * Implement LowMemory temporality (#3223)
  * PeriodicExportingMetricReader will continue if collection times out (#3100)
  * Fix formatting of ConsoleMetricExporter. (#3197)
  * Fix use of built-in samplers in SDK configuration (#3176)
  * Implement shutdown procedure forOTLP grpc exporters (#3138)
  * Add exponential histogram (#2964)
  * Add OpenCensus trace bridge/shim (#3210)
  * A lot more changes in previous releases can be found at
  https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md#version-1170038b0-2023-03-22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants