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

Script to regenerate test fixtures, upgrade to Pyre 0.9.10 #872

Merged
merged 1 commit into from
Feb 22, 2023

Conversation

amyreese
Copy link
Member

Summary

Upgrading Pyre requires updating test fixtures with any upstream changes
to Pyre's query results for the simple_class.py fixture.

This adds a new scripts/ directory to the repo, with a script to
regenerate test fixtures. The script regenerates the cache data fixture,
and updates the TypeInferenceProvider tests to use assertDictEqual
and helpful error messages for better behavior in future mismatches.

This also includes a slight bump to Pyre 0.9.10 to fix install issues on
Apple Silicon M1 Macs, and regenerated fixtures using the script above.

Test Plan

python -m unittest -vk test_type_inference_provider

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Feb 21, 2023
@amyreese amyreese changed the title Script to regenerate test fixtures Script to regenerate test fixtures, upgrade to Pyre 0.9.10 Feb 21, 2023
@amyreese amyreese self-assigned this Feb 21, 2023
@amyreese amyreese requested a review from zsol February 21, 2023 22:22
@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2023

Codecov Report

Base: 94.79% // Head: 94.79% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (ce80f78) compared to base (8aebbb6).
Patch coverage: 100.00% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #872   +/-   ##
=======================================
  Coverage   94.79%   94.79%           
=======================================
  Files         249      249           
  Lines       25831    25832    +1     
=======================================
+ Hits        24487    24488    +1     
  Misses       1344     1344           
Impacted Files Coverage Δ
libcst/matchers/_visitors.py 95.81% <ø> (ø)
...cst/metadata/tests/test_type_inference_provider.py 93.22% <100.00%> (+0.11%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@amyreese
Copy link
Member Author

Sigh, apparently this functionality already exists in the undocumented libcst/tests/test_pyre_integration.py file, not exactly the place I would expect to find a script that updates fixtures...

@amyreese
Copy link
Member Author

Removed old script from test stub, updated CI config, and cleaned up lint.

Upgrading Pyre requires updating test fixtures with any upstream changes
to Pyre's query results for the `simple_class.py` fixture.

This adds a new `scripts/` directory to the repo, with a script to
regenerate test fixtures. The script regenerates the cache data fixture,
and updates the `TypeInferenceProvider` tests to use `assertDictEqual`
and helpful error messages for better behavior in future mismatches.

This also includes a slight bump to Pyre 0.9.10 to fix install issues on
Apple Silicon M1 Macs, and regenerated fixtures using the script above.
Copy link
Member

@zsol zsol left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning up the old script

@amyreese amyreese merged commit d94687e into Instagram:main Feb 22, 2023
@amyreese amyreese deleted the pyre branch February 22, 2023 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants