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

Include tests in sdist #133

Merged
merged 5 commits into from
Mar 23, 2023
Merged

Include tests in sdist #133

merged 5 commits into from
Mar 23, 2023

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Mar 22, 2023

Include the test suite in sdist archives, in order to make it possible for distribution packagers to use them rather than generated GitHub archives.

Include the test suite in sdist archives, in order to make it possible
for distribution packagers to use them rather than generated GitHub
archives.
@cunla
Copy link
Owner

cunla commented Mar 22, 2023

Why do you want the tests included?

@mgorny
Copy link
Contributor Author

mgorny commented Mar 22, 2023

Why do you want the tests included?

Gentoo packages provide support for running tests prior to installing the package in order to verify that it works.

@cunla
Copy link
Owner

cunla commented Mar 22, 2023

Can you provide some context on it?

@mgorny
Copy link
Contributor Author

mgorny commented Mar 22, 2023

Can you provide some context on it?

I don't understand what you're asking for. Gentoo Linux provides packages for various Python, well, packages. As part of package building process, users can opt in to run test suites against their system and Python versions. This way they can reduce the risk of hitting breakage at runtime, particularly if they're running a less common setup.

@cunla
Copy link
Owner

cunla commented Mar 22, 2023

Can you provide some context on it?

I don't understand what you're asking for. Gentoo Linux provides packages for various Python, well, packages. As part of package building process, users can opt in to run test suites against their system and Python versions. This way they can reduce the risk of hitting breakage at runtime, particularly if they're running a less common setup.

Have you tried running the tests for this package? Can you provide me how to run tests in gentoo for this?
The tests here run commands against FakeRedis (ie, the package) and real redis and compare the results. How does gentoo runs redis server before running the tests?

@mgorny
Copy link
Contributor Author

mgorny commented Mar 23, 2023

Yes, we are running tests for quite a while. I admit there are a few known failures but most of them pass. We are starting a local redis server for the duration of the test suite. The code is here:

https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-python/fakeredis/fakeredis-2.10.2.ebuild#n66

To run ebuild with tests enabled, normally you run:

FEATURES=test emerge -1v dev-python/fakeredis

However, this will also enable tests on all dependencies which can be time consuming. You can enable it per package by defining e.g. /etc/portage/env/run-tests:

FEATURES="${FEATURES} test"

and then using in /etc/portage/package.env:

dev-python/fakeredis run-tests

@cunla
Copy link
Owner

cunla commented Mar 23, 2023

Got you, ok, I see the need. I am not sure how to write a test for it here so I'll merge.

@cunla cunla merged commit 51bc09e into cunla:master Mar 23, 2023
@mgorny
Copy link
Contributor Author

mgorny commented Mar 24, 2023

Thank you!

@mgorny mgorny deleted the sdist-test branch March 24, 2023 05:18
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.

2 participants