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

Tests: replace nose with pytest #603

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

sbraz
Copy link
Contributor

@sbraz sbraz commented Jan 3, 2023

Hi,
nose is no longer maintained, see
nose-devs/nose#1099 (comment).

This bug was initially submitted here: https://bugs.gentoo.org/878695.

This commit switches to pytest.

Amongst the changes, here are the most relevant ones:

  • Create a conftest.py that contains fixtures.
  • Replace nose.with_setup with yield fixtures.
  • Use pytest.skip instead of print and nose.plugins.skip.SkipTest.
  • Use pytest.mark.slow instead of nose.plugins.attrib.attr("slow").
  • Use pytest.mark.parametrize instead of parameterized, simplify parametrized tests that use both shell and inverse_order.
  • Update Travis config.
  • Update SConscript.
  • Update documentation.

nose is no longer maintained, see
nose-devs/nose#1099 (comment).

This was initially submitted here: https://bugs.gentoo.org/878695.

This commit switches to pytest.

Amongst the changes, here are the most relevant ones:
* Create a conftest.py that contains fixtures.
* Replace nose.with_setup with yield fixtures.
* Use pytest.skip instead of print and nose.plugins.skip.SkipTest.
* Use pytest.mark.slow instead of nose.plugins.attrib.attr("slow").
* Use pytest.mark.parametrize instead of parameterized, simplify
  parametrized tests that use both `shell` and `inverse_order`.
* Update Travis config.
* Update SConscript.
* Update documentation.
@sbraz
Copy link
Contributor Author

sbraz commented Feb 11, 2023

@cebtenzzre would it please be possible to look into this?

@cebtenzzre
Copy link
Contributor

I know that nose is unmaintained, but it works fine on the distro I use (Arch Linux). I would like to replace it with something like nose2 or pytest in the future, and I will consider your changes. But it is not a priority at the moment, and I've made a lot of changes to the tests locally that would conflict with this PR.

@sbraz
Copy link
Contributor Author

sbraz commented Jul 26, 2023

@cebtenzzre any chance you could look into this at one point? If I were to rebase this on master or develop (not sure I will because I already spent hours on this PR), would you merge it?

@cebtenzzre
Copy link
Contributor

I haven't been spending much time on rmlint lately, but I would still want to push more of my own changes which include additional tests before I merge this PR.

@sbraz
Copy link
Contributor Author

sbraz commented Feb 28, 2024

Hi @cebtenzzre, FYI Gentoo is about to drop the package because it's one of the few that haven't migrated away from nose, see https://bugs.gentoo.org/878695#c5.

It saddens me as I put a lot of hours into packaging it, making the test suite work, and creating this PR. I really liked using rmlint too. I still think pytest is the way to go and nose2 is not the best solution. If you think you can fix this in the coming weeks, that would be really nice and maybe I can add it back at some point.

@fermino
Copy link
Collaborator

fermino commented Dec 9, 2024

@sbraz Thanks a lot for this PR, I know it probably took quite some time to get all sorted out. It's sad to see the package was dropped from gentoo, and the AUR package in arch is going the same direction so I'm trying to avoid it. With some luck maybe the package in gentoo can be eventually restored :)

I know it might be a lot to ask, but if you happen to have the time, would you mind rebasing this PR against master?
We just merged support for github actions and added initial support for pytest.

I'm just realizing that in that MR I likely broke support for mount_bind_teardown_func, as the tests are not being executed as root, so we might have to look into that too.

Anyways, thanks again for the work here! :)

@sbraz
Copy link
Contributor Author

sbraz commented Dec 9, 2024

@fermino I'll try at some point, maybe it's not that much work. And I know Gentoo users miss the package.
I can't give an ETA though, it could be months before I want to dive into this. On which branch should I rebase the changes? Just to be sure I'm not missing anything?

@fermino
Copy link
Collaborator

fermino commented Dec 12, 2024

@sbraz Sure, no worries about it! If I happen to have some time to give it a look I will post any updates here.

As per this comment it should be master, at least for now. I'm not comfortable pushing anything to master that could pose a risk to user data (I'm barely starting to get to know the codebase), but this is only related to the tests so I think it would be a great idea in order to get the stable branch building properly in all distros.

As a side note, you might find #677 interesting, I haven't added support for gentoo as I'm not familiar with the building process, but if we can get nose sorted out I will add it so we can keep track of its state.

@a-detiste
Copy link

Same situation on Debian & derivatives for what it's worth. Only a handful of mostly unreleasable thing depending on Nose still. From users telemetry rmlint is top 2 just behind Debian own native toolbox git-buildpackage that has been fixed in git.

This GBP has a special status of "key package" (well it really ties the whole distro together). And Nose inherit transitively this property. So any day GBP author decides to upload his package will start an autoremoval counter for rmlint.

I don't know precisely how Ubuntu manage their fork.

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

Successfully merging this pull request may close these issues.

4 participants