Skip to content

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

Merged
amyreese merged 1 commit intoInstagram:mainfrom
amyreese:pyre
Feb 22, 2023
Merged

Script to regenerate test fixtures, upgrade to Pyre 0.9.10#872
amyreese merged 1 commit intoInstagram:mainfrom
amyreese:pyre

Conversation

@amyreese
Copy link
Copy Markdown
Contributor

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
Copy Markdown

codecov-commenter commented Feb 21, 2023

Codecov Report

❌ Patch coverage is 62.50000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.87%. Comparing base (944ff15) to head (65fa36b).
⚠️ Report is 291 commits behind head on main.

Files with missing lines Patch % Lines
libcst/tests/test_pyre_integration.py 25.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #872      +/-   ##
==========================================
+ Coverage   94.79%   94.87%   +0.07%     
==========================================
  Files         249      249              
  Lines       25831    25813      -18     
==========================================
+ Hits        24487    24489       +2     
+ Misses       1344     1324      -20     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@amyreese
Copy link
Copy Markdown
Contributor 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 amyreese force-pushed the pyre branch 3 times, most recently from 1de82cc to 5e7efdd Compare February 22, 2023 02:50
@amyreese
Copy link
Copy Markdown
Contributor 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
Copy Markdown
Contributor

@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