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

Test fails on OpenBSD at 2.2.0: fixture 'client' not found #5526

Closed
catap opened this issue Dec 2, 2024 · 12 comments · Fixed by #5536
Closed

Test fails on OpenBSD at 2.2.0: fixture 'client' not found #5526

catap opened this issue Dec 2, 2024 · 12 comments · Fixed by #5536
Assignees

Comments

@catap
Copy link
Contributor

catap commented Dec 2, 2024

Problem

_______________ ERROR at setup of TestAuraResponse.test_artists ________________
file /build/pobj/beets-2.2.0/beets-2.2.0/test/plugins/test_aura.py, line 139
      def test_artists(
file /build/pobj/beets-2.2.0/beets-2.2.0/test/plugins/test_aura.py, line 57
      @pytest.fixture
      def get_response_data(self, client: Client, item):
E       fixture 'client' not found
>       available fixtures: _other_album_and_item, album, album_document, anyio_backend, anyio_backend_name, anyio_backend_options, app, artist_document, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, get_response_data, helper, item, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, track_document
>       use 'pytest --fixtures [testpath]' for help on them.

/build/pobj/beets-2.2.0/beets-2.2.0/test/plugins/test_aura.py:57
________________ ERROR at setup of TestAuraResponse.test_albums ________________
file /build/pobj/beets-2.2.0/beets-2.2.0/test/plugins/test_aura.py, line 148
      def test_albums(
file /build/pobj/beets-2.2.0/beets-2.2.0/test/plugins/test_aura.py, line 57
      @pytest.fixture
      def get_response_data(self, client: Client, item):
E       fixture 'client' not found
>       available fixtures: _other_album_and_item, album, album_document, anyio_backend, anyio_backend_name, anyio_backend_options, app, artist_document, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, get_response_data, helper, item, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, track_document
>       use 'pytest --fixtures [testpath]' for help on them.

Setup

  • OS: OpenBSD-current
  • Python version: 3.11.10
  • beets version: 2.2.0
  • Turning off plugins made problem go away (yes/no): no
@snejus
Copy link
Member

snejus commented Dec 2, 2024

How are you running the tests?

@snejus
Copy link
Member

snejus commented Dec 2, 2024

I suspect this issue is coming up because pytest does not know where's the testing directory at: try providing the --rootpath argument with package root

pytest --rootpath /build/pobj/beets-2.2.0

@catap
Copy link
Contributor Author

catap commented Dec 2, 2024

I suspect this issue is coming up because pytest does not know where's the testing directory at: try providing the --rootpath argument with package root

pytest --rootpath /build/pobj/beets-2.2.0

It has correct rootpath already, without it, not test discovered.

============================= test session starts ==============================
platform openbsd7 -- Python 3.11.10, pytest-8.2.0, pluggy-1.5.0
rootdir: /build/pobj/beets-2.2.0/beets-2.2.0
configfile: pyproject.toml
plugins: anyio-3.7.1, cov-6.0.0
collected 1798 items / 1 skipped

Also, it had pick a lot of fixtures...

@snejus
Copy link
Member

snejus commented Dec 5, 2024

I see what's going on - testing dependencies are missing (in this case it's pytest-flask).

How did you use to install testing dependencies before we introduced poetry?

@catap
Copy link
Contributor Author

catap commented Dec 5, 2024

@snejus like this: https://github.com/openbsd/ports/blob/master/audio/beets/Makefile#L38-L47

Here no pytest-flask on OpenBSD ports.

I'll try to add it and re-test but I have no idea when.

@snejus
Copy link
Member

snejus commented Dec 5, 2024

Just checked the previous package - I can now see that plugin tests had not previously been included in the sdist. Only the tests in the root test folder were included.

@catap
Copy link
Contributor Author

catap commented Dec 5, 2024

@snejus when it explains everything. Thanks!

@snejus
Copy link
Member

snejus commented Dec 5, 2024

I will exclude the plugin tests - ultimately your concern is to make sure that base beets version passes tests, so it does not make sense to force you to test plugins.

@catap
Copy link
Contributor Author

catap commented Dec 5, 2024

@snejus I think the current way better, special if it means to add one more dependency for tests which can be useful on other ports.

So, no need to exclude anything, I guess.

@snejus
Copy link
Member

snejus commented Dec 5, 2024

For now, I think, we will mirror the same configuration like we had before. If someone comes across wanting plugin tests to be included, then we can try to hack something there since it's slightly more complicated than just a single dependency. Some of the plugin tests depend on certain system packages being present, for example.

@catap
Copy link
Contributor Author

catap commented Dec 5, 2024

make sense.

@snejus snejus self-assigned this Dec 5, 2024
snejus added a commit that referenced this issue Dec 10, 2024
…s from MANIFEST.in (#5536)

Fixes #5526
Fixes #5531
Fixes #5539

### Package contents

See #5526 where a package maintainer fails running plugin tests. I found that before
introduction of Poetry `beets` never bundled plugin tests, therefore I now excluded them.

I also remembered that previously `MANIFEST.in` file was used to specify which files get
included in the package, so I mirrored the same configuration. This includes zsh
completion in `extra/_beet` which fixes #5531.

I removed `MANIFEST.in` file since it has no use anymore.

### Release workflow

The last release workflow run failed to pick up the commit with the version updates and
tagged an outdated commit (#5539). I simplified the workflow to create the tag at the same
time the version upgrade is committed.
@eli-schwartz
Copy link

For now, I think, we will mirror the same configuration like we had before. If someone comes across wanting plugin tests to be included, then we can try to hack something there since it's slightly more complicated than just a single dependency. Some of the plugin tests depend on certain system packages being present, for example.

You can use markers to let people select which tests they want to run, and/or raise skips for missing dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants