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

Provide an easy way to disable tests that use the internet #2293

Closed
aucampia opened this issue Mar 19, 2023 · 6 comments · Fixed by #2295
Closed

Provide an easy way to disable tests that use the internet #2293

aucampia opened this issue Mar 19, 2023 · 6 comments · Fixed by #2295
Assignees
Labels
enhancement New feature or request testing

Comments

@aucampia
Copy link
Member

This is a request from Gentoo:

One thing that would really be helpful is having some marker on tests using Internet, so we could easily deselect them all.

Not sure what the best way is to implement this, but it would be useful.

@aucampia aucampia added enhancement New feature or request testing labels Mar 19, 2023
@aucampia aucampia mentioned this issue Mar 19, 2023
8 tasks
@aucampia aucampia self-assigned this Mar 19, 2023
@aucampia
Copy link
Member Author

We should probably add a custom marker (https://docs.pytest.org/en/7.1.x/example/markers.html), that way someone can do:

pytest -v -m "not uses_internet"

@aucampia
Copy link
Member Author

I guess the biggest question that remains is, what should we call the marker? The pytest docs use webtest, which I guess works, but not sure if that is best, I think uses_internet may be better, but if webtest is widely used then we should use that rather.

@aucampia
Copy link
Member Author

aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
aucampia added a commit to aucampia/rdflib that referenced this issue Mar 19, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <RDFLib#2293>.
@niklasl
Copy link
Member

niklasl commented Mar 20, 2023

Makes sense. In theory uses_network might be more proper, but in practise, RDFLib should probably only use http(s) for network access anyway.

aucampia added a commit that referenced this issue Mar 21, 2023
This is being done so that it is easier for downstream packagers to run the test
suite without requiring internet access.

To run only tests that does not use the internet, run `pytest -m "not webtest"`.

The validation workflow validates that test run without internet access by
running the tests inside `firejail --net=none`.

- Closes <#2293>.
@mgorny
Copy link

mgorny commented Mar 26, 2023

Thank you!

@aucampia
Copy link
Member Author

Thank you!

Hope it helps. If there are other things we can do to make it easier to work with our releases, please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants