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

[Feature Request]: use PopenStub in more test cases #21258

Open
oesgalha opened this issue Nov 14, 2024 · 0 comments
Open

[Feature Request]: use PopenStub in more test cases #21258

oesgalha opened this issue Nov 14, 2024 · 0 comments
Labels
enhancement Label to indicate an issue is a feature/improvement Impact: Medium Will improve quality-of-life for at least 30% of users. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.

Comments

@oesgalha
Copy link

Is your feature request related to a problem? Please describe.

Hi, I've recently tried to collaborate with the project and had some contact with test cases. I saw that there are a lot of tests that need to mock a sub-process call, and most of them accomplish this by creating a mock that calls a "cheaper" sub-process such as echo test.

But the project has a Stub for mocking the Popen class:
https://github.com/oppia/oppia/blob/6f2156f/scripts/scripts_test_utils.py#L28

As a suggestion: those scripts tests could be updated to use the stub, to run faster/cheaper tests.

Describe the solution (or solutions) you'd like

Replace occurrences of subprocess.Popen that actually call sub-processes in the scripts tests (at scripts/**/*_test.py) with the PopenStub Stub class.

Describe alternatives you've considered and rejected

No response

Additional context

No response

@oesgalha oesgalha added enhancement Label to indicate an issue is a feature/improvement triage needed labels Nov 14, 2024
@seanlip seanlip added Impact: Medium Will improve quality-of-life for at least 30% of users. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet. labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Label to indicate an issue is a feature/improvement Impact: Medium Will improve quality-of-life for at least 30% of users. Work: Medium The means to find the solution is clear, but it isn't at good-first-issue level yet.
Projects
Status: Todo
Development

No branches or pull requests

2 participants