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

Allow pytest to run with sudo #22809

Closed
Viermusketiere opened this issue Jan 30, 2024 · 4 comments
Closed

Allow pytest to run with sudo #22809

Viermusketiere opened this issue Jan 30, 2024 · 4 comments
Labels
area-testing community ask Feature request that the community expressed interest in feature-request Request for new features or functionality needs community feedback Awaiting community feedback

Comments

@Viermusketiere
Copy link

To enable the execution of complex tests it is sometimes necessary to execute pytest with sudo.
A launch configuration supports the sudo flag. Is it possible to port this over for the execution of pytest / unittest tests started from the Testing tab?
It is quite annoying to have to execute some tests requiring elevated rights from the terminal and not be able to see the status of those tests in the test overview displayed in the Testing tab.

@Viermusketiere Viermusketiere added the feature-request Request for new features or functionality label Jan 30, 2024
@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jan 30, 2024
@anthonykim1 anthonykim1 added needs community feedback Awaiting community feedback community ask Feature request that the community expressed interest in and removed triage-needed Needs assignment to the proper sub-team labels Jan 30, 2024
Copy link

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

@Viermusketiere
Copy link
Author

I have managed to find a workaround which makes me wonder even more why this feature isn't supported:
When creating a custom launch config to debug tests I am able to specify the "sudo" = true flag which works when executing my tests in debug mode. The test result is also properly collected after execution in debug mode.
Is there a way to create a custom launch config for regular tests?

@Viermusketiere
Copy link
Author

After some more extensive research on outstanding feature request it seems like #21845 would solve this problem automatically if the "sudo" flag could be set to true for pytest/unittest run

@brettcannon
Copy link
Member

Thank you for submitting your feature request and everyone who considered it! Unfortunately, this issue did not receive enough votes over the allotted time, and so we are closing the issue.

@brettcannon brettcannon closed this as not planned Won't fix, can't repro, duplicate, stale Jun 25, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-testing community ask Feature request that the community expressed interest in feature-request Request for new features or functionality needs community feedback Awaiting community feedback
Projects
None yet
Development

No branches or pull requests

3 participants