Skip to content

Add pyright testcases / regression tests to the runtests script #10002

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

Merged
merged 6 commits into from
Apr 14, 2023

Conversation

Avasam
Copy link
Collaborator

@Avasam Avasam commented Apr 3, 2023

No description provided.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense! A few minor points below.

Also, if there are no test cases for a stubs package, on my machine (without pyright installed) a message is printed to the terminal saying that the regression tests for pyright were skipped. But that's not really accurate if there are no regression tests to skip!

@Avasam
Copy link
Collaborator Author

Avasam commented Apr 4, 2023

Also, if there are no test cases for a stubs package, on my machine (without pyright installed) a message is printed to the terminal saying that the regression tests for pyright were skipped. But that's not really accurate if there are no regression tests to skip!

Skipped tests means no work was done towards determining whether it would fail or pass on CI. If the npx command fails (ie not installed), the test is skipped. So it's intended.

That being said, the lack of test_cases is an automatic success (0/0 tests passed). And we can check for that early. Imo it would also be faster to do that additional check rather than letting pyright setup and run on 0 files.

I also just thought that I didn't try or account for stdlib.

@Avasam
Copy link
Collaborator Author

Avasam commented Apr 14, 2023

Updated to first check for the existance of the test_cases folder. It should also now work with stdlib.

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

This still doesn't do what I'd expect:

(.venv) typeshed>python scripts/runtests.py stdlib
usage: runtests.py [-h] [--run-stubtest] path
runtests.py: error: 'path' argument should be in format <folder>/<stub>.

But we have that behaviour on main as well; fixing it can wait for another PR

@AlexWaygood AlexWaygood merged commit 08e6e4c into python:main Apr 14, 2023
@Avasam Avasam deleted the pyright-testcases-runtest branch April 14, 2023 19:47
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