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

[Summer 2021] Create model verification tests #38

Open
r0rshark opened this issue Jul 27, 2021 · 1 comment
Open

[Summer 2021] Create model verification tests #38

r0rshark opened this issue Jul 27, 2021 · 1 comment
Assignees

Comments

@r0rshark
Copy link
Collaborator

r0rshark commented Jul 27, 2021

Currently we have the integration tests which make sure we do not have regression for a limited set of important categories however we do not have a way to make sure that all the models are valid.

The idea is to create a model validation testing system for the Opensource models and run it in the Github CI. This would require

  1. Create a folder in pyre-check/tools/pysa_integration_tests/verify_models with
  • a requirements.txt file which will contain the library dependencies needed for the model defined
  • (probably) a main.py file with an empty main function (just use to run pysa on this folder with the environment created by)
  • Readme explaining the folder content
  1. A python script which
  • Creates a python environment installing the libraries in the requirements.txt
  • Create a Pyre connection with specific configuration options pointing the source_directory to the pyre-check/tools/pysa_integration_tests/verify_models and including the environment created in the previous step. This can be done by creating a temporary .pyre_configuration.local file and specifying "source_directories" configuration. We may run into issue since there is a top level .pyre_configuration file. In this case we can create a temporary top level folder and store the temporary .pyre_configuration file there:
temporary_file_path = pyre_root_dir / hashlib.sha1(
            ",".join((targets or []) + (source_directories or [])).encode()
        ).hexdigest()
  • Call the get_invalid_taint_models
  • Parse the input and allow filtering out based on the model regex or filesystem path. The configuration with the information of which models/filepath to filter out can be a file called verify_models.conf in JSON format
@PulkitMishra PulkitMishra self-assigned this Jul 27, 2021
@0xedward 0xedward added the Fall 2021 Issues related to the Pysa project for MLH Fellowship cohort of Fall 2021 label Sep 20, 2021
@0xedward 0xedward changed the title [Summer 2021] Create model verification tests [Fall 2021] Create model verification tests Sep 20, 2021
@0xedward 0xedward removed the Fall 2021 Issues related to the Pysa project for MLH Fellowship cohort of Fall 2021 label Sep 20, 2021
@0xedward 0xedward changed the title [Fall 2021] Create model verification tests [Summer 2021] Create model verification tests Sep 20, 2021
@0xedward
Copy link
Collaborator

Linking respective PR - facebook#467

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

No branches or pull requests

3 participants